A Java service shows `LISTEN *:8080` (or `:::8080`), yet IPv4 clients get `Connection refused` on one host only.
IntermediateTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer
Likely causes → The app opened an IPv6 socket on ::. Normally that also accepts IPv4 via mapped addresses, but on that host net.ipv6.bindv6only=1 (or the app set IPV6_V6ONLY), so it is IPv6-only. Other hosts have the default 0.
Diagnose →
ss -ltn 'sport = :8080' # [::]:8080 only, no 0.0.0.0:8080
sysctl net.ipv6.bindv6only
curl -4 -v http://127.0.0.1:8080/ ; curl -6 -v http://[::1]:8080/
Fix → Set net.ipv6.bindv6only=0, or bind the app explicitly to 0.0.0.0 (Java: -Djava.net.preferIPv4Stack=true, Spring: server.address=0.0.0.0), or open both an IPv4 and IPv6 listener.
Prevent → Keep sysctl baselines identical across a fleet and check ss -ltn output in smoke tests.
More on Sockets, ports, TIME_WAIT and conntrack
`dmesg` is full of `nf_conntrack: nf_conntrack: table full, dropping packet` and new connections randomly time out.Intermediate`ss -s` on a reverse proxy shows 40,000 sockets in `TIME_WAIT`. Is that a problem?BeginnerAn app server's `CLOSE_WAIT` count grows steadily until the service logs `Too many open files`.IntermediateLogs show `accept4(): Too many open files` and the service stops accepting connections.Beginner`dmesg` shows `TCP: request_sock_TCP: Possible SYN flooding on port 443. Sending cookies.`Intermediate`ss -ltn` shows the listener for port 8080 with `Recv-Q 129` and `Send-Q 128`, and clients hang on connect.Advanced