Reverting to previous network settings, Retrieving your server’s network configuration – Apple Mac OS X Server (Administrator’s Guide) User Manual
Page 563

Tools for Advanced Users
563
m create new network services
m set the order of network services
m configure the TCP/IP options of the network services
m set other networking options for the services, such as proxy server information
To use networksetup, open Terminal on a server or administrator computer and open an SSH
session on the remote server whose preferences you want to set up. Type one of the
following commands to review complete information about networksetup:
m “networksetup -printcommands” displays all the available commands.
m “networksetup -help” displays commands plus explanations of them.
m “man networksetup” displays the most complete information, including examples.
Reverting to Previous Network Settings
When you change your network preference settings with networksetup, your previous
settings are saved to the com.apple.preferences.xml.old file located in
/var/db/SystemConfiguration/com.apple.preferences.xml.old
Note that if you make changes to network settings locally using Network preferences, the
settings in the com.apple.preferences.xml.old file will not match the settings you make using
networksetup.
If you want to revert to your previous settings, rename the file “com.apple.preferences.xml”
and then restart the server.
If network settings prevent you from accessing a server using SSH, log in to the server locally
as root and rename the file “com.apple.preferences.xml” (replacing the current file). Restart
the server to apply the settings.
Retrieving Your Server’s Network Configuration
You can use networksetup to find out about the network services on a remote server:
m To display a list of network services in the order in which they are contacted for a
connection along with the corresponding ports and devices, type “networksetup -
listnetworkserviceorder”. An asterisk (*) next to a service means the service is inactive.
m To display a list of all network services, type “networksetup -listallnetworkservices”. An
asterisk (*) next to a service means the service is inactive.
m To display a list of hardware ports with corresponding device names and Ethernet
addresses, type “networksetup -listallhardwareports”.
m To detect new hardware and create a default network service on the hardware, type
“networksetup -detectnewhardware”.
m To display the IP address, subnet mask, router, and Ethernet address for a particular
network service, type “networksetup -getinfo