Loading...
Cheat sheet
Quick references for ss, netstat, tcpdump, and traceroute.
# List listening TCP/UDP ports
ss -tuln
# Show established connections with process
ss -tup# List all listening ports
netstat -tulnp
# Show routing table
netstat -rn# Capture traffic to port 443
tcpdump -i eth0 port 443
# Capture DNS traffic
tcpdump -i eth0 udp port 53ping -c 5 api.example.com
traceroute api.example.com# Filter by port
ss -tuln sport = :443
# Filter by process
ss -tup | grep nginx# Show routes
ip route
# Show interfaces
ip link show# Capture traffic to a host and port
tcpdump -i eth0 host 10.0.0.5 and port 5432# List rules
nft list ruleset
# List tables and chains
nft list tables
nft list chains# Test TCP connectivity
nc -vz example.com 443
# Listen on a TCP port
nc -l 0.0.0.0 9000
# UDP test
nc -u -vz example.com 53