
40
Viewing or Changing IP Address, Subnet Mask, or Router Address
You can use the serversetup and networksetup commands to change a computer’s TCP/IP settings.
Important: Changing a server’s IP address isn’t as simple as changing the TCP/IP settings. You must first run the changeip utility to make sure necessary changes are made throughout the system. See “Changing a Server’s IP Address” on page 39.
To list TCP/IP settings for a configuration:
$ sudo networksetup
Example:
$ networksetup
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
To view TCP/IP settings for a particular port or device:
$ serversetup
To change TCP/IP settings for a particular port or device:
$ sudo serversetup
router
To set manual TCP/IP information for a configuration:
$ sudo networksetup
To validate an IP address:
$ serversetup
Displays 0 if the address is valid, 1 if it isn’t.
To validate a subnet mask:
$ serversetup
To set a configuration to use DHCP:
$ sudo networksetup
To set a configuration to use DHCP with a manual IP address:
$ sudo networksetup
To set a configuration to use BootP:
$ sudo networksetup
Chapter 5 Network Preferences