3.9 KiB
Certainly! Below is a structured reference guide that incorporates your updates and organizes the troubleshooting steps from Layer 1 to Layer 7 of the OSI model, specifically tailored for Debian-based Linux systems. This guide is designed to be a comprehensive resource for diagnosing and resolving common networking issues.
Introduction
This reference guide is designed to assist with diagnosing and troubleshooting common networking issues on Debian-based Linux systems, following the relevant layers of the OSI model. It includes detailed commands and explanations for each layer, along with general tips and a troubleshooting scenario.
Layer 1 (Physical Layer)
Verify Physical Connection:
- Ensure the Ethernet cable is properly connected.
- Check for link lights on the Ethernet port as a quick physical connectivity indicator.
Layer 2 (Data Link Layer)
Check Interface Status:
ip link show
Look for the UP state to confirm that the interface is active.
Ensure the Correct MAC Address:
ip link show enp6s0
This command checks the MAC address and other physical layer properties.
Layer 3 (Network Layer)
Verify IP Address Assignment:
ip addr show enp6s0
This confirms if an IP address is correctly assigned to the interface.
Check Routing Table:
ip route show
Ensure there's a valid route to the network or default gateway.
Ping Test for Local Network Connectivity:
ping -c 4 <gateway_ip>
ping -c 4 8.8.8.8
ping -c 4 www.google.com
Replace <gateway_ip> with your gateway IP address. Also, ping a public IP address (e.g., Google's DNS server 8.8.8.8) and a domain name to test external connectivity.
Layer 4 (Transport Layer)
Testing Port Accessibility:
nc -zv <destination_ip> <port>
Netcat (nc) can test TCP port accessibility to a destination IP and port.
Layer 7 (Application Layer)
DNS Resolution Test:
dig @<dns_server_ip> www.google.com
Replace <dns_server_ip> with your DNS server IP to test DNS resolution.
HTTP Connectivity Test:
curl -I www.google.com
This command checks for HTTP connectivity to a web service. The -I flag fetches only the headers. Omit it to retrieve the full webpage content.
Additional Commands and Tips
- Renew IP Address:
sudo dhclient -r enp6s0 && sudo dhclient enp6s0
This releases and renews the DHCP lease for the enp6s0 interface.
- Restart and Check Network Manager Status:
sudo systemctl restart NetworkManager
sudo systemctl status NetworkManager
This restarts the network management service and checks its status.
- View Network Manager Logs:
sudo journalctl -u NetworkManager --since today
View today's logs for NetworkManager to identify issues.
- Use
ethtoolfor Diagnosing Physical Link Status and Speed:
ethtool enp6s0
This tool provides a detailed report on the physical link status.
- System Logs for Networking Events:
dmesg | grep -i enp6s0
Check kernel ring buffer messages for the enp6s0 interface.
Troubleshooting Scenario: No Internet Connectivity
- Verify physical connection (Layer 1)
- Check interface status and IP address assignment (Layer 2 & 3)
- Ping gateway, public IP, and domain (Layer 3)
- Check DNS resolution (Layer 7)
- Restart NetworkManager and check status
- Review NetworkManager logs for any errors
- Check system logs for interface-specific messages
Notes:
- Consistent Naming Convention: This guide uses
enp6s0as an example network interface name. Replaceenp6s0with your actual interface name as necessary. - Permissions: Some commands may require
sudoto execute with administrative privileges.
This guide aims to be a comprehensive resource for networking issues on Debian-based Linux systems, following a systematic approach from the physical layer up to the application layer.