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

Inspect and configure interfaces, routes, and gateways.

Show brief interface summary

List interfaces with addresses concisely.

bashLINUXipnetworkinterfaces
bash
ip -br address

A compact everyday networking view.

Show route used for destination

Display which route and source address would be used.

bashLINUXiproutenetwork
bash
ip route get 1.1.1.1

Useful when policy routing or multiple interfaces are involved.

Add IP address to interface

Assign an address to an interface.

bashLINUXipaddressnetwork
bash
sudo ip addr add 192.168.50.10/24 dev eth0

Temporary until persisted through distro networking config.

Add static route

Insert a route into the kernel routing table.

bashLINUXiproutenetwork
bash
sudo ip route add 10.20.0.0/16 via 192.168.50.1

Useful for lab environments and temporary routing changes.

Show neighbor cache

Inspect ARP/ND neighbor entries.

bashLINUXiparpnetwork
bash
ip neigh show

Useful for local-L2 reachability troubleshooting.

DNS HTTP and Remote Connectivity

Debug name resolution, HTTP, TLS, and remote host access.

Trace DNS delegation

Follow DNS resolution from root to answer.

bashLINUXdnsdigtrace
bash
dig +trace example.com

Useful when debugging delegation or authoritative-server issues.

Lookup MX records

Query mail exchanger records.

bashLINUXdnsdigmx
bash
dig +short MX example.com

Useful for mail diagnostics.

Verbose HTTP request

Show request/response details and TLS handshake summary.

bashLINUXcurlhttpdebug
bash
curl -v https://example.com

Great for debugging redirects, headers, TLS, and auth.

POST JSON to API

Send JSON body in an HTTP POST request.

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

Useful for quick API testing without a GUI client.

Inspect TLS certificate chain

Connect and print TLS handshake details.

bashLINUXopenssltlsnetwork
bash
openssl s_client -connect example.com:443 -servername example.com

A go-to tool for TLS debugging and certificate inspection.

Create local SSH port forward

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

bashLINUXsshtunnelport-forward
bash
ssh -L 5433:127.0.0.1:5432 user@db-bastion

Useful for securely reaching private services like databases.

Install SSH public key

Copy your public key to a remote account.

bashLINUXsshkeysremote
bash
ssh-copy-id user@server.example.com

Simplifies passwordless SSH setup.

Traffic Capture and Firewall Inspection

Capture packets and inspect firewall state.

Capture traffic on interface

Capture packets on a specific interface.

bashLINUXtcpdumpcapturenetwork
bash
sudo tcpdump -i eth0

Start broad, then add host, port, or protocol filters.

Capture traffic by host and port

Limit packet capture to a host and service port.

bashLINUXtcpdumpcapturenetwork
bash
sudo tcpdump -i any host 10.0.0.10 and port 443

Useful for focusing on one problematic connection.

List iptables rules

Inspect IPv4 firewall rules.

bashLINUXiptablesfirewallnetwork
bash
sudo iptables -L -n -v

Common on older systems and container hosts.

List nftables ruleset

Inspect modern nftables configuration.

bashLINUXnftablesfirewallnetwork
bash
sudo nft list ruleset

Modern Linux firewall inspection on nft-based systems.

Show UFW status

Inspect uncomplicated firewall state.

bashLINUXufwfirewallnetwork
bash
sudo ufw status verbose

Common on Ubuntu servers and personal Linux systems.

Show firewalld settings

Inspect zones and allowed services.

bashLINUXfirewalldfirewallnetwork
bash
sudo firewall-cmd --list-all

Useful on RHEL-family systems that use firewalld.