Apple Mac OS X Server Network Card User Manual


 
Chapter 6 Setting Network Preferences 65
Viewing or Changing Media Settings
To view the media settings for a port:
$ sudo networksetup -getMedia (
devicename
|"
portname
")
To list valid media settings for a port:
$ sudo networksetup -listValidMedia (
devicename
|"
portname
")
To change the media settings for a port:
$ sudo networksetup -setMedia (
devicename
|"
portname
") subtype [option1]
[option2] [...]
Managing Network Port Configurations
Network port configurations are sets of network preferences that can be assigned to a
particular network interface and then enabled or disabled. The Network pane of
System Preferences stores and displays network settings as port configurations.
Creating or Deleting Port Configurations
To list an existing port configuration:
$ sudo networksetup -listallnetworkservices
To create a port configuration:
$ sudo networksetup -createnetworkservice
configuration
hardwareport
To duplicate a port configuration:
$ sudo networksetup -duplicatenetworkservice
configuration
newconfig
To rename a port configuration:
$ sudo networksetup -renamenetworkservice
configuration
newname
To delete a port configuration:
$ sudo networksetup -removenetworkservice
configuration
Activating Port Configurations
To see if a port configuration is on:
$ sudo networksetup -getnetworkserviceenabled
configuration
To enable or disable a port configuration:
$ sudo networksetup -setnetworkserviceenabled
configuration
(on|off)
Changing Configuration Precedence
To list the configuration order:
$ sudo networksetup -listnetworkserviceorder
The configurations are listed in the order that they’re tried when a network connection
is established. An asterisk (
*) marks an inactive configuration.