Welcome to part 5! If you haven't read parts 1-4, you can find them here:
Apple MacBook Air M1 for Network Engineers Part 1
Apple MacBook Air M1 for Network Engineers Part 3
Apple MacBook Air M1 for Network Engineers Part 4
So how is the M1 working out?
I have been using the M1 as my daily driver for a few months now. It has far exceeded my expectations. The "Instant On" like an iPad still blows me away, battery life is unbelievable, the Retina screen is amazing, memory management is so good I just don't even think about how many applications I have open.
Recently, I left work, came home, used it for a few hours web browsing, worked on Friday using it for probably 5 hours at three different sites, then Saturday morning I was web browsing and realized that it was at 39% battery! I can't wait until the plague is over and I get to spend 11-14 hours in airports and on planes with it. Oh, wait...
But it's not perfect! The M1 only has two USB-C Thunderbolt ports and the architecture of the M1 only allows a total of two displays - INCLUDING the Retina display. So even if you purchase two USB-C to HDMI adapters you can only drive one monitor. Since I have two 27" monitors in my home office and two 24" monitors at work this was disappointing.
But, it turns out the two monitor limit does not apply to DisplayLink monitors. StarTech.com makes a USB-A to DisplayLink adapter that has two DisplayPort ports and Gigabit Ethernet. It drives both monitors no problem and I can still use the Retina display for a total of three monitors. You do have to go to the Displaylink Downloads page and install the macOS app.
Of course, being USB-A, you still have to use a USB-C to USB-A adapter. I bought two from Satechi.com that have three USB-A ports and one Gigabit Ethernet adapter. That leaves the second USB-C port available for charging so I can work all day on two monitors and still have two USB-A available and Ethernet. They are very high-quality adapters and I can't recommend them enough. If you sign up at Satechi.com you will get discount coupons in your inbox.
In the field, I have been using another Satechi adapter - USB-C ON-THE-GO MULTIPORT ADAPTER. This one has
- USB-C PD charging
- Gigabit Ethernet
- 4K HDMI, VGA
- USB-C data ports
- micro/SD card readers slots
The USB-C to C cable stashes inside the adapter, a really nice feature and it comes with a second, longer USB-C to C cable. I really like it because I can use the USB-C PD port for charging, use Gigabit Ethernet, an external monitor, and a USB-A device while still having the second USB-C port available. Plus, like the other Satechi adapter, it's very solidly built and feels like it will last even getting banged around in my backpack!
One last accessory that I am loving is an OIKWAN 10ft FTDI USB-C to RJ45 Serial Adapter. I didn't know that you could buy 10' cables but the extra length rocks. Plus, I don't need to put in a dongle just to use a console cable.
At this point, we have a macOS system running Big Sur with a great shell, a great terminal, the development tools needed to automate the network, and a vast collection of dongles! Now we will install and configure the tools that make macOS/Linux so much better than Windows.
Here is a list of the apps that we will be installing:
- arp-scan - a command-line tool for system discovery and fingerprinting
- bat - a replacement for cat with colorization
- cdpr - a Cisco Discovery Protocol daemon
- duf - Disk Usage Free an ncurses interface for disk usage
- exa - a replacement for LS that includes a lot of useful features
- iPerf3 - An open-source link performance testing tool
- lft - An alternative to Traceroute. Implements numerous network tracing methods and strategies.
- lsusb - the Linux List USB tool. Useful when you want to see what USB devices are connected
- lldp - an lldp daemon for macOS
- mtr - A network diagnostic tool that combines the functionality of commonly used traceroute and ping programs into a single tool.
- sipcalc - a terminal-based IP calculator
- speedtest-cli - a terminal tool that calls the speedtest.net site.
- tcp traceroute - a part of the IP route2 package from Linux. Useful to be able to use tcp instead of ICMP
- tldr - cli interface to the website https://tldr.sh. Curated list of man pages with exmaples
- Watch - Runs command repeatedly, displaying its output and errors
One of the most common tasks is listing files. Why spend your time squinting at black and white text?
exa is an improved file lister with more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small,
fast, and just one single binary.
brew install exa
List with long, (F) Classify, Tree.
Classify displays file kind indicators next to file names.
exa -lF --group-directories-first
I created an alias for the last command in the .zshrc file.
alias exa1="exa -lFT --group-directories-first"
Now I just have to type "exa1" to execute that long command.
This is a tool that runs continuously to ping the target and calculate the path like traceroute. There is a lot to this tool besides just pinging and tracerouting. You can save the output in CSV or JSON format, use IPv6 addresses, etc. You can use "man mtr" to open the man page or see the Tecmint.com article in the reference section.
MTR is part of the Homebrew collection.
brew install mtr
The first time I ran mtr I got the error below:
└─[$] mtr -4 22.214.171.124
mtr: Failure to start mtr-packet: Invalid argument
A google search found an issue on the mtr github page. I just had to add "/usr/local/sbin" to the path variable. I included a link in the references on how to do that in case you have the same issue.
How to use mtr
Example to www.vectorusa.com from my home lab. Note that you will need to use sudo with mtr.
In this example, I added "-b" and "-y 0" to display the AS number and IP address:
Using TCP or UDP instead of ICMP
sudo mtr --udp -b -y 0 www.vectorusa.com
brew install tldr