Linux networking cheatsheet
Linux networking: Testing connectivity
6 common Linux networking tasks.
Trace with live statistics
Combine ping and traceroute into a continuously updated report.
mtr --report --report-cycles 10 example.com
Test whether a port is open
Try to connect to a TCP port. -z checks without sending data.
nc -zv example.com 443
Time each phase of a request
Show how long DNS, connecting, TLS and the first byte took.
curl -s -o /dev/null -w "dns %{time_namelookup}s connect %{time_connect}s tls %{time_appconnect}s ttfb %{time_starttransfer}s total %{time_total}s\n" https://example.com
Find the path MTU
Send a packet that must not be fragmented. 1472 bytes plus headers makes 1500. Reduce the size until it succeeds.
ping -c 3 -M do -s 1472 example.com