If you have been following along with parts 1-3, you now have macOS tuned up and some basic applications installed. If you need to review previous blogs in this series:
- Apple MacBook Air M1 for Network Engineers Part 5
- Apple MacBook Air M1 for Network Engineers Part 3
- Apple MacBook Air M1 for Network Engineers Part 2
- Apple MacBook Air M1 for Network Engineers Part 1
In part 4 we will:
- Connect and configure USB Ethernet adapters
- Add a second subnet to the adapter
- Configure vlan tagging
- Take a quick look at IPv6
- Enable Internet Connection Sharing
- Create an LACP bond
- Listing everything about the Network
- The Airport utility - List wireless information
In part 5 we will start installing terminal and networking applications like arp-scan, lldpd, cdpr, etc.
Using USB Ethernet Adapters
Big Sur makes it easy to configure USB Ethernet adapters using the Network Preferences app. Being a network engineer it's common for me to use two different USB Ethernet adapters at the same time.
- Connect one of the adapters
- Open Network Preferences
- Click the + sign on the bottom left of the panel
- The new service dialog will open
- Click the drop-down beside "Interface:" and select the adapter
- You can give it a descriptive name or just click "create"
- Repeat if you need a second adapter.
- Connect Ethernet cables to the adapter and switch.
If both networks have DHCP running the interfaces will just come up.
If there is no DHCP server available, the interfaces will show "Not Connected". That took a little getting used to since normally you think having a link will make the interface go into connected status.
Note: if you change an adapter from DHCP to Manual or Manual to DHCP you have to click Apply before the change goes into effect.
Notice that the second USB Ethernet adapter has a "2" appended to it. In this example, both adapters are identical Satechi USB-C adapters with 3 USB-A ports.
Adding a route
If you need to reach additional networks connected to one of the adapters you will probably need to add a route. It's easy to add a route on MacOS.
Let's say one of our adapters is connected to a surveillance network 10.29.1.0/24 with a gateway of .253. But there is another network 10.29.2.0/24 that you also need to access. You just need to add a route to 10.29.2.0/24.
To display the routing table
To remove the route
Note: The route won't be persistent. When you reboot it will be gone.
Add a second IP Subnet to a USB Ethernet adapter
- Open the Network Preferences app
- Click the "+" sign on the bottom left to add a new service
- Next to "Interface:" pick the USB Ethernet adapter
- Next to "Service Name:" enter a descriptive name.
- Click Create
Adding Vlan tagging
- Click on "Manage Virtual Interfaces..."
- Click the "+" sign
- Click on "New Vlan..."
- Next to "Vlan Name:" enter a descriptive name
- Next to "Tag:" enter 100
- Make sure "Interface:" is the USB 10/100/100 LAN
- Click Create
Using Wireshark to verify the Vlan tagging
A word about IPv6
What if I restrict management access to only subnet 10.10.100.0/24
Now how would you ssh to the MacBook from the Aruba 2930f?
Looking at IPv6 routes
Internet Connection Sharing
Sometimes you need to provide Internet access to a new network to complete your work. For example, recently I was installing a greenfield Ubiquiti network. It included a Cloud Key so it needed Internet access to register and be fully functional. Unfortunately, the Internet access hadn't been installed yet.
I plugged in a second USB Ethernet adapter, connected wireless to my phone set to hotspot mode and used the "Sharing" System Preferences app to configure the sharing.
- Set "Share your connection from:" to wifi
- Put put a check next to the USB Ethernet interface in "To computers using:"
- Under "Service" put a check next to "Internet Sharing"
Now connect the USB Ethernet to the device you need to share Internet with. I have found that it doesn't matter if the USB Ethernet is set to DHCP or manual. The device using the connection gets an address in the range 192.168.2.0/24
Combine Ethernet ports into a virtual port (LACP - Port Channel)
I haven't had a reason to bond two USB-C Ethernet adapters into an LACP bond for bandwidth on my laptop(!) but I have had a need to verify the configuration of a "Trunk" on an Aruba switch or a "Port-Channel" on a Cisco switch.
It's very easy on Big Sur, again, just not so obvious. One caveat is that the bond has to use LACP. To get started:
In the network preferences app, click the funny little icon that looks like a circle with 3 dots in it:
Click on "Manage Virtual Interfaces..."
Click the "+" sign
Click on "New Link Aggregate..."
You should see the new bond with the BSD Name "Bond0"
You can now connect the Ethernet cables to the switch. As we found earlier, the Bond won't show "Connected" until it gets a DHCP assigned address or you manually assign a static IP address.
As expected, it shows both interfaces, A8/B8, on the 5412.
Finally, to show that it worked here is a ping to an access point connected to another switch:
I opened Wireshark and Bond0 appeared in the capture interface dialog. While capturing, this was the title:
Listing everything about the Network!
macOS includes a utility called "networksetup". It has over 100 options! I can't cover all of them here. To see a complete list:
- Open a terminal
- enter networksetup 1
The 1 is an invalid option and networksetup will dump every option out as a list. You can also enter networksetup with no options and it will dump a help screen.
Getting Started with networksetup
List all network hardware:
You can use the
command to list all network services on your Mac. On my M1 I have connected several different USB Ethernet adapters over time and created a Vlan interface. Here are what my services look like:
Now that you have a list of services, you can get information about them. In this case, my current wifi settings:
List all the SSIDs that you have connected to:
networksetup -listpreferredwirelessnetworks en0
List Vlans that have been created:
In this example, I have created vlan 254 using USB adapter en9
The Airport Utility
One thing that every network engineer needs, especially a wireless network engineer, is information about the current Wi-Fi connection and the SSIDs in the area. macOS makes it easy to get this information.
You can hold down the ⌥ key and click on the Wi-Fi icon in the menu bar to get details on the current Wi-Fi connection. This brings up additional information compared to just clicking on the Wi-Fi icon. I don't know why Apple doesn't make this the default. Anyway, here is what the additional menu looks like:
From the terminal
Apple includes a utility called "airport" that lists information about the current Wi-Fi connection and other SSIDs in the area.
But, Apple hid it deep in the operating system. To make it easy to use, create a symbolic link using the following command in the terminal:
Now you can type "airport" from any directory and the command will work.
Display Wi-Fi information
Scan the Wi-Fi environment
Scan a specific SSID
You can include an SSID after the -s to get information on only that SSID:
This example is my lab. You can see that I have two APs, both of which have a 2.4Ghz and 5Ghz radio.
That does it for Part 4. Be sure to check back soon for Part 5!