Apple Mac OS X Server Network Card User Manual


 
68 Chapter 6 Setting Network Preferences
To list TCP/IP settings for a configuration:
$ sudo networksetup -getinfo "configuration"
For example, for Built-In Ethernet, the computer responds with the following output:
$ networksetup -getinfo "Built-In Ethernet"
Manual Configuration
IP Address: 192.168.10.12
Subnet mask: 255.255.0.0
Router: 192.18.10.1
Ethernet Address: 1a:2b:3c:4d:5e:6f
To view TCP/IP settings for port en0:
$ serversetup -getDefaultinfo (
devicename
|"
portname
")
To view TCP/IP settings for a particular port or device:
$ serversetup -getInfo (
devicename
|"
portname
")
To change TCP/IP settings for a particular port or device:
$ sudo serversetup -setInfo (
devicename
|"
portname
")
ipaddress
subnetmask
router
To set manual TCP/IP information for a configuration:
$ sudo networksetup -setmanual "
configuration
"
ipaddress
subnetmask
router
To validate an IP address:
$ serversetup -isValidIPAddress
ipaddress
Displays 0 if the address is valid, 1 if it isn’t.
To validate a subnet mask:
$ serversetup -isValidSubnetMask
subnetmask
To set a configuration to use DHCP:
$ sudo networksetup -setdhcp "
configuration
" [
clientID
]
To set a configuration to use DHCP with a manual IP address:
$ sudo networksetup -setmanualwithdhcprouter "
configuration
"
ipaddress
To set a configuration to use BootP:
$ sudo networksetup -setbootp "
configuration
"