This topic describes how to troubleshoot network failures. You can troubleshoot network failures by checking the network cables, virtual network interface cards (VNICs), physical NICs, VNIC configurations, and routing table.
Procedure
Check the network cables and physical NICs.
Check the servers and switches connected with network cables. The servers are properly functioning if the green light is constantly on. The switches are transmitting data if the green light flashes.
This task is generally performed by an administrator.
You can also run the ethtool ethX command to check whether an NIC is physically connected.
$ethtool eth2 Settings for eth2: Supported ports: [ FIBRE ] Supported link modes: 10000baseT/Full Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: 10000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: No Speed: 10000Mb/s Duplex: Full Port: Other PHYAD: 0 Transceiver: external Auto-negotiation: off Cannot get wake-on-lan settings: Operation not permitted Current message level: 0x00000007 (7) drv probe link Link detected: yesIn this command,
The value of the `Speed` field indicates the speed of the current NIC. In this example, the speed of the NIC is 1000 Mbit/s.
The value Full of the `Duplex` field indicates that the network supports Full Duplex.
The value of the `Link detected` field indicates the current status of the physical connection.
`yes` means that the connection is normal.
Generally, the network speed and the duplex status are automatically negotiated between the host and the network device based on the network protocol, as indicated by the auto-negotiation field in line 8 of the example.
Check the physical NICs.
Run the ifconfig command to display successfully loaded NICs.
Run the ethtool -i ethX command to view the NIC driver.
Run the lspci command to view all devices connected to the pci bus.
Run the lsmod command to view all loaded modules, which are also displayed in the /proc/modules directory.
Generally, when an NIC is successfully loaded, you can run the ifconfig command to view its information. The NIC may be missing in the following scenarios:
The physical NIC is not connected to the pci bus. The NIC is probably faulty if you run the lspci command but cannot detect it.
The NIC module is not loaded.
You can first run the lspci command to find the manufacturer and model number of the NIC indicated by “Ethernet Controller”. Then, run the modprobe command, for example, modprobe 3c509, to load the correct module. If an error occurs, the module does not exist. You need to find the correct module and recompile it.
Check VNIC configurations.
Run the ifconfig command to check the VNIC configurations, such as the IP address and subnet mask.
Correct VNIC configuration errors by modifying ifcfg-ethX configuration files in the /etc/sysconfig/network-scripts directory.
Run the service network restart command to restart the network service.
Check the routing table.
Run the
route -ncommand to check whether the NIC is routed to the target network.Ping the gateway IP address to check the connection to the gateway.
If the gateway is unreachable, it is possible that ICMP data packets are limited by the gateway, or the switch is not properly configured.
For example, if two NICs are provided to support the intranet and Internet services, and the intranet NIC is set as the default gateway, then the Internet services cannot be accessed. In this case, you need to run the
route delete default gwcommand to delete the default gateway, and then run theroute add default gwcommand to add a new default gateway.