Linux
Network Diagnostics
24 flashcards · answers and spaced-repetition review in the KnowCard app
You want a quick look at the IP addresses under which a Linux box is reachable, but plain hostname only prints the name. Which invocation filters out the relevant addresses, and what is easy to type wrong?
In ip link output the first interface is always lo. What is it, and why does it appear on a machine with no network hardware at all?
Modern Linux names an Ethernet port something like enp0s31f6 instead of the old eth0. What does the ugly name buy you that eth0 didn't?
In ip link output each interface has a 12-hex-digit value after link/ether. What is it and what does it identify?
ip addr on a working interface shows one global IPv6 plus an address starting with fe80. Why can't you reach the box from the internet on the fe80 one?
You run ping with just a target and it never stops. What is its default cadence, and how do you cap it at two probes?
On a dual-stack host you ping a name to test IPv4, but ping keeps hitting the IPv6 address. How do you force it to the protocol you actually want to test?
Pinging google.com fails. One failure prints unknown host, another prints Network is unreachable. Why do these point at completely different things to fix?
ip route prints several lines. Which one tells you the gateway your traffic to the internet actually uses?
traceroute to a reachable host returns nothing but rows of three stars. What is being blocked, and what switches can get around it?
Both ping and traceroute exist, so what does mtr give you that running either one alone doesn't?
You configured a mail server on a remote host and want to confirm it is actually accepting connections on port 25 — without sending mail. Which old command still earns its keep here?
Wi-Fi isn't working and you don't even know if the adapter came up. Which two read-only sources tell you (a) whether the driver loaded and (b) the live link quality?
On Fedora or Ubuntu, /etc/resolv.conf points at a local address (127.0.0.53) because systemd-resolved sits in front. So how do you find the real upstream DNS server actually being used?
A server has several Ethernet ports and you need to know which physical socket is enp0s31f6 before you pull a cable. Any way to make the right one light up?
You need the IP address of a domain's mail server. Why is a single host lookup not enough, and where should you run it from?
Forward DNS can map several names to one IP. What does a reverse lookup with host <IP> return in that case, and how do you run it?
ping never reports a lost packet as an error the way a broken web request would. What is it about ICMP (and UDP) versus TCP that explains this?
You want a list of which ports your own server is listening on — and separately, which connections are currently live. What single command covers both, and how do the options change?
netstat tells you a port is in use but not always which program owns it in a targeted way. How do you ask, by protocol or port, exactly which processes hold a network resource?
In ip link output, alongside your real Ethernet and Wi-Fi ports you also see virbr0, docker0, and vnet8. Are these broken interfaces you should clean up?
Your NIC won't come up and you suspect the wrong kernel module. How do you find which controller you have and which module drives it?
ping6 to a known-good IPv6 host returns connect: The network is not reachable, even though IPv4 works fine. Which check pinpoints the cause, and what result confirms it?
netstat and lsof can only tell you about the local machine. How do you discover which ports are open on a remote host, and what stern rule comes with that tool?
Start learning today
Free to start — download the app or use it in your browser.
