networksetup - command line network preferences


 /usr/sbin/networksetup -listnetworkserviceorder 
An asterisk (*) denotes that a network service is disabled.
(1) Bluetooth DUN (Hardware Port: Bluetooth DUN, Device: Bluetooth-Modem)
(2) TTL232R-3V3 (Hardware Port: TTL232R-3V3, Device: usbserial-FTF07ZXD)
(3) USB-Serial Controller D (Hardware Port: USB-Serial Controller D, Device: usbserial)
(4) Ethernet (Hardware Port: Ethernet, Device: en0)
(5) FireWire (Hardware Port: FireWire, Device: fw0)
(6) Wi-Fi (Hardware Port: Wi-Fi, Device: en1)
(7) Bluetooth PAN (Hardware Port: Bluetooth PAN, Device: en2)
 /usr/sbin/-?                       
-listnetworkserviceorder
-listallnetworkservices

-listallhardwarePorts

Hardware Port: Bluetooth DUN Device: Bluetooth-Modem Ethernet Address: N/A 
Hardware Port: Ethernet Device: en0 Ethernet Address: 64:b9:e8:d1:ea:c6 
Hardware Port: FireWire Device: fw0 Ethernet Address: 64:b9:e8:ff:fe:d1:ea:c6 
Hardware Port: Wi-Fi Device: en1 Ethernet Address: f8:1e:df:d9:47:88 
Hardware Port: Bluetooth PAN Device: en2 Ethernet Address: N/A 
VLAN Configurations
===================

-detectnewhardware
-getmacaddress hardwarePort or device name
-getcomputername
-setcomputername name
-getinfo networkservice
-setmanual networkservice ip subnet router
-setdhcp networkservice [clientid]
-setbootp networkservice
-setmanualwithdhcprouter networkservice ip 
-getadditionalroutes networkservice
-setadditionalroutes networkservice [ dest mask gateway ]*
-setv4off networkservice

-setv6off networkservice
-setv6automatic networkservice
-setv6LinkLocal networkservice
-setv6manual networkservice networkservice address prefixlength router
-getv6additionalroutes networkservice
-setv6additionalroutes networkservice [ dest prefixlength gateway ]*

-getdnsservers networkservice
-setdnsservers networkservice dns1 [dns2] [...] 

-getsearchdomains networkservice
-setsearchdomains networkservice domain1 [domain2] [...] 

-create6to4service newnetworkservicename 
-set6to4automatic networkservice 
-set6to4manual networkservice relayaddress 

-getftpproxy networkservice
-setftpproxy networkservice domain port number authenticated username password
-setftpproxystate networkservice on | off

-getwebproxy networkservice
-setwebproxy networkservice domain port number authenticated username password
-setwebproxystate networkservice on | off

-getsecurewebproxy networkservice
-setsecurewebproxy networkservice domain port number authenticated username password
-setsecurewebproxystate networkservice on | off

-getstreamingproxy networkservice
-setstreamingproxy networkservice domain port number authenticated username password
-setstreamingproxystate networkservice on | off

-getgopherproxy networkservice
-setgopherproxy networkservice domain port number authenticated username password
-setgopherproxystate networkservice on | off

-getsocksfirewallproxy networkservice
-setsocksfirewallproxy networkservice domain port number authenticated username password
-setsocksfirewallproxystate networkservice on | off

-getproxybypassdomains networkservice
-setproxybypassdomains networkservice domain1 [domain2] [...] 

-getproxyautodiscovery networkservice
-setproxyautodiscovery networkservice on | off

-getpassiveftp networkservice
-setpassiveftp networkservice on | off

-getairportnetwork device name
-setairportnetwork device name network [password]

-getairportpower device name
-setairportpower device name on | off

-listpreferredwirelessnetworks device name
-addpreferredwirelessnetworkatindex device name network index security type [password]
-removepreferredwirelessnetwork device name network
-removeallpreferredwirelessnetworks device name

-getnetworkserviceenabled networkservice
-setnetworkserviceenabled networkservice on | off
-createnetworkservice newnetworkservicename hardwarePort
-renamenetworkservice networkservice newnetworkservicename
-duplicatenetworkservice networkservice newnetworkservicename
-removenetworkservice networkservice
-ordernetworkservices service1 service2 service3 ...

-listvalidMTUrange hardwarePort or device name
-getMTU hardwarePort or device name
-setMTU hardwarePort or device name value

-getmedia hardwarePort or device name
-setmedia hardwarePort or device name subtype [option1] [option2] [...]
-listvalidmedia hardwarePort or device name
-createVLAN VLAN name parent device name tag
-deleteVLAN VLAN name parent device name tag
-listVLANs
-listdevicesthatsupportVLAN

-isBondSupported hardwarePort
-listBonds
-showBondStatus bonddevicename
-createBond bondname hardwarePort1 hardwareport2 ...
-addDeviceToBond hardwarePort bonddevicename
-removeDeviceFromBond hardwarePort bonddevicename
-deleteBond bonddevicename

-listpppoeservices
-showpppoestatus service name ie., MyPPPoEService
-createpppoeservice device name ie., en0 service name account name password [pppoe service name]
-setpppoeaccountname service name account name
-setpppoepassword service name password
-connectpppoeservice service name
-disconnectpppoeservice service name
-deletepppoeservice service name

-getcurrentlocation
-listlocations
-createlocation location name [populate]
-deletelocation location name
-switchtolocation location name

-listalluserprofiles
-listloginprofiles service name

-enableloginprofile service name profile name on | off
-deleteloginprofile service name> profile name>

-enableuserprofile profile name on | off
-deleteuserprofile profile name>

-enablesystemprofile service name on | off
-deletesystemprofile service name

-import8021xProfiles service name file path
-export8021xProfiles service name file path yes | no
-export8021xUserProfiles file path yes | no
-export8021xLoginProfiles service name file path yes | no
-export8021xSystemProfile service name file path yes | no

-settlsidentityonsystemprofile service name> file path> passphrase>
-settlsidentityonuserprofile profile name> file path> passphrase

-version
-help
-printcommands