NETWORKSETUP(8) | System Manager's Manual | NETWORKSETUP(8) |
networksetup
—
configuration tool for network settings in System
Preferences.
networksetup |
[-listnetworkserviceorder ]
[-listallnetworkservices ]
[-listallhardwareports ]
[-detectnewhardware ]
[-getmacaddress
hardwareport]
[-getcomputername ]
[-setcomputername
computername] [-getinfo
networkservice] [-setmanual
networkservice ip subnet router]
[-setdhcp networkservice
[clientid]] [-setbootp
networkservice]
[-setmanualwithdhcprouter
networkservice ip]
[-getadditionalroutes
networkservice]
[-setadditionalroutes
networkservice [dest1 mask1
gate1] [dest2 mask2 gate2] ...
[destN maskN gateN]] [-setv4off
networkservice] [-setv6off
networkservice]
[-setv6automatic
networkservice]
[-setv6linklocal
networkservice]
[-setv6manual networkservice
address prefixLength router]
[-getv6additionalroutes
networkservice]
[-setv6additionalroutes
networkservice [dest1 prefixlength1
gate1] [dest2 prefixlength2 gate2]
... [destN prefixlengthN gateN]]
[-getdnsservers
networkservice]
[-setdnsservers networkservice
dns1 [dns2] [...]] [-getsearchdomains
networkservice]
[-setsearchdomains networkservice
domain1 [domain2] [...]] [-create6to4service
networkservicename]
[-set6to4automatic
networkservice]
[-set6to4manual networkservice
relayAddress] [-getwebproxy
networkservice]
[-setwebproxy networkservice
domain portnumber authenticated username password]
[-setwebproxystate networkservice
on | off]
[-getsecurewebproxy
networkservice]
[-setsecurewebproxy networkservice
domain portnumber authenticated username password]
[-setsecurewebproxystate
networkservice on | off]
[-getsocksfirewallproxy
networkservice]
[-setsocksfirewallproxy
networkservice domain portnumber authenticated username
password] [-setsocksfirewallproxystate
networkservice on | off]
[-getproxybypassdomains
networkservice]
[-setproxybypassdomains
networkservice domain1 [domain2] [...]]
[-getproxyautodiscovery
networkservice]
[-setproxyautodiscovery
networkservice on | off]
[-getairportnetwork device]
[-setairportnetwork device network
[password]] [-getairportpower
device] [-setairportpower
device on | off]
[-listpreferredwirelessnetworks
hardwareport]
[-addpreferredwirelessnetworkatindex
hardwareport network index securitytype [password]]
[-removepreferredwirelessnetwork
hardwareport network]
[-removeallpreferredwirelessnetworks
hardwareport]
[-getnetworkserviceenabled
networkservice]
[-setnetworkserviceenabled
networkservice on | off]
[-createnetworkservice
networkservicename hardwareport]
[-renamenetworkservice
networkservice newnetworkservicename]
[-duplicatenetworkservice
networkservice newnetworkservicename]
[-removenetworkservice
networkservice]
[-ordernetworkservices service1
[service2] [service3] [...]] [-getMTU
hardwareport] [-setMTU
hardwarePort value]
[-listvalidMTUrange
hardwareport] [-getmedia
hardwareport] [-setmedia
hardwareport subtype [option1] [option2] [...]]
[-listvalidmedia
hardwareport] [-createVLAN
name parentdevice tag]
[-deleteVLAN name parentdevice
tag] [-listVLANs ]
[-listdevicesthatsupportVLAN ]
[-isBondSupported device]
[-createBond name [device1]
[device2] [...]] [-deleteBond
bond] [-addDeviceToBond
device bond]
[-removeDeviceFromBond device
bond] [-listBonds ]
[-showBondStatus bond]
[-listpppoeservices ]
[-showpppoestatus name]
[-createpppoeservice device name
account password [pppoeName]]
[-deletepppoeservice
service]
[-setpppoeaccountname service
account] [-setpppoepassword
service password]
[-connectpppoeservice
service]
[-disconnectpppoeservice
service] [-listlocations ]
[-getcurrentlocation ]
[-createlocation location
[populate]] [-deletelocation
location] [-switchtolocation
location] [-version ]
[-help ]
[-printcommands ] |
The networksetup
command is used to
configure network settings typically configured in the System Preferences
application. The networksetup
command requires at
least admin privileges to change network settings. If the "Require an
administrator password to access system-wide preferences" option is
selected in System Preferences > Security & Privacy, then root
privileges are required to change network settings.
Any flag that takes a password will accept "-" in place of the password to indicate it should read the password from stdin.
A list of flags and their descriptions:
-listnetworkserviceorder
-listallnetworkservices
-listallhardwareports
-detectnewhardware
-getmacaddress
hardwareport-getcomputername
-setcomputername
computername-getinfo
networkservice-setmanual
networkservice ip subnet router-setdhcp
networkservice [clientid]-setbootp
networkservice-setmanualwithdhcprouter
networkservice ip-getadditionalroutes
networkservice-setadditionalroutes
networkservice [dest1 mask1
gate1] [dest2 mask2 gate2] ...
[destN maskN gateN]-setv4off
networkservice-setv6off
networkservice-setv6automatic
networkservice-setv6linklocal
networkservice-setv6manual
ip prefixlength router-getv6additionalroutes
networkservice-setv6additionalroutes
networkservice [dest1 prefixlength1
gate1] [dest2 prefixlength2 gate2]
... [destN prefixlengthN gateN]-getdnsservers
networkservice-setdnsservers
networkservice dns1 [dns2] [...]-getsearchdomains
networkservice-setsearchdomains
networkservice domain1 [domain2] [...]-create6to4service
-<newnetworkservicename>
-set6to4automatic
-<newnetworkservicename>
-set6to4manual
-<newnetworkservicename>
-<relayaddress>
-getwebproxy
networkservice-setwebproxy
networkservice domain portnumber authenticated username
password-setwebproxystate
networkservice on | off-getsecurewebproxy
networkservice-setsecurewebproxy
networkservice domain portnumber authenticated username
password-setsecurewebproxystate
networkservice on | off-getsocksfirewallproxy
networkservice-setsocksfirewallproxy
networkservice domain portnumber authenticated username
password-setsocksfirewallproxystate
networkservice on | off-getproxybypassdomains
networkservice-setproxybypassdomains
networkservice domain1 [domain2] [...]-getproxyautodiscovery
networkservice-setproxyautodiscovery
networkservice on | off-setautoproxyurl
networkservice url-getautoproxyurl
networkservice-setsocksfirewallproxystate
networkservice on | off-getairportnetwork
hardwareport-setairportnetwork
hardwareport network [password]-getairportpower
hardwareport-setairportpower
hardwareport on | off-listpreferredwirelessnetworks
hardwareport-addpreferredwirelessnetworkatindex
hardwareport network index securitytype
[password]-removepreferredwirelessnetwork
hardwareport network-removeallpreferredwirelessnetworks
hardwareport-getnetworkserviceenabled
networkservice-setnetworkserviceenabled
networkservice on | off-createnetworkservice
networkservicename hardwareport-renamenetworkservice
networkservice newnetworkservicename-duplicatenetworkservice
networkservice newnetworkservicename-removenetworkservice
networkservice-ordernetworkservices
service1 [service2] [service3] [...]-setMTUAndMediaAutomatically
hardwarePort-getMTU
hardwareport-setMTU
hardwarePort value-listValidMTURange
hardwareport-getMedia
hardwareport-setMedia
hardwareport subtype [option1] [option2] [...]-listValidMedia
hardwareport-createVLAN
name parentdevice tag-deleteVLAN
name parentdevice tag-listVLANs
-listdevicesthatsupportVLAN
-isBondSupported
device-createBond
name [device1] [device2] [...]-deleteBond
bond-addDeviceToBond
device bond-removeDeviceFromBond
device bond-listBonds
-showBondStatus
bond-listpppoeservices
-showpppoestatus
name-createpppoeservice
device name account password [pppoeName]-deletepppoeservice
service-setpppoeaccountname
service account-setpppoepassword
service password-connectpppoeservice
service-disconnectpppoeservice
service-listlocations
-getcurrentlocation
-createlocation
location [populate]-deletelocation
location-switchtolocation
location-version
-help
-printcommands
networksetup
-listallnetworkservices
networksetup
-setmanual "Built-in
Ethernet" 192.168.100.100 255.255.255.0 192.168.100.1
networksetup
-setdnsservers "Built-in
Ethernet" 192.168.100.100 192.168.100.12
networksetup
-setsearchdomains
"Built-in Ethernet" company.com corp.com
networksetup
-setwebproxy "Built-in
Ethernet" proxy.company.com 80
networksetup
-setwebproxy "Built-In
Ethernet" proxy.company.com 80 On authusername authpassword
networksetup
-duplicatenetworkservice
"Built-In Ethernet" "Local LAN"
networksetup
-getdnsservers "Built-In
Ethernet"
networksetup
-setMTU en0 1500
networksetup
-setMedia en0 autoselect
networksetup
-setMedia en0 100baseTX
half-duplex
networksetup
-createBond MyBond en0
en1
networksetup
-addDeviceToBond en0
bond0
networksetup
-setpppoepassword MyPPPoE -
< ~/Desktop/MyPasswordFile.txt
networksetup
-createlocation Home
populate
July 29, 2020 | macOS |