Linux · Systems fluency
How do you use ip and ss for network troubleshooting?
Short answer
ip manages addresses, links, routes, and neighbors, while ss inspects sockets and connection state. Both are part of iproute2 and replace older tools such as ifconfig and netstat.
ip is the modern interface to kernel networking state. ss reads socket information from the kernel and can filter by state, port, or address, which is usually faster and more precise than parsing netstat output.
ip addr show
ip route get 1.1.1.1
ss -tulpn
ss -tan state establishedWhat to check
- ip link shows interface state and errors
- ip addr shows assigned addresses and prefixes
- ip route shows the routing table and default gateway
- ip neigh shows the ARP or neighbor cache
- ss -s summarizes socket counts and memory usage
If a connection is refused, nothing is listening or a firewall rejected it. If it times out, routing, firewall drops, or a blackhole may be involved. If it is established but slow, inspect application latency and TCP retransmits.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How do you see which process owns a listening port?
- 2What is the difference between a refused and a timed-out connection?
- 3How would you inspect a container network namespace?
- 4Why is ss preferred over netstat?
Say it in the interview
ip manages links, addresses, routes, and neighbors, and ss inspects sockets. I use ip route get to see the kernel decision for a destination, and ss -tulpn to find listeners. A refused connection usually means no listener or an explicit reject, while a timeout points to routing or a drop. I also check which network namespace I am in.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Linux mock interview and get scored feedback on depth, clarity and confidence.