0.4 Set up your machine (20 minutes)
Networking tools are mostly already installed. Let's check and fill the gaps.
Step 1 — Check what you have
Run each of these. You want a version number, not "command not found".
ping -V 2>/dev/null || ping -c1 127.0.0.1 # reachability test
traceroute --version 2>/dev/null || traceroute -V
dig -v # DNS lookups
curl --version # HTTP client
ss -V 2>/dev/null || netstat --version # socket list (Linux: ss)
tcpdump --version # packet capture
nc -h 2>&1 | head -2 # netcat: manual connections
ip -V 2>/dev/null || ifconfig -h 2>&1|head -1
Step 2 — Install what's missing
macOS (most tools ship built in):
# Homebrew: https://brew.sh (install it first if you don't have it)
brew install iproute2mac mtr bind # 'ip' command, mtr, and dig/host
brew install --cask wireshark # GUI packet analyser
ping, traceroute, netstat, tcpdump, nc, curl, dig are already there.
macOS has netstat rather than ss.
Linux (Debian/Ubuntu):
sudo apt update
sudo apt install -y iproute2 iputils-ping traceroute mtr-tiny dnsutils \
curl netcat-openbsd tcpdump wireshark whois
Windows: the friendliest path is WSL2 (Windows Subsystem for Linux) —
install Ubuntu from the Microsoft Store, then use the Linux commands above.
Native Windows equivalents also exist: ping, tracert, nslookup,
netstat -ano, curl, and Wireshark.
Step 3 — Let yourself capture packets
Packet capture needs privileges.
Linux — either use sudo tcpdump ..., or grant your user permission once:
sudo usermod -aG wireshark $USER # then LOG OUT and back in
macOS — sudo tcpdump ... works. Wireshark will prompt to install ChmodBPF.
Test it:
sudo tcpdump -i any -c 5 -n
You should see five lines of traffic scroll past. If you see
tcpdump: <interface>: You don't have permission to capture, fix privileges above.
Step 4 — Know your own network
Run this and save the output in notes.md — you'll refer to it constantly:
# Linux
ip -br addr ; echo ---- ; ip route ; echo ---- ; cat /etc/resolv.conf
# macOS
ifconfig | grep -A3 '^en' ; echo ---- ; netstat -rn | head -20
echo ---- ; scutil --dns | grep nameserver | head
You are looking for four things:
- Your IP address (something like
192.168.1.50) - Your subnet mask / prefix (
/24or255.255.255.0) - Your default gateway (usually
192.168.1.1) - Your DNS server(s)
Don't worry about what they mean yet — Parts 3 and 4 explain each one. But having your own numbers in front of you makes every example concrete.
A safety note
Everything in this guide is done on your own machine and your own network. Capturing traffic on networks you don't control, or scanning machines you don't own, can be illegal and is definitely rude. Practise at home.