Runbooks

Linux Network Troubleshooting

Summary: Systematic command reference for diagnosing network issues inside Linux containers and VMs. Covers interface state, IP assignment, routing, connectivity, and DHCP — in the order you actually use them when something isn't working.


The Diagnostic Order

Work top to bottom. Don't skip ahead. Each layer depends on the one above it being confirmed good.

  1. Is the interface up?
  2. Does it have an IP?
  3. Is there a route?
  4. Can I reach the gateway?
  5. Can I reach the internet?

Step 1 - Check Interface State

ip link show

Lists all interfaces and their state. Look for UP or DOWN in the flags.

ip link show eth1    # check a specific interface

If an interface is DOWN, bring it up:

ip link set eth1 up

Step 2 - Check IP Assignment

ip addr show

Shows all interfaces with their assigned IPs. Look for inet (IPv4) under the interface you care about.

ip addr show eth1    # check a specific interface

If no IP is assigned and you expect DHCP:

dhclient -v eth1

The -v flag shows exactly what's happening — DISCOVER sent, OFFER received, etc. If you see repeated DISCOVERs with no OFFER, the DHCP server isn't responding (wrong VLAN, DHCP not enabled on that network, or interface on wrong bridge).

If DHCP works but you want to remove a manually set IP:

ip addr del 192.168.90.10/24 dev eth1

Step 3 - Check the Routing Table

ip route show

Shows the main routing table. Look for:

Check a specific routing table (policy routing):

ip route show table storage    # replace 'storage' with your table name

If you get Error: ipv4: FIB table does not exist — the table exists in name but has no routes yet. Add them or check that the post-up commands in /etc/network/interfaces ran correctly.

Check routing rules (which table handles which traffic):

ip rule show

Step 4 - Test Gateway Reachability

Always test the gateway first before trying the internet. If you can't reach the gateway, nothing beyond it will work.

ping -c3 10.10.90.1             # ping default gateway
ping -I eth1 10.10.90.1         # force ping out a specific interface

The -I eth1 flag is critical when you have multiple interfaces — without it, ping uses the default route and you won't know if eth1 specifically works.


Step 5 - Test Internet Connectivity

ping -c3 -I eth1 8.8.8.8
Note: Many VPN providers block ICMP (ping). If ping fails but curl works, that's normal — ICMP being blocked is not the same as no connectivity.
curl --interface eth1 https://ifconfig.me

Returns the public IP address the internet sees for traffic going out eth1. If it returns a VPN IP, the VPN is working correctly on that interface.

wget -qO- --bind-address=10.10.90.5 https://ifconfig.me    # if curl isn't installed

Install curl if missing:

apt install -y curl

DHCP Troubleshooting

Symptom Likely Cause Fix
DISCOVERs sent, no OFFER DHCP server not enabled on VLAN, or wrong bridge/VLAN tagging Check DHCP settings in UniFi/router for that network
Interface down, no IP Interface not brought up ip link set eth1 up && dhclient eth1
IP assigned but ping fails No gateway route, or wrong bridge Check ip route show, verify bridge in Proxmox LXC config
Static IP set but different IP in UniFi DHCP had already leased an IP to the MAC Remove static, run dhclient -v eth1 to get the DHCP lease

Quick Reference

Command What It Does
ip link show List all interfaces and state (UP/DOWN)
ip link set eth1 up Bring interface up
ip addr show Show IPs on all interfaces
ip addr show eth1 Show IPs on specific interface
ip addr del x.x.x.x/24 dev eth1 Remove a manually set IP
ip route show Show main routing table
ip route show table <name> Show a named routing table
ip rule show Show policy routing rules
ping -I eth1 x.x.x.x Ping forcing traffic out eth1
curl --interface eth1 https://ifconfig.me Test internet via specific interface
dhclient -v eth1 Request DHCP with verbose output
Wayne M. Shelton Sr. is a retired military veteran and cybersecurity practitioner. He holds the CISM, CGRC, CySA+, Security+, and CTT+ certifications and writes about cybersecurity, AI, and ministry technology at waynesheltonsr.com. Contact: [email protected]