In: Computer Science
Please analyze and summarize the accomplishing tasks with Mac OS X network commands and Mac OS X commands in a paragraph or two.
Mac OS X network commands are:
Steps to be followed in the commands given are:
After writing up the presentation for MacSysAdmin in Sweden, I
decided to go ahead and throw these into a quick cheat sheet for
anyone who’d like to have them all in one place. Good luck out
there. Get an ip address for en0: ipconfig getifaddr
en0
.
Same thing, but setting and echoing a variable:
ip=`ipconfig getifaddr en0` ; echo $ip
View the subnet mask of en0: ipconfig getoption en0
subnet_mask
View the dns server for en0: ipconfig
getoption en0 domain_name_server.
Get information about how en0 got its dhcp on: ipconfig
getpacket en1
View some network info: ifconfig
en0
Set en0 to have an ip address of 10.10.10.10 and a
subnet mask of 255.255.255.0: ifconfig en0 inet 10.10.10.10
netmask 255.255.255.0.
Show a list of locations on the computer: networksetup
-listlocations.
Obtain the active location the system is
using: networksetup -getcurrentlocation.
Create a network location called Work and populate it with
information from the active network connection: networksetup
-createlocation Work populate.
Delete a network location called Work: networksetup
-deletelocation Work.
Switch the active location to a
location called Work: networksetup -switchlocation
Work.
Switch the active location to a location called Work, but also
show the GUID of that location so we can make scripties with it
laters: scselect Work.
List all of the network interfaces on the system:
networksetup -listallnetworkservices.
Rename the network service called Ethernet to the word Wired:
networksetup -renamenetworkservice Ethernet Wired.
After enabling the network we have to disable the
networ.
Disable a network interface: networksetup
-setnetworkserviceenabled off.
Change the order of your network services: networksetup
-ordernetworkservices “Wi-Fi” “USB Ethernet”
.
At last we have to set the interface for that we have to use that command.
Set the interface called Wi-Fi to obtain it if it isn’t already
networksetup -setdhcp Wi-Fi
These are the commands for the MAC Os X network commands.