Network Troubleshooting Commands
Layer 1: The Physical Layer
-
Show interface status:
1 2 3
ip link show ip link set eth0 up ip -br link show
-
Show interface statistics:
1
ip -s -h l show dev enp1s0
-
Check interface speed with ethtool:
1
ethtool eth0
Layer 2: The Data Link Layer
-
Address Resolution Protocol (ARP):
1
ip neighbor show
-
Delete ARP entry:
1
ip neighbor delete 192.168.122.170 dev eth0
Layer 3: The Network/Internet Layer
-
Show IP addresses:
1
ip -br address show
-
Ping utility for testing connectivity:
1
ping 192.168.122.1
-
Trace the route to a host:
1
tracepath -n sat65server
-
Show routing table:
1 2
ip route show ip route show 10.0.0.0/8
Layer 4: The Transport Layer
-
Check listening ports and associated processes:
1 2
ss -tunlp4 sudo ss -tnlp
-
Check TCP connections:
1
ss dst 192.168.122.1
-
Test UDP port with netcat:
1
nc 192.168.122.1 -u 80
Notes:
- The
tracepath
command is used to display the network connectivity path between the local host and a remote host, identifying all routers in the path. - ARP helps resolve IP addresses to MAC addresses, and the ARP table can be manipulated using the
ip neighbor
command. - Tools like
ping
andtraceroute
are crucial for testing network connectivity and identifying routes between hosts.