Linux Networking Admin Cheat Sheet

Comprehensive Linux networking administration reference covering iproute2, DNS, HTTP debugging, TLS, SSH tunnels, packet capture, and firewall inspection.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Interfaces Routing and Addresses
Show brief interface summary
ip -br address

# List interfaces with addresses concisely.

Show route used for destination
ip route get 1.1.1.1

# Display which route and source address would be used.

Add IP address to interface
sudo ip addr add 192.168.50.10/24 dev eth0

# Assign an address to an interface.

Add static route
sudo ip route add 10.20.0.0/16 via 192.168.50.1

# Insert a route into the kernel routing table.

Show neighbor cache
ip neigh show

# Inspect ARP/ND neighbor entries.

## DNS HTTP and Remote Connectivity
Trace DNS delegation
dig +trace example.com

# Follow DNS resolution from root to answer.

Lookup MX records
dig +short MX example.com

# Query mail exchanger records.

Verbose HTTP request
curl -v https://example.com

# Show request/response details and TLS handshake summary.

POST JSON to API
curl -X POST https://api.example.com/items -H 'Content-Type: application/json' -d '{"name":"demo"}'

# Send JSON body in an HTTP POST request.

Inspect TLS certificate chain
openssl s_client -connect example.com:443 -servername example.com

# Connect and print TLS handshake details.

Create local SSH port forward
ssh -L 5433:127.0.0.1:5432 user@db-bastion

# Forward a local port to a remote host/port through SSH.

Install SSH public key
ssh-copy-id user@server.example.com

# Copy your public key to a remote account.

## Traffic Capture and Firewall Inspection
Capture traffic on interface
sudo tcpdump -i eth0

# Capture packets on a specific interface.

Capture traffic by host and port
sudo tcpdump -i any host 10.0.0.10 and port 443

# Limit packet capture to a host and service port.

List iptables rules
sudo iptables -L -n -v

# Inspect IPv4 firewall rules.

List nftables ruleset
sudo nft list ruleset

# Inspect modern nftables configuration.

Show UFW status
sudo ufw status verbose

# Inspect uncomplicated firewall state.

Show firewalld settings
sudo firewall-cmd --list-all

# Inspect zones and allowed services.