Levels 40–45: Networking
Level 40: IP Addressing
Section titled “Level 40: IP Addressing”| Command | What it does |
|---|---|
ip addr |
Show every IP address on every interface |
ip link show |
Show link-layer state (up/down, MAC) |
ip addr add 192.168.1.50/24 dev eth0 |
Assign an address (temporary) |
ip link set eth0 up |
Bring an interface up |
hostname -I |
Quick own-IP check, script-friendly |
Level 41: Routing & Gateways
Section titled “Level 41: Routing & Gateways”| Command | What it does |
|---|---|
ip route |
Show the routing table |
ip route add default via 192.168.1.1 |
Set the default gateway |
ip route add 10.0.0.0/24 via 192.168.1.254 |
Add a static route to a network |
traceroute google.com |
Show each hop to a destination |
mtr google.com |
Continuous traceroute + ping in one view |
Level 42: DNS Tools
Section titled “Level 42: DNS Tools”| Command | What it does |
|---|---|
dig google.com |
Query a domain’s DNS record |
dig google.com MX |
Query a specific record type |
nslookup google.com |
Simpler, terser lookup |
cat /etc/resolv.conf |
Show configured DNS resolvers |
dig -x 8.8.8.8 |
Reverse lookup, IP to hostname |
Level 43: Firewalls
Section titled “Level 43: Firewalls”| Command | What it does |
|---|---|
iptables -L -n |
List current rules, numeric output |
iptables -A INPUT -p tcp --dport 22 -j ACCEPT |
Allow SSH |
nft list ruleset |
List rules the modern way |
ufw allow 22 |
Allow a port, the simple way |
ufw enable |
Turn the firewall on |
Level 44: VLANs & Trunking
Section titled “Level 44: VLANs & Trunking”ip link add link eth0 name eth0.10 type vlan id 10 # VLAN subinterface for tag 10ip link set eth0.10 upip addr add 10.10.10.5/24 dev eth0.10ip -d link show eth0.10 # confirm the VLAN tagip link delete eth0.10 # remove itA trunk port carries multiple tagged VLANs over one physical link; an access port only ever carries one, untagged. The switch port facing a Linux VLAN subinterface needs to be a trunk carrying that tag.
Level 45: Bonding & Troubleshooting
Section titled “Level 45: Bonding & Troubleshooting”| Command | What it does |
|---|---|
tcpdump -i eth0 |
Capture live traffic on an interface |
tcpdump -i eth0 port 443 |
Filter the capture to one port |
cat /proc/net/bonding/bond0 |
Check a bonded interface’s status |
ip link add bond0 type bond mode active-backup |
Create a bonded interface |
ip -s link show eth0 |
Interface statistics: errors, drops |