Networking (Data)

 

  Cellular   Ethernet / Internet
  Pre 4G ~4G  
7 Appl     * End user layer
* HTTP, HTTPS, FTP, IRC, SSH, DNS
6 Pres     * Syntax layer
* SSL, SSH, IMAP, MPEG, JPEG
5 Sess     * Sync & send to port
* API’s, Sockets, WinSock
4 Tspt     * End-to-end connections
* TCP, UDP,
3 Netw Mobile-IP, https://tools.ietf.org/html/draft-ietf-mobileip-protocol-17 (1996)
https://en.wikipedia.org/wiki/Mobile_IP
  * Packets
* IP, ICMP, IPSec, IGMP
2 Dl GPRS   * Frames,
* Ethernet, Wi-Fi, PPP, Switch, Bridge
1 Ph All wireless, it’s mobile comm, duh.
* 1G, 1970s, AMPS, C-Nets, NMT, 450 MHz, 900 MHz
* 2G, 1980s, GSM, CDMA, 900, 1800 MHz
* 3G, 2000s, UMTS, CDMA2000, 900, 1800, 2100 MHz
* 4G, 2010s, LTE, 700 MHz – 2600 MHz
* 5G, 2020s,
  * Physical
* Coax, Fiber, Wireless, Hubs, Repeaters

https://medium.com/@int0x33/day-51-understanding-the-osi-model-f22d5f3df756

https://en.wikipedia.org/wiki/List_of_network_protocols_(OSI_model)

Protocols in general

7

Cellular

Internet

 

 

 

  • Ethernet hardware interface: Not Applicable (Apple laptops doesn’t have any std Ethernet, completely rely of USB-C ports and adapters for basically every external HW interface)

  • Wi-Fi hardware interface: 78:4f:43:90:76:c7 = MAC address for Wi-Fi radio in my laptop

  •  

MBP17:~ johan$ ifconfig

 

 

 

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384

options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>

inet 127.0.0.1 netmask 0xff000000

inet6 ::1 prefixlen 128

inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1

nd6 options=201<PERFORMNUD,DAD>

 

 

gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280

 

 

stf0: flags=0<> mtu 1280

 

 

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

options=400<CHANNEL_IO>

ether 78:4f:43:90:76:c7

inet6 fe80::18fc:9376:df8a:79d7%en0 prefixlen 64 secured scopeid 0x5

inet6 2603:8080:280a:5f27:1826:46c3:ace8:b5ca prefixlen 64 autoconf secured

inet6 2603:8080:280a:5f27:d097:1f69:4774:1ce3 prefixlen 64 autoconf temporary

inet 192.168.0.168 netmask 0xffffff00 broadcast 192.168.0.255

nd6 options=201<PERFORMNUD,DAD>

media: autoselect

status: active

 

 

en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500

options=460<TSO4,TSO6,CHANNEL_IO>

ether 82:dd:79:a8:a8:01

media: autoselect <full-duplex>

status: inactive

 

 

en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500

options=460<TSO4,TSO6,CHANNEL_IO>

ether 82:dd:79:a8:a8:00

media: autoselect <full-duplex>

status: inactive

 

 

en4: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500

options=460<TSO4,TSO6,CHANNEL_IO>

ether 82:dd:79:a8:a8:05

media: autoselect <full-duplex>

status: inactive

 

 

en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500

options=460<TSO4,TSO6,CHANNEL_IO>

ether 82:dd:79:a8:a8:04

media: autoselect <full-duplex>

status: inactive

 

 

en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

options=6467<RXCSUM,TXCSUM,VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>

ether 00:e0:4c:20:0d:80

nd6 options=201<PERFORMNUD,DAD>

media: autoselect (none)

status: inactive

 

 

en8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

options=6467<RXCSUM,TXCSUM,VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>

ether 48:65:ee:11:04:88

inet6 fe80::143d:f75c:c9:e30f%en8 prefixlen 64 secured scopeid 0xb

inet 169.254.249.112 netmask 0xffff0000 broadcast 169.254.255.255

nd6 options=201<PERFORMNUD,DAD>

media: autoselect (1000baseT <full-duplex>)

status: active

 

 

bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

options=63<RXCSUM,TXCSUM,TSO4,TSO6>

ether 82:dd:79:a8:a8:00

Configuration:

id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0

maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200

root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0

ipfilter disabled flags 0x0

member: en1 flags=3<LEARNING,DISCOVER>

ifmaxaddr 0 port 7 priority 0 path cost 0

member: en2 flags=3<LEARNING,DISCOVER>

ifmaxaddr 0 port 9 priority 0 path cost 0

member: en3 flags=3<LEARNING,DISCOVER>

ifmaxaddr 0 port 6 priority 0 path cost 0

member: en4 flags=3<LEARNING,DISCOVER>

ifmaxaddr 0 port 8 priority 0 path cost 0

nd6 options=201<PERFORMNUD,DAD>

media: <unknown type>

status: inactive

 

 

p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304

options=400<CHANNEL_IO>

ether 0a:4f:43:90:76:c7

media: autoselect

status: inactive

 

 

awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484

options=400<CHANNEL_IO>

ether f2:bd:99:4d:52:1d

inet6 fe80::f0bd:99ff:fe4d:521d%awdl0 prefixlen 64 scopeid 0xe

nd6 options=201<PERFORMNUD,DAD>

media: autoselect

status: active

 

 

llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

options=400<CHANNEL_IO>

ether f2:bd:99:4d:52:1d

inet6 fe80::f0bd:99ff:fe4d:521d%llw0 prefixlen 64 scopeid 0xf

nd6 options=201<PERFORMNUD,DAD>

media: autoselect

status: active

 

 

utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380

inet6 fe80::d05f:608a:a765:d5e7%utun0 prefixlen 64 scopeid 0x10

nd6 options=201<PERFORMNUD,DAD>

 

 

utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000

inet6 fe80::786d:1a6d:8e5f:9e86%utun1 prefixlen 64 scopeid 0x11

nd6 options=201<PERFORMNUD,DAD>

 

 

utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380

inet6 fe80::cbfc:974d:efcf:d90b%utun2 prefixlen 64 scopeid 0x12

nd6 options=201<PERFORMNUD,DAD>

 

 

utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380

inet6 fe80::3069:5b0e:c4e6:ddac%utun3 prefixlen 64 scopeid 0x13

nd6 options=201<PERFORMNUD,DAD>

 

 

en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

ether ac:de:48:00:11:22

inet6 fe80::aede:48ff:fe00:1122%en6 prefixlen 64 scopeid 0x4

nd6 options=201<PERFORMNUD,DAD>

media: autoselect

status: active

 

 

MBP17:~ johan$

end of list…

 

 

 

MBP17:~ johan$ networksetup -listallhardwareports

Hardware Port: USB 10/100/1000 LAN
Device: en7
Ethernet Address: 00:e0:4c:20:0d:80

Hardware Port: USB 10/100/1000 LAN
Device: en8
Ethernet Address: 48:65:ee:11:04:88

Hardware Port: Wi-Fi
Device: en0
Ethernet Address: 78:4f:43:90:76:c7

Hardware Port: Bluetooth PAN
Device: en5
Ethernet Address: 78:4f:43:8d:1d:d4

Hardware Port: Thunderbolt 1
Device: en3
Ethernet Address: 82:dd:79:a8:a8:01

Hardware Port: Thunderbolt 2
Device: en1
Ethernet Address: 82:dd:79:a8:a8:00

Hardware Port: Thunderbolt 3
Device: en4
Ethernet Address: 82:dd:79:a8:a8:05

Hardware Port: Thunderbolt 4
Device: en2
Ethernet Address: 82:dd:79:a8:a8:04

Hardware Port: Thunderbolt Bridge
Device: bridge0
Ethernet Address: 82:dd:79:a8:a8:00

VLAN Configurations
===================
MBP17:~ johan$ 

 

 

 

MBP17:~ johan$ networksetup -getairportname en0

networksetup -listnetworkserviceorder

networksetup -listallnetworkservices

networksetup -listallhardwareports

networksetup -detectnewhardware

networksetup -getmacaddress <hardwareport or device name>

networksetup -getcomputername

networksetup -setcomputername <name>

networksetup -getinfo <networkservice>

networksetup -setmanual <networkservice> <ip> <subnet> <router>

networksetup -setdhcp <networkservice> [clientid]

networksetup -setbootp <networkservice>

networksetup -setmanualwithdhcprouter <networkservice> <ip> 

networksetup -getadditionalroutes <networkservice>

networksetup -setadditionalroutes <networkservice> [ <dest> <mask> <gateway> ]*

networksetup -setv4off <networkservice>

networksetup -setv6off <networkservice>

networksetup -setv6automatic <networkservice>

networksetup -setv6LinkLocal <networkservice>

networksetup -setv6manual <networkservice> <networkservice> <address> <prefixlength> <router>

networksetup -getv6additionalroutes <networkservice>

networksetup -setv6additionalroutes <networkservice> [ <dest> <prefixlength> <gateway> ]*

networksetup -getdnsservers <networkservice>

networksetup -setdnsservers <networkservice> <dns1> [dns2] […] 

networksetup -getsearchdomains <networkservice>

networksetup -setsearchdomains <networkservice> <domain1> [domain2] […] 

networksetup -create6to4service <newnetworkservicename> 

networksetup -set6to4automatic <networkservice> 

networksetup -set6to4manual <networkservice> <relayaddress> 

networksetup -getftpproxy <networkservice>

networksetup -setftpproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setftpproxystate <networkservice> <on off>

networksetup -getwebproxy <networkservice>

networksetup -setwebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setwebproxystate <networkservice> <on off>

networksetup -getsecurewebproxy <networkservice>

networksetup -setsecurewebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setsecurewebproxystate <networkservice> <on off>

networksetup -getstreamingproxy <networkservice>

networksetup -setstreamingproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setstreamingproxystate <networkservice> <on off>

networksetup -getgopherproxy <networkservice>

networksetup -setgopherproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setgopherproxystate <networkservice> <on off>

networksetup -getsocksfirewallproxy <networkservice>

networksetup -setsocksfirewallproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

networksetup -setsocksfirewallproxystate <networkservice> <on off>

networksetup -getproxybypassdomains <networkservice>

networksetup -setproxybypassdomains <networkservice> <domain1> [domain2] […] 

networksetup -getproxyautodiscovery <networkservice>

networksetup -setproxyautodiscovery <networkservice> <on off>

networksetup -getpassiveftp <networkservice>

networksetup -setpassiveftp <networkservice> <on off>

networksetup -getairportnetwork <device name>

networksetup -setairportnetwork <device name> <network> [password]

networksetup -getairportpower <device name>

networksetup -setairportpower <device name> <on off>

networksetup -listpreferredwirelessnetworks <device name>

networksetup -addpreferredwirelessnetworkatindex <device name> <network> <index> <security type> [password]

networksetup -removepreferredwirelessnetwork <device name> <network>

networksetup -removeallpreferredwirelessnetworks <device name>

networksetup -getnetworkserviceenabled <networkservice>

networksetup -setnetworkserviceenabled <networkservice> <on off>

networksetup -createnetworkservice <newnetworkservicename> <hardwareport>

networksetup -renamenetworkservice <networkservice> <newnetworkservicename>

networksetup -duplicatenetworkservice <networkservice> <newnetworkservicename>

networksetup -removenetworkservice <networkservice>

networksetup -ordernetworkservices <service1> <service2> <service3> <…>

networksetup -getMTU <hardwareport or device name>

networksetup -setMTU <hardwareport or device name> <value>

networksetup -listvalidMTUrange <hardwareport or device name>

networksetup -getmedia <hardwareport or device name>

networksetup -setmedia <hardwareport or device name> <subtype> [option1] [option2] […]

networksetup -listvalidmedia <hardwareport or device name>

networksetup -createVLAN <VLAN name> <parent device name> <tag>

networksetup -deleteVLAN <VLAN name> <parent device name> <tag>

networksetup -listVLANs

networksetup -listdevicesthatsupportVLAN

networksetup -isBondSupported <hardwareport>

networksetup -createBond <bondname> <hardwareport1> <hardwareport2> <…>

networksetup -deleteBond <bonddevicename>

networksetup -addDeviceToBond <hardwareport> <bonddevicename>

networksetup -removeDeviceFromBond <hardwareport> <bonddevicename>

networksetup -listBonds

networksetup -showBondStatus <bonddevicename>

networksetup -listpppoeservices

networksetup -showpppoestatus <service name ie., MyPPPoEService>

networksetup -createpppoeservice <device name ie., en0> <service name> <account name> <password> [pppoe service name]

networksetup -deletepppoeservice <service name>

networksetup -setpppoeaccountname <service name> <account name>

networksetup -setpppoepassword <service name> <password>

networksetup -connectpppoeservice <service name>

networksetup -disconnectpppoeservice <service name>

networksetup -getcurrentlocation

networksetup -listlocations

networksetup -createlocation <location name> [populate]

networksetup -deletelocation <location name>

networksetup -switchtolocation <location name>

networksetup -listalluserprofiles

networksetup -listloginprofiles <service name>

networksetup -enablesystemprofile <service name> <on off>

networksetup -enableloginprofile <service name> <profile name> <on off>

networksetup -enableuserprofile <profile name> <on off>

networksetup -import8021xProfiles <service name> <file path>

networksetup -export8021xProfiles <service name> <file path> <yes no>

networksetup -export8021xUserProfiles <file path> <yes no>

networksetup -export8021xLoginProfiles <service name> <file path> <yes no>

networksetup -export8021xSystemProfile <service name> <file path> <yes no>

networksetup -settlsidentityonsystemprofile <service name> <file path> <passphrase>

>networksetup -settlsidentityonuserprofile <profile name> <file path> <passphrase>networksetup -deletesystemprofile <service name> 

networksetup -deleteloginprofile <service name> <profile name>

networksetup -deleteuserprofile <profile name>

networksetup -version

networksetup -help

networksetup -printcommands

** Error: The command is not recognized.

 

 

MBP17:~ johan$ networksetup help

networksetup Help Information

——————————-

Usage: networksetup -listnetworkserviceorder

Display services with corresponding port and device in order they are tried for connecting

to a network. An asterisk (*) denotes that a service is disabled.

Usage: networksetup -listallnetworkservices

Display list of services. An asterisk (*) denotes that a network service is disabled.

Usage: networksetup -listallhardwareports

Display list of hardware ports with corresponding device name and ethernet address.

Usage: networksetup -detectnewhardware

Detect new network hardware and create a default network service on the hardware.

Usage: networksetup -getmacaddress <hardwareport or device name>

Display ethernet (or Wi-Fi) address for hardwareport or device specified.

Usage: networksetup -getcomputername

Display the computer name.

Usage: networksetup -setcomputername <name>

Set the computer’s name (if valid) to <name>.

Usage: networksetup -getinfo <networkservice>

Display IPv4 address, IPv6 address, subnet mask,

router address, ethernet address for <networkservice>.

Usage: networksetup -setmanual <networkservice> <ip> <subnet> <router>

Set the <networkservice> TCP/IP configuration to manual with IP address set to ip,

Subnet Mask set to subnet, and Router address set to router.

Usage: networksetup -setdhcp <networkservice> [clientid]

Set the <networkservice> TCP/IP configuration to DHCP. You can set the

  DHCP client id to the optional [clientid]. Specify “Empty” for [clientid]

to clear the DHCP client id.

Usage: networksetup -setbootp <networkservice>

Set the <networkservice> TCP/IP configuration to BOOTP.

Usage: networksetup -setmanualwithdhcprouter <networkservice> <ip> 

Set the <networkservice> TCP/IP configuration to manual with DHCP router with IP address set

to ip.

Usage: networksetup -getadditionalroutes <networkservice>

Get additional IPv4 routes associated with <networkservice>

Usage: networksetup -setadditionalroutes <networkservice> [ <dest> <mask> <gateway> ]*

Set additional IPv4 routes associated with <networkservice>

by specifying one or more [ <dest> <mask> <gateway> ] tuples.

Remove additional routes by specifying no arguments.

If <gateway> is “”, the route is direct to the interface

Usage: networksetup -setv4off <networkservice> 

Turn IPv4 off on <networkservice>. 

Usage: networksetup -setv6off <networkservice> 

Turn IPv6 off on <networkservice>. 

Usage: networksetup -setv6automatic <networkservice> 

Set the service to get its IPv6 info automatically. 

Usage: networksetup -setv6LinkLocal <networkservice> 

Set the service to use its IPv6 only for link local. 

Usage: networksetup -setv6manual <networkservice> <address> <prefixlength> <router>

Set the service to get its IPv6 info manually.

Specify <address> <prefixLength> and <router>.

Usage: networksetup -getv6additionalroutes <networkservice>

Get additional IPv6 routes associated with <networkservice>

Usage: networksetup -setv6additionalroutes <networkservice> [ <dest> <prefixlength> <gateway> ]*

Set additional IPv6 routes associated with <networkservice>

by specifying one or more [ <dest> <prefixlength> <gateway> ] tuples.

Remove additional routes by specifying no arguments.

If <gateway> is “”, the route is direct to the interface

Usage: networksetup -getdnsservers <networkservice>

Display DNS info for <networkservice>.

Usage: networksetup -setdnsservers <networkservice> <dns1> [dns2] […] 

Set the <networkservice> DNS servers to <dns1> [dns2] […]. Any number of dns servers can be

specified. Specify “Empty” for <dns1> to clear all DNS entries.

Usage: networksetup -getsearchdomains <networkservice>

Display Domain Name info for <networkservice>.

Usage: networksetup -setsearchdomains <networkservice> <domain1> [domain2] […] 

Set the <networkservice> Domain Name servers to <domain1> [domain2] […]. Any number of Domain Name

  servers can be specified. Specify “Empty” for <domain1> to clear all Domain Name entries.

Usage: networksetup -create6to4service <newnetworkservicename> 

Create a 6 to 4 service with name <newnetworkservicename>.

Usage: networksetup -set6to4automatic <networkservice> 

Set the service to get its 6 to 4 info automatically. 

Usage: networksetup -set6to4manual <networkservice> <relayaddress>

Set the service to get its 6 to 4 info manually. 

Specify <relayaddress> for the relay address.

Usage: networksetup -getftpproxy <networkservice>

Display FTP proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setftpproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set FTP proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setftpproxystate <networkservice> <on off>

Set FTP proxy to  either <on> or <off>.

Usage: networksetup -getwebproxy <networkservice>

Display Web proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setwebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set Web proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setwebproxystate <networkservice> <on off>

Set Web proxy to  either <on> or <off>.

Usage: networksetup -getsecurewebproxy <networkservice>

Display Secure Web proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setsecurewebproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set Secure Web proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setsecurewebproxystate <networkservice> <on off>

Set SecureWeb proxy to  either <on> or <off>.

Usage: networksetup -getstreamingproxy <networkservice>

Display Streaming proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setstreamingproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set Streaming proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setstreamingproxystate <networkservice> <on off>

Set Streaming proxy to  either <on> or <off>.

Usage: networksetup -getgopherproxy <networkservice>

Display Gopher proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setgopherproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set Gopher proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setgopherproxystate <networkservice> <on off>

Set Gopher proxy to  either <on> or <off>.

Usage: networksetup -getsocksfirewallproxy <networkservice>

Display SOCKS Firewall proxy (server, port, enabled value) info for <networkservice>.

Usage: networksetup -setsocksfirewallproxy <networkservice> <domain> <port number> <authenticated> <username> <password>

Set SOCKS Firewall proxy for <networkservice> with <domain> and <port number>. Turns proxy on. Optionally, specify <on> or <off> for <authenticated> to enable and disable authenticated proxy support. Specify <username> and <password> if you turn authenticated proxy support on.

Usage: networksetup -setsocksfirewallproxystate <networkservice> <on off>

Set SOCKS Firewall proxy to  either <on> or <off>.

Usage: networksetup -getproxybypassdomains <networkservice>

Display Bypass Domain Names for <networkservice>.

Usage: networksetup -setproxybypassdomains <networkservice> <domain1> [domain2] […]

Set the Bypass Domain Name Servers for <networkservice> to <domain1> [domain2] […]. Any number of

Domain Name servers can be specified. Specify “Empty” for <domain1> to clear all

Domain Name entries.

Usage: networksetup -getproxyautodiscovery <networkservice>

Display whether Proxy Auto Discover is on or off for <network service>.

Usage: networksetup -setproxyautodiscovery <networkservice> <on off>

Set Proxy Auto Discovery to either <on> or <off>.

Usage: networksetup -getpassiveftp <networkservice>

Display whether Passive FTP is on or off for <networkservice>.

Usage: networksetup -setpassiveftp <networkservice> <on off>

Set Passive FTP to either <on> or <off>.

Usage: networksetup -setautoproxyurl <networkservice> <url>

Set proxy auto-config to url for <networkservice> and enable it.

Usage: networksetup -getautoproxyurl <networkservice>

Display proxy auto-config (url, enabled) info for <networkservice>.

Usage: networksetup -setautoproxystate <networkservice> <on off>

Set proxy auto-config to either <on> or <off>.

Usage: networksetup -getairportnetwork <device name>

Display current Wi-Fi Network for <device name>.

Usage: networksetup -setairportnetwork <device name> <network> [password]

Set Wi-Fi Network to <network> for <device name>.

If a password is included, it gets stored in the keychain.

Usage: networksetup -getairportpower <device name>

Display whether Wi-Fi power is on or off for <device name>.

Usage: networksetup -setairportpower <device name> <on off>

Set Wi-Fi power for <device name> to either <on> or <off>.

Usage: networksetup -listpreferredwirelessnetworks <device name>

List the preferred wireless networks for <device name>.

Usage: networksetup -addpreferredwirelessnetworkatindex <device name> <network> <index> <security type> [password]

Add wireless network named <network> to preferred list for <device name> at <index>.

For security type, use OPEN for none, WPA for WPA Personal, WPAE for WPA Enterprise, 

WPA2 for WPA2 Personal, WPA2E for WPA2 Enterprise, WEP for plain WEP, and 8021XWEP for 802.1X WEP.

If a password is included, it gets stored in the keychain.

Usage: networksetup -removepreferredwirelessnetwork <device name> <network>

Remove <network> from the preferred wireless network list for <device name>.

Usage: networksetup -removeallpreferredwirelessnetworks <device name>

Remove all networks from the preferred wireless network list for <device name>.

Usage: networksetup -getnetworkserviceenabled <networkservice>

Display whether a service is on or off (enabled or disabled).

Usage: networksetup -setnetworkserviceenabled <networkservice> <on off>

Set <networkservice> to either <on> or <off> (enabled or disabled).

Usage: networksetup -createnetworkservice <newnetworkservicename> <hardwareport>

Create a service named <networkservice> on port <hardwareport>. The new service will be enabled by default.

Usage: networksetup -renamenetworkservice <networkservice> <newnetworkservicename>

Rename <networkservice> to <newnetworkservicename>.

Usage: networksetup -duplicatenetworkservice <networkservice> <newnetworkservicename>

Duplicate <networkservice> and name it with <newnetworkservicename>.

Usage: networksetup -removenetworkservice <networkservice>

Remove the service named <networkservice>. Will fail if this is the only service on the hardware port that <networkservice> is on.

Usage: networksetup -ordernetworkservices <service1> <service2> <service3> <…>

Order the services in order specified. Use “-listnetworkserviceorder” to view service order.

Note: use quotes around service names which contain spaces (ie. “Built-in Ethernet”).

Usage: networksetup -setMTUAndMediaAutomatically <hardwareport or device name>

Set hardwareport or device specified back to automatically setting the MTU and Media.

Usage: networksetup -getMTU <hardwareport or device name>

Get the MTU value for hardwareport or device specified.

Usage: networksetup -setMTU <hardwareport or device name> <value>

Set MTU for hardwareport or device specified.

Usage: networksetup -listvalidMTUrange <hardwareport or device name>

List the valid MTU range for hardwareport or device specified.

Usage: networksetup -getmedia <hardwareport or device name>

Show both the current setting for media and the active media on hardwareport or device specified.

Usage: networksetup -setmedia <hardwareport or device name> <subtype> [option1] [option2] […]

Set media for hardwareport or device specified to subtype. Specify optional [option1] and additional options depending on subtype. Any number of valid options can be specified.

Usage: networksetup -listvalidmedia <hardwareport or device name>

  List valid media options for hardwareport or device name. Enumerates available subtypes and options per subtype.

Usage: networksetup -createVLAN <VLAN name> <device name> <tag>

Create a VLAN with name <VLAN name> over device <device name> with unique tag <tag>. A default network service will be created over the VLAN.

Usage: networksetup -deleteVLAN <VLAN name> <device name> <tag>

Delete the VLAN with name <VLAN name> over the parent device <device name> with unique tag <tag>. If there are network services running over the VLAN they will be deleted.

Usage: networksetup -listVLANs

List the VLANs that have been created.

Usage: networksetup -listdevicesthatsupportVLAN

List the devices that support VLANs.

Usage: networksetup -isBondSupported <device name ie., en0>

Return YES if the specified device can be added to a bond. NO if it cannot.

Usage: networksetup -createBond <user defined name> <device name 1> <device name 2> <…>

Create a new bond and give it the user defined name. Add the specified devices, if any, to the bond.

Usage: networksetup -deleteBond <bond name ie., bond0>

Delete the bond with the specified device-name.

Usage: networksetup -addDeviceToBond <device name> <bond name> 

Add the specified device to the specified bond.

Usage: networksetup -removeDeviceFromBond <device name> <bond name>

Remove the specified device from the specified bond

Usage: networksetup -listBonds

List all of the bonds.

Usage: networksetup -showBondStatus <bond name ie., bond0>

Display the status of the specified bond.

Usage: networksetup -listpppoeservices

List all of the PPPoE services in the current set.

Usage: networksetup -showpppoestatus <service name ie., MyPPPoEService>

Display the status of the specified PPPoE service.

Usage: networksetup -createpppoeservice <device name ie., en0> <service name> <account name> <password> [pppoe service name]

Create a PPPoE service on the specified device with the service name specified.

The “pppoe service name” is optional and may not be supported by the service provider.

Usage: networksetup -deletepppoeservice <service name>

Delete the PPPoE service.

Usage: networksetup -setpppoeaccountname <service name> <account name>

Sets the account name for the specified service.

Usage: networksetup -setpppoepassword <service name> <password>

Sets the password stored in the keychain for the specified service.

Usage: networksetup -connectpppoeservice <service name>

Connect the PPPoE service.

Usage: networksetup -disconnectpppoeservice <service name>

Disconnect the PPPoE service.

Usage: networksetup -getcurrentlocation

Display the name of the current location.

Usage: networksetup -listlocations

List all of the locations.

Usage: networksetup -createlocation <location name> [populate]

Create a new network location with the spcified name.

If the optional term “populate” is included, the location will be populated with the default services.

Usage: networksetup -deletelocation <location name>

Delete the location.

Usage: networksetup -switchtolocation <location name>

Make the specified location the current location.

Usage: networksetup -version

Display version of networksetup tool.

Usage: networksetup -help

Display these help listings.

Usage: networksetup -printcommands

Displays a quick listing of commands (without explanations).

Any command that takes a password, will accept – to indicate the password should be read from stdin.

The networksetup tool 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.

MBP17:~ johan$ 

 

 

MBP17:~ johan$ networksetup -listallnetworkservices

An asterisk (*) denotes that a network service is disabled.

Wi-Fi

LPSS Serial Adapter (1)

LPSS Serial Adapter (2)

USB 10/100/1000 LAN

USB-C QacQoc GN30H

USB 10/100/1000 LAN 3

AX88179 USB 3.0 to Gigabit Ethernet

USB 10/100/1000 LAN 4

USB Ethernet

USB 10/100/1000 LAN 5

USB 10/100/1000 LAN 6

Bluetooth PAN

Thunderbolt Bridge

CV VPN (L2TP)

NordVPN NordLynx

MBP17:~ johan$ 

MBP17:~ johan$ defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences |grep LastConnected -A 7

MBP17:~ johan$ 

MBP17:~ johan$ ifconfig | grep flags=8863 | grep -v bridge

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

en8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

MBP17:~ johan$ man ifconfig

MBP17:~ johan$ networksetup -listallnetworkservices

An asterisk (*) denotes that a network service is disabled.

Wi-Fi

LPSS Serial Adapter (1)

LPSS Serial Adapter (2)

USB 10/100/1000 LAN

USB-C QacQoc GN30H

USB 10/100/1000 LAN 3

AX88179 USB 3.0 to Gigabit Ethernet

USB 10/100/1000 LAN 4

USB Ethernet

USB 10/100/1000 LAN 5

USB 10/100/1000 LAN 6

Bluetooth PAN

Thunderbolt Bridge

CV VPN (L2TP)

NordVPN NordLynx

MBP17:~ johan$ networksetup -listallnetworkservices