How do you capture network traffic on a server?
IntermediateConceptNetworking, SSH & Scheduling
Answer
sudo tcpdump -i eth0 -nn port 443
sudo tcpdump -i any -nn host 10.0.3.7 and port 5432 -c 100
sudo tcpdump -i eth0 -w /tmp/cap.pcap -s0 'tcp port 8080' # analyze in Wireshark
sudo tcpdump -nn 'tcp[tcpflags] & tcp-rst != 0' # resets only
Always filter and limit (-c, -G/-W) on busy hosts.
More on Networking, SSH & Scheduling
Which `ip` commands replace ifconfig, route and arp?BeginnerWhat does `ss` show, and which flags do you use?BeginnerExplain the TCP connection states you see in ss.AdvancedWhat happens, step by step, when you run `curl https://example.com`?AdvancedWhich curl flags are most useful for debugging?BeginnerHow do you use `dig` for DNS troubleshooting?Beginner