ip link showList network links and their state.
Comprehensive Linux networking commands for interfaces, sockets, packet capture, and throughput testing.
Inspect links, IP addresses, MTU, and interface state.
ip link showList network links and their state.
ip addr showDisplay IPv4 and IPv6 addresses on all interfaces.
ip addr show dev eth0Inspect addresses for a specific device.
sudo ip link set dev eth0 upEnable a network interface.
sudo ip link set dev eth0 downDisable a network interface.
sudo ip addr add 192.168.1.10/24 dev eth0Assign an additional IP address to an interface.
sudo ip addr del 192.168.1.10/24 dev eth0Remove an IP address from an interface.
sudo ip link set dev eth0 mtu 9000Change interface MTU size.
sudo ethtool eth0Display link speed, duplex, and driver information.
sudo ethtool -S eth0Display per-interface statistics exposed by the driver.
nmcli device statusList devices managed by NetworkManager and their states.
hostname -IPrint IP addresses assigned to the local host.
Inspect listening ports, established sessions, and owning processes.
ss -ltnpList listening TCP sockets with names.
ss -lunpList listening UDP sockets with names.
ss -tp state establishedDisplay established TCP sessions.
ss -ltnp '( sport = :443 )'Find sockets using a specific local port.
sudo lsof -iTCP:8080 -sTCP:LISTEN -n -PFind which process owns a TCP port.
sudo lsof -i -n -PList network connections for all processes.
sudo fuser 5432/tcpIdentify processes using a TCP port.
nc -vz example.com 443Check whether a remote TCP port is reachable.
nc -lv 9000Open a simple TCP listener for testing.
socat TCP-LISTEN:8080,fork TCP:127.0.0.1:80Create a TCP port forward with socat.
watch -n 2 'ss -s; echo; ss -ltnp'Refresh socket view every 2 seconds.
Capture packets and benchmark throughput.
sudo tcpdump -i eth0Capture packets on a specific network interface.
sudo tcpdump -i any tcp port 443Capture traffic for a single TCP port.
sudo tcpdump -i any host 10.0.0.5Capture traffic to or from a host.
sudo tcpdump -i any -w capture.pcapSave a capture to a file for Wireshark analysis.
tcpdump -nn -r capture.pcapInspect a saved packet capture file.
mtr example.comContinuously test latency and path quality.
iperf3 -sStart a throughput test server.
iperf3 -c 10.0.0.10Benchmark throughput to a remote host.
iperf3 -c 10.0.0.10 -RMeasure reverse-direction throughput.
sudo ping -f 10.0.0.10Use with care on controlled networks only.