Member-only story
netstat Examples
netstat is like a CCTV camera for your network. It shows which ports are open, which apps are listening, and who is connected.
✅ netstat Examples for Practice
1. Show all listening ports
netstat -tulnt→ TCP connectionsu→ UDP connectionsl→ listening socketsn→ numeric (IP/port instead of hostname)
👉 Practice: Check if SSH (22) and HTTP (80) are listening.
2. Show all connections (listening + established)
netstat -a- Displays everything (listening + active connections).
3. Show which process is using a port
netstat -tulpnp→ show process using the socket.
4. Show only TCP connections
netstat -tn5. Show only UDP connections
netstat -un6. Show routing table (like route -n)
netstat -rn- Displays kernel routing table.
- Useful to check default gateway.






