Host networking: sockets, port exhaustion, conntrack, filtering, MTU, ARP, and packet capture

Every table on a host is indexed by the 5-tuple: sockets, conntrack, filters. Name the table that is full and the fix follows — and 'refused' versus 'timed out' is the first bisection.

Read the briefing
About 4 min to read 12 drills

What to remember

  1. Refused means a RST came back; timeout means silence. Refused = reachable and rejecting. Timeout = dropped somewhere. Different layers, different fixes.
  2. Ephemeral ports ÷ 60s TIME_WAIT ≈ your connection rate ceiling. About 470/s per destination by default. The fix is pooling, not sysctls.
  3. 'nf_conntrack: table full' is a real, common outage. Usually UDP entries from DNS storms. Raise the max, shorten UDP timeouts, then fix the source.
  4. Small packets fine, large ones vanish? MTU. ping -M do -s finds the ceiling. Filtered ICMP turns PMTU discovery into a black hole.
  5. CLOSE_WAIT piling up is your bug, not the network's. It means your application never called close().

The big picture

Host networking questions are where SRE loops separate people who can read ss from people who recite the OSI model. The topics that recur: sockets and their states, ephemeral port and TIME_WAIT exhaustion, the conntrack table filling up, packet filtering with nftables/iptables, MTU and fragmentation, ARP, and the ability to capture the right packets with tcpdump. All of them explain outages that look like "the network is flaky".

The mental model

A connection is a 5-tuple (protocol, source IP, source port, destination IP, destination port). Every table on the host is indexed by that tuple: the socket table (ss), the conntrack table (NAT and stateful firewall), the filter rules. Exhaustion happens per tuple space: ephemeral ports run out per destination, conntrack runs out per host, file descriptors run out per process. Name the table that is full and the fix follows.

Diagrams

Cannot connect: what the error already told you
connect()
   |
   +--> "Connection refused"  = a RST came back
   |       host reached, nothing listening there
   |       -> ss -ltnp     is it bound to 127.0.0.1?
   |
   +--> "Connection timed out" = silence
   |       -> tcpdump -ni any port N   ON THE SERVER
   |            SYN never arrives  -> security group, route
   |            SYN in, no reply   -> host firewall (DROP)
   |            SYN-ACK goes out   -> return path broken
   |
   +--> connects, then stalls on big responses
           -> MTU / PMTU black hole

In depth

Sockets, states, and ephemeral ports

ss -tanp lists TCP sockets with state and owning process; ss -s summarizes counts. A server socket in LISTEN accepts connections; a full accept queue (somaxconn, backlog) shows as SYNs retried by clients and ListenOverflows in nstat. Outbound connections take an ephemeral port from net.ipv4.ip_local_port_range (default 32768–60999, about 28k ports) per destination tuple; a client making thousands of short connections to one backend runs out, and connect() fails with EADDRNOTAVAIL. After close, the side that closed first holds the tuple in TIME_WAIT for 60 s, which is why the exhaustion is a rate problem, not a count problem: 28k ports / 60 s ≈ 470 new connections per second per destination. Fixes: connection pooling and keep-alive (the real fix), widening the port range, more source IPs, and net.ipv4.tcp_tw_reuse for outbound; never tcp_tw_recycle (removed, and it broke NAT).

conntrack and filtering

Stateful firewalling and NAT need the kernel to remember flows: the conntrack table (net.netfilter.nf_conntrack_max, conntrack -L, /proc/sys/net/netfilter/nf_conntrack_count). When it is full the kernel drops new connections and logs nf_conntrack: table full, dropping packet: the classic cause is a NAT gateway or kube-proxy node handling many short flows, or a DNS storm creating UDP entries. Raise nf_conntrack_max (memory permitting), shorten UDP timeouts, or remove conntrack from paths that do not need it. nftables (front-end nft; iptables is now a compatibility layer) evaluates rules in chains with hooks (prerouting, input, forward, output, postrouting); a rule that drops traffic silently shows as timeouts, one that rejects shows as connection refused. Cloud security groups are stateful and evaluated before the host sees the packet; NACLs are stateless and bite return traffic on ephemeral ports.

MTU, ARP, and tcpdump

MTU: if the path MTU is smaller than the interface MTU and ICMP "fragmentation needed" is filtered, large packets vanish while small ones pass; ping -M do -s <size> finds the ceiling; overlays and VPNs are the usual cause; MSS clamping (nft … tcp option maxseg size set rt mtu) is the common workaround. ARP/ND: the neighbour table (ip neigh) maps next-hop IPs to MACs; a stale or duplicate entry (two hosts with one IP, a VIP failover without gratuitous ARP) produces intermittent reachability that "fixes itself"; arping and ip neigh flush are the tools. tcpdump: capture on the right interface with a tight filter and write to a file (tcpdump -i eth0 -w /tmp/x.pcap 'host 10.0.0.5 and port 5432'), then read with -nn -r or Wireshark; watch for SYNs with no SYN-ACK (drop or filter), retransmissions (loss), RSTs (refused or reset by a middlebox), and ICMP.

Myths and facts

Myth: TIME_WAIT sockets are a leak and should be killed.

Fact: TIME_WAIT is TCP working correctly; exhaustion is a rate problem solved by pooling, not by killing sockets.

Myth: The server runs out of ephemeral ports when many clients connect.

Fact: Inbound connections use the server's listening port; the ephemeral-port limit bites clients making many outbound connections to one destination.

Myth: connection refused and connection timed out mean the same thing.

Fact: Refused means a RST came back (nothing listening or a REJECT rule); timed out means packets were dropped (DROP rule, routing, security group, or a dead host).

Myth: iptables and nftables are different firewalls that can coexist freely.

Fact: Modern iptables is a translation layer over nftables; mixing native nft rules with iptables-nft rules works but is confusing; pick one tool.

Myth: If ping works, the network is fine.

Fact: ICMP proves reachability at small packet sizes; MTU, port filters, and conntrack exhaustion all fail while ping succeeds.

How pros do it

  • Use connection pooling and keep-alive for high-rate clients; treat ephemeral-port exhaustion as an application design bug.
  • Monitor nf_conntrack_count against max on NAT and node hosts; alert at 80%.
  • Set MTU deliberately on tunnels and overlays; clamp MSS where ICMP is filtered.
  • Prefer REJECT over DROP for internal filters so failures are fast and legible; DROP at the edge.
  • Capture packets with a filter to a file, on the host closest to the symptom; look for SYN without SYN-ACK first.

Questions people ask

connect() fails with EADDRNOTAVAIL under load. What is it?

Ephemeral ports exhausted to that destination: each closed connection holds its 4-tuple in TIME_WAIT for 60 s, so about 28,000 ports allow roughly 470 new connections per second to one address and port. The fix is connection reuse (a pool or keep-alive); tcp_tw_reuse for outbound and a wider ip_local_port_range only raise the ceiling. The caveat: it is per destination tuple, so more destination addresses or ports also multiply the space, which is how NAT gateways scale.

How do I tell a firewall DROP from a dead host?

From the client you mostly cannot: both are silence. Capture on the destination: SYNs arriving with no SYN-ACK leaving means the host or its input chain drops them (rule counters name the rule); SYNs never arriving means the path, a security group or a route. The caveat: a full accept queue also drops SYNs silently and looks exactly like a firewall, so read ss -ltn Recv-Q against Send-Q and nstat ListenOverflows before blaming a rule.

Why does a service work from one host and time out from another?

Something differs per source: a security group, NACL or route that keys on the source address, or an MTU difference because one path crosses a tunnel. Bisect by error first (refused versus timed out), then compare traceroute and ping -M do -s from both hosts. The caveat: 'works from one host' includes the server itself, and a service bound to 127.0.0.1 refuses everyone else; check ss -ltnp before anything on the path.

dmesg says 'nf_conntrack: table full, dropping packet'. Now what?

Stop the drops first: raise nf_conntrack_max (each entry is a few hundred bytes, so a million entries costs a few hundred megabytes) and the hash size with it. Then reduce churn: shorten the UDP timeouts if DNS storms are filling it, and find the flow source with conntrack -L summarised by source address. The caveat: the symptom is timeouts, not refusals, so it looks like a network fault; and flows that need no NAT or state can be exempted with notrack.

What does ss show that netstat does not?

The kernel's own view, quickly: ss reads sockets over netlink, so it does not hang on a busy box, and ss -ti exposes per-connection TCP internals (RTT, cwnd, retransmits, send queue) that netstat never had. The caveat: on a LISTEN socket Recv-Q and Send-Q mean accept-queue depth and backlog, not bytes, which trips people who learned the columns on established sockets.

Further reading

Drills · 12

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Pick the strongest answer

Connecting to a service gives Connection refused on one host and hangs until Connection timed out on another. What does each tell you?

  1. Refused means a firewall blocked it; timed out means the service is overloaded. Firewalls that DROP produce timeouts; those that REJECT produce refusals.
  2. They mean the same thing; the difference is which client library you used. The distinction is one of the most useful early signals in network debugging.
  3. Refused indicates a DNS failure. DNS failures surface as name-resolution errors before any connection is attempted.
  4. Refused means a machine answered with a TCP RST — you reached the host and nothing was listening on that port. Timed out means nothing answered at all, which points at a firewall dropping packets, a wrong address, or a routing problem. A RST is a positive answer from a reachable host; silence is the signature of a drop.
In short

Refused means something answered you, but timed out means nothing answered at all.

Why

This is the fastest branch point in network triage and interviewers use it constantly, often as a warm-up before something harder. Answering with what each error sends you to check next is much stronger than just defining the terms.

The common mistake

Treating the two the same and going straight to the firewall. On a refused connection the network already worked.

Read the docs

2 Scenario: what do you do next?

A new service is deployed on port 8443. From the same host curl localhost:8443/health works. From another host in the same subnet it hangs and eventually times out. DNS is not involved; you are using IP addresses throughout.

Step 1. Where do you start?

  1. Confirm what it is bound to: ss -ltnp | grep 8443. A loopback-only bind explains the symptom completely and costs one command to rule out. It is the most common cause, and the cheapest thing to eliminate before touching firewalls or capturing packets.
  2. Start with a packet capture on both ends. A capture is the right tool a step or two later; leading with it is expensive when one ss command may answer it.
  3. Restart the service and try again. Nothing suggests a transient fault, and it destroys the state you would capture.
  4. Open every port in the security group and retest. It might make it work without telling you why, and it leaves a production host exposed while you think.

Step 2. It is bound to 0.0.0.0:8443. tcpdump -ni any port 8443 on the server shows SYNs arriving and nothing going back. What does that narrow it to?

  1. The service is overloaded and cannot accept. Possible in principle, since a full accept queue also drops SYNs silently, but ss -ltn would show Recv-Q at the backlog and nstat ListenOverflows climbing; nothing here shows that, so check the firewall and its rule counters first.
  2. The client's routing is wrong. The SYNs arrived, so the forward path works.
  3. MTU mismatch is fragmenting the handshake. SYNs are tiny; MTU problems appear once large data segments start flowing, not at connection setup.
  4. The packets reach the host and the host is not replying, so the drop is local: a host firewall rule, or a policy dropping the SYN before it reaches the socket. Check nft list ruleset or iptables -L -n -v and look for a rule whose counters are incrementing. SYN in with no SYN-ACK out puts the fault between the NIC and the socket, and the rule counters prove which rule is responsible.

Step 3. A DROP rule above the service's ACCEPT rule is incrementing. What do you fix, and what do you check afterwards?

  1. Fix the rule ordering (or add the allow above the drop) in whatever manages the firewall, not by hand on the host, then re-verify with the same tcpdump and confirm the change survives a config-management run. A hand-edited rule is undone by the next convergence; verifying the same way you diagnosed proves the fix rather than assuming it.
  2. Move the service to a port that happens to be allowed. It hides a firewall misconfiguration that will affect the next service too.
  3. Flush the ruleset with iptables -F to unblock it now. It removes every protection on the host at once, and on some setups it will lock you out of your own SSH session.
  4. Add the allow rule by hand and close the ticket. It works until config management next runs, and then the outage returns with no obvious cause.
In short

Check what the service is bound to with ss -ltnp, capture on the server to see SYNs arrive with no reply, find the DROP rule by its counters, and fix it where the firewall is managed.

Why

The method matters more than the answer: cheap checks first, then a capture to localise the failure, then rule counters to identify the cause, then fix it where the configuration actually lives. That last point separates people who have operated a fleet from people who have fixed one host.

The common mistake

Opening the security group or flushing the ruleset to make it work. It may work, you will not know why, and the next configuration run brings the outage back.

Read the docs

3 Pick the strongest answer

You get paged: a service opens a new TCP connection to a single database host for every query and closes it. At ~500 queries/second it starts failing with connect: cannot assign requested address, and ss -s shows ~28,000 sockets in TIME_WAIT. What is the root cause, and what is the real fix?

  1. DNS resolution is failing intermittently. EADDRNOTAVAIL is a local port allocation failure, unrelated to DNS.
  2. The kernel is leaking sockets; reboot. TIME_WAIT is normal TCP behaviour, not a leak.
  3. Ephemeral ports for that destination are exhausted: each closed connection holds its port in TIME_WAIT for 60 s, so ~28k ports allow ~470 connections/s. Fix: connection pooling/keep-alive; widening the port range only raises the ceiling. The math is the mechanism: ports ÷ TIME_WAIT duration = sustainable new-connection rate per destination.
  4. The database's max_connections is too low. That fails with a database error after connecting, not with a local address error before.
In short

The client ran out of ephemeral ports to that one destination, because each closed connection holds its port in TIME_WAIT for 60 s; the real fix is connection pooling.

Why

The client side owns ephemeral ports, and the 5-tuple space to one destination is small. Pooling changes the design from thousands of connections per second to tens of long-lived ones; tcp_tw_reuse and a wider ip_local_port_range are stopgaps.

The common mistake

Calling TIME_WAIT a leak and reaching for sysctls first. TIME_WAIT is TCP working; the bug is a connection per query.

Read the docs

4 Answer out loud

A client on host A intermittently gets timeouts calling a service on host B. Walk me through how you would prove where packets are lost, including the tcpdump filters and what you would look for at each capture point.

In short

A strong answer captures on both ends at once with a tight filter and reads SYN without SYN-ACK on the server as a host drop, and SYNs that never arrive as a path drop.

What a strong answer does
  • method: Capture on both ends simultaneously with a tight filter (host and port) to files; look for SYN without SYN-ACK on B (host drop) vs SYNs missing at B (path drop); retransmits for loss; RSTs for middleboxes; correlate by timestamps.
  • mechanism: Maps capture patterns to causes: INPUT drop vs security group vs conntrack full vs MTU (large segments only), and names the follow-up check for each.
  • communication: Hypothesis → capture point → expected evidence → conclusion, for each branch.
Why

Interviewers score the two-ended capture, the SYN/SYN-ACK logic, and the mapping from packet patterns to causes; that is what separates network debugging from guessing.

The common mistake

Capturing on one end only. A single capture cannot tell 'never sent' from 'never arrived', which is the whole question.

5 Pick the strongest answer

On a RHEL-family host, iptables -L INPUT -n --line-numbers ends with 12 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited. You run iptables -A INPUT -p tcp --dport 8443 -j ACCEPT, it succeeds, and clients still get No route to host. Why, and what do you do instead?

  1. Chains match first-hit: the REJECT at line 12 already matches every packet, and -A appended your ACCEPT after it, so no packet ever reaches line 13. Insert it above the reject (iptables -I INPUT 12 ...), watch the counters in iptables -L INPUT -n -v to confirm it fires, and make the change in whatever owns the ruleset (firewalld here) so a reload does not undo it. Rule order is the mechanism; 'No route to host' is exactly what an ICMP host-prohibited reject produces, so the client's error already says a reject rule answered.
  2. New rules take effect only after systemctl restart iptables; restart it and the port opens. netfilter rules apply the instant they are loaded; a restart would in fact reload the saved ruleset and drop your unsaved rule.
  3. The chain policy must be DROP; change it to ACCEPT with iptables -P INPUT ACCEPT. The policy applies only to packets no rule matched; here an explicit REJECT rule matches first, and opening the policy would not change that.
  4. The rule needs -m conntrack --ctstate NEW or it will not match the SYN. A plain dport match already matches SYNs; state matches narrow a rule, they never enable it.
In short

Rules match first-hit and your ACCEPT was appended after the catch-all REJECT, so it never fires; insert it above the reject and make the change in the tool that manages the firewall.

Why

First-match evaluation is the one fact that explains most 'my rule does nothing' tickets: an ACCEPT appended after a catch-all REJECT or DROP is unreachable. The strong answer decodes the client's error, fixes the position, proves it with counters, and then moves the change into the tool that owns the ruleset.

Read the docs

6 Read the output

Read this for me: two independent problems are visible here. What are they?

$ ss -ltn
State    Recv-Q   Send-Q      Local Address:Port     Peer Address:Port
LISTEN   129      128             127.0.0.1:8080          0.0.0.0:*
LISTEN   0        4096              0.0.0.0:9100          0.0.0.0:*

$ curl -s -m 2 http://10.0.4.11:8080/health ; echo "exit=$?"
exit=7
  1. Nothing is wrong; exit 7 is a client-side curl bug. Exit 7 is curl's 'failed to connect': the host answered with a RST because nothing listens on 10.0.4.11:8080, which is exactly what a loopback-only bind produces.
  2. The service has crashed, since Recv-Q is non-zero. A crashed process would not hold a LISTEN socket at all.
  3. The service is bound to 127.0.0.1, so it can never accept a remote connection; and its accept queue is full (Recv-Q 129 against a backlog of 128), so it is not accepting the connections it does get. On a listening socket Recv-Q is the completed-connection queue depth and Send-Q is the backlog; equal-or-over means overflow.
  4. Port 8080 is firewalled, and 9100 is exposed when it should not be. ss shows binds, not firewall rules; the 127.0.0.1 bind explains the failure without any firewall.
In short

The service listens only on 127.0.0.1, so no remote host can reach it, and its accept queue is full (Recv-Q 129 against a backlog of 128).

Why

Reading ss output precisely, rather than just noting that the port is open, is what this tests. Two distinct faults in four lines is also realistic: production rarely presents one problem at a time.

Read the docs

7 Pick the strongest answer

A busy proxy shows tens of thousands of sockets in TIME_WAIT. Is that a problem?

  1. Yes — it is a memory leak in the kernel and needs a reboot. Each entry is small and expires on a timer without intervention.
  2. Usually not by itself — TIME_WAIT is the normal state of the side that closed first, held for 2*MSL so late duplicate segments cannot corrupt a new connection. It only matters when it exhausts the ephemeral port range for a given destination, which shows up as connect() failures. The state is correct protocol behaviour; the failure mode it can cause is port exhaustion, and that has its own distinct symptom.
  3. Yes, and the fix is net.ipv4.tcp_tw_recycle. tcp_tw_recycle broke connections from behind NAT and was removed from the kernel in 4.12; recommending it is a strong negative signal.
  4. No, and it can be ignored entirely; TIME_WAIT never causes failures. It genuinely does cause connect failures on a proxy talking to one backend address on high volume.
In short

Usually no: TIME_WAIT is normal TCP behaviour, and it only matters when it uses up the ephemeral ports to one destination.

Why

Interviewers like this because the internet is full of bad advice about it. Knowing that tcp_tw_recycle was removed, and that connection reuse beats every sysctl, marks the difference between someone who has read a blog post and someone who has fixed this.

Read the docs

8 Read the output

This is a Kubernetes node acting as a NAT path. What is happening and what are the fixes, in order?

$ dmesg -T | tail -3
[Tue Sep  2 21:04:11 2026] nf_conntrack: nf_conntrack: table full, dropping packet
[Tue Sep  2 21:04:11 2026] nf_conntrack: nf_conntrack: table full, dropping packet
[Tue Sep  2 21:04:12 2026] nf_conntrack: nf_conntrack: table full, dropping packet
$ cat /proc/sys/net/netfilter/nf_conntrack_count /proc/sys/net/netfilter/nf_conntrack_max
262144
262144
$ conntrack -L 2>/dev/null | awk '{print $1}' | sort | uniq -c
 251804 udp
  10340 tcp
  1. The node has too many pods; drain it. The table is filled by flows, not pods; a single chatty pod can do it.
  2. The conntrack table is full, mostly of UDP entries (likely DNS storms); new connections are dropped. Raise nf_conntrack_max now, shorten the UDP conntrack timeout, then find and fix the DNS-heavy workload (ndots, caching). Count equals max and the kernel says so; the UDP skew names the flow type.
  3. TCP connections are leaking; restart the node. TCP is 4% of entries; UDP dominates.
  4. Disable the firewall to stop tracking. NAT needs conntrack; disabling breaks routing for pods.
In short

The conntrack table is full of UDP entries, probably from DNS; raise nf_conntrack_max now, shorten the UDP timeout, then fix the DNS-heavy workload.

Why

Conntrack entries are per flow, and UDP entries linger for their timeout even though there is no connection to close. DNS-heavy pods (Kubernetes ndots:5 makes every lookup several queries) fill tables fast. The order is stop the drops (raise max), reduce the churn (timeouts, DNS caching), then fix the source.

Read the docs

9 Find what's broken

You load this ruleset on a validator host. Gossip with peers is fine, but RPC clients time out connecting to port 8899 and the node cannot fetch snapshots from an HTTP mirror. Which two lines?

table inet filter {
  chain input {
    type filter hook input priority 0; policy drop;
    ct state established,related accept
    iif lo accept
    tcp dport 22 ip saddr 10.0.0.0/8 accept
    tcp sport 8899 accept
    udp dport 8000-8020 accept
    icmp type echo-request accept
  }
  chain output {
    type filter hook output priority 0; policy drop;
    ct state established,related accept
    tcp dport { 53, 443 } accept
    udp dport 53 accept
    udp sport 8000-8020 accept
  }
}
In short

Line 7 matches the source port of inbound RPC clients instead of the destination port, so their connections are dropped, and line 14 allows no plain HTTP on port 80.

What's broken
  • Line 7: The RPC rule matches on source port 8899, but inbound clients connect from ephemeral source ports to destination port 8899; no client SYN ever matches, so the input policy drops it and clients time out.
  • Line 14: Output allows TCP 53 and 443 only; the snapshot mirror is plain HTTP on 80 (and package repos often are), so those new outbound connections hit the output policy and are dropped.
Why

A default-drop output chain is unusual and unforgiving: every new outbound flow must be listed by its destination, which is how port 80 went missing. The source/destination confusion is on the RPC line: a listener sees clients arriving from ephemeral ports, so sport 8899 can never match a new connection. Line 16 looks like the same mistake but is correct here: the validator binds its gossip, turbine and repair sockets inside its dynamic port range (8000-8020 on this host) and sends from them, so outbound datagrams do carry a source port in that range, and peers may well use a different range. ICMP echo (line 9) and the established rule (line 4) are fine.

Read the docs

10 Scenario: what do you do next?

After a network change, one bare-metal host in a rack can ping every peer, curl -I to internal services works, but git clone and large file downloads from other hosts hang at a few hundred KB. Small API calls succeed. Other hosts in the rack are fine.

Step 1. First hypothesis and how you test it in one minute?

  1. The disk is slow so downloads stall. The transfers stall at a size, not a time; and the other direction would show it.
  2. Reboot the host. Erases the evidence and probably keeps the misconfiguration.
  3. Packet loss; run iperf for ten minutes. Loss would also slow small requests and ping; the size dependence points elsewhere.
  4. MTU black hole: small packets pass, large fail. Test with ping -M do -s 1472 <peer> and then larger sizes to find the largest unfragmented payload, and compare ip link MTU on this host with a healthy peer. The symptom signature is exactly MTU; the test is cheap and decisive.

Step 2. ping -M do -s 8972 fails; -s 1472 works. This host's bond0 has MTU 9000 while the switch port after the change is 1500 and ICMP frag-needed is filtered upstream. Mitigation?

  1. Set the host interface MTU to 1500 now (ip link set bond0 mtu 1500, then persist in the network config) so the host stops emitting frames the path cannot carry; confirm with the same ping test and a large transfer. Aligns the host with the path immediately; reversible; verified by the test that found it.
  2. Switch the bond to active-backup. Bonding mode has nothing to do with frame size.
  3. Ask the network team to allow ICMP so PMTU discovery works, and wait. Worth doing later, but the host is down now and the fix is local.
  4. Enable TCP MSS clamping on every peer. Peers are fine; the broken host is the one sending oversized frames.

Step 3. Systemic fix?

  1. Manage MTU as configuration for hosts and switch ports together (one source of truth), alert on ip -s link TX errors/drops and on failed PMTU probes, and add an MTU probe to the host provisioning checks. Prevents the drift, detects it, and catches it before a host goes live.
  2. Document 'check MTU' in the wiki. A reminder.
  3. Set everything to 1500 forever. Jumbo frames are valuable for storage and RPC traffic; the fix is consistency, not lowest common denominator.
In short

Small packets pass and large ones hang, so it is MTU: test with ping -M do, set the host MTU to 1500 now, then manage MTU for hosts and switch ports together.

Why

'Small works, large fails' is MTU until proven otherwise. ping -M do finds the ceiling, the host and path are compared, the host is aligned immediately, and MTU becomes managed configuration with monitoring. Interviewers love this because the diagnosis is a single decisive test.

Read the docs

11 Quick recall

First command on a host where 'the service is not reachable': list the listening TCP sockets with the process holding each one, without resolving names.

In short

ss -ltnp lists listening TCP sockets with their process and no name lookups.

Accepted

ss -ltnp · ss -tlnp · ss -lntp

Why

l for listening, t for TCP, n to skip DNS and service-name lookups, p for the owning process. It is the first command to run for "is it even listening, and on which address" and the n matters — name resolution on a broken network is what makes netstat appear to hang.

Read the docs

12 Quick recall

Follow-up: how long does Linux hold a closed socket in TIME_WAIT?

In short

A TIME_WAIT socket lasts 60 seconds on Linux, and that value is fixed.

Accepted

60 seconds · 60s · 60

Why

60 seconds (2×MSL as implemented in Linux); it is fixed, which is why exhaustion is a rate problem.

Next lesson The troubleshooting method: mitigate first, bisect by evidence
Drill · Host networking
0:00

Loading…