Systems study
Offline — showing the cached copy.
Home / Linux / 6. Networking from the shell

6. Networking from the shell

One-liner. Five commands cover 90% of host-network debugging.

Memorize

  • ip a / ip r — addresses and routes (replaces ifconfig/route).
  • ss -tulpn — listening sockets + owning process (replaces netstat).
  • dig +short, dig +trace, resolvectl query — DNS path and answers.
  • tcpdump -i any -nn 'port 443' — capture; -w file.pcap for Wireshark.
  • curl -w '@timing.txt' -o /dev/null -s https://host — DNS/TCP/TLS/TTFB breakdown.
  • nft list ruleset / iptables -S — firewall truth, not the cloud console.
  • Network namespaces (ip netns) are how containers get isolated stacks.
REQUEST FROM A HOST app DNS route lookup ARP/neighbour TCP TLS HTTP response
Request from a host

Trap. Trusting ping — ICMP can be blocked while TCP works fine (and vice versa). Do this. Test the actual protocol and port you care about.

Check

Which command shows which process is listening on TCP port 8080?