Wired Ethernet Troubleshooting
From Knowledge76
Wired Ethernet Troubleshooting Process
This post will outline some of the steps for troubleshooting a networking problem with wired Ethernet. The general process is to work your way up from verifying that the cable is plugged in to determining that it is an application problem. I am going to assume that you have one network card and it is eth0. Physical Layer
After making sure that your ethernet cable is plugged in and that any status lights are happily blinking in green:
sudo mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok
This tells us that speed and duplexing are correctly negotiated and that the link to your switch/hub/router is good.
Software Driver
Check that the driver is loaded:
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:03:0D:33:CC:F0
inet addr:10.2.3.7 Bcast:10.2.255.255 Mask:255.255.0.0
inet6 addr: fe80::203:dff:fe33:ccf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:311752 errors:0 dropped:0 overruns:0 frame:0
TX packets:100920 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:61526568 (58.6 MiB) TX bytes:12459104 (11.8 MiB)
Interrupt:19 Base address:0xd800</nowiki>}}
If you don't get a response then you'll need to determine which driver should be loading:
lspci |grep Eth
0000:00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)
lsmod | grep mii mii 5760 1 sis900
If there is a driver loaded but ifconfig doesn't provide an interface then try this:
sudo ifconfig eth0 up
Testing the local link
Once the driver is loaded, verify from the output of ifconfig that you have an IP address.
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:03:0D:33:CC:F0
inet addr:10.2.3.7 Bcast:10.2.255.255 Mask:255.255.0.0}}
Find your router's IP address:
route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.2.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 10.2.1.1 0.0.0.0 UG 0 0 0 eth0</nowiki>}}
In this example the router is 10.2.1.1. The UG flag shows that this is the gateway entry.
Try pinging your local router:
ping 10.2.1.1
PING 10.2.1.1 (10.2.1.1) 56(84) bytes of data. 64 bytes from 10.2.1.1: icmp_seq=1 ttl=255 time=9.33 ms 64 bytes from 10.2.1.1: icmp_seq=2 ttl=255 time=1.36 ms 64 bytes from 10.2.1.1: icmp_seq=3 ttl=255 time=5.80 ms --- 10.2.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2001ms rtt min/avg/max/mdev = 1.360/5.500/9.334/3.263 ms</nowiki>}}
Press Ctrl-C after a couple replies to stop it.
If you didn't have an IP address from ifconfig and you are using DHCP then try this:
sudo dhclient eth0
Reaching the Internet by number
If you can ping your local router then the next thing to try is to reach the Internet by number.
>ping 209.98.65.1 PING 209.98.65.1 (209.98.65.1) 56(84) bytes of data. 64 bytes from 209.98.65.1: icmp_seq=1 ttl=254 time=5.45 ms 64 bytes from 209.98.65.1: icmp_seq=2 ttl=254 time=3.87 ms 64 bytes from 209.98.65.1: icmp_seq=3 ttl=254 time=4.71 ms --- 209.98.65.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 3.878/4.684/5.457/0.645 ms</nowiki>}}
If this fails and your gateway is properly set then there may be something wrong with your router or with your ISP. If you can test the connection with another machine or operating system then that'd be worthwhile.
Reaching the Internet by name
ping www.mpr.org
PING www.mpr.org (209.98.65.80) 56(84) bytes of data. 64 bytes from prettygoodgoods.publicradio.org (209.98.65.80): icmp_seq=1 ttl=125 time=3.71 ms 64 bytes from prettygoodgoods.publicradio.org (209.98.65.80): icmp_seq=2 ttl=125 time=4.33 ms 64 bytes from prettygoodgoods.publicradio.org (209.98.65.80): icmp_seq=3 ttl=125 time=3.97 ms --- www.mpr.org ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3002ms rtt min/avg/max/mdev = 3.719/3.967/4.339/0.233 ms</nowiki>}}
If you cannot reach something by name but could by number then you have a DNS problem. You should examine the contents of the /etc/resolv.conf file and make certain that the entries are valid.
cat /etc/resolv.conf
search mpr.org nameserver 10.2.2.10 nameserver 10.2.2.33</nowiki>}}
If you can reach the Internet by name from the command prompt then your networking is good. Any problems from this point are your application.
Additional Troubleshooting
If you know the point at which your process failed then post a thread that includes the diagnostic output from the step before it as well as the failed step. Useful information for people that are going to help you troubleshoot:
Use lspci and lsmod commands previously listed to determine your card type/driver and include them in your post.
cat /etc/network/interfaces ifconfig eth0
route -n

