Troubleshooting Network Problems


Linux distributions nowadays usually "just work" when it comes to networking, but you might still experience an issue. Following are some basic tips for troubleshooting network problems.

If your network interface appears to be up and running, but you can't get on the Internet, first try pinging your localhost device, at 127.0.0.1. If that doesn't work, stop and go no further, because you have a seriously damaged system. If that works, ping your machine's external IP address. If that doesn't work, make sure networking is enabled on your machine. If it does work, now try pinging other machines on your network, assuming you have any. If you're not successful, it's your interface (assuming your router is okay). Make sure that your cables are plugged in (seriously). Use ifconfig (or iwconfig if it's wireless) to verify the status of your interface and use ifup to turn the interface on, if necessary. Then try ping again.

If your attempt to ping another local computer was successful, next try pinging your router. If you can get to other machines on your network, but you can't get to your router, time to check your routing tables with route (refer to "Display Your IP Routing Table"). If you're missing items from your routing table, add them, as detailed in "Change Your IP Routing Table."

Note

It's much easier to diagnose and fix problems if you have a baseline from which to work. After you know a machine's networking is correct, run route and save the results, so you have a stored blueprint if the routing table goes bonkers and you need to restore something later.


If you can get to your router, try pinging a machine you know will be up and running out on the Internet, like www.google.com or www.apple.com. If that doesn't work, try pinging that same machine's IP address. Yes, that means that you need to have some IP addresses on a sticky note or in a text file on your computer for just such an occasion as this. Here are a few that are good right now; of course, they could change, so you really should look these up yourself.

Site

IP Address

www.google.com

72.14.203.99

www.apple.com

17.254.0.91

www.ubuntu.com

82.211.81.166

www.ibm.com

129.42.16.99

www.granneman.com

216.23.180.5


Note

How do you get those IP addresses? You can ping the machine using its domain name, and ping gives you the IP address, or you can get the same info with traceroute. A quicker method is with the host command, covered earlier in "Perform DNS Lookups."


If you can get to the IP address, but can't get to the domain name, you have a DNS problem. If you're using DHCP, it's time to run dhclient (refer to "Grab a New Address Using DHCP") to try to renew the DNS information provided by your DHCP server. If you're not using DHCP, find the DNS information you need by looking on your router or asking your administrator or ISP, and then add it manually as root to /etc/resolv.conf so that it looks like this, for example:

nameserver 24.217.0.5 nameserver 24.217.0.55 


That's nameserver (a required word), followed by an IP address you're supposed to use for the DNS. If your router can handle it, and you know its IP address (192.168.0.1, let's say), you can always try this first:

nameserver 192.168.0.1 


Try ifdown and then ifup and see if you're good to go. If you're still having problems, time to begin again, starting always with hardware. Is everything seated correctly? Is everything plugged in? After you're sure of that, start checking your software. The worst-case scenario is that your hardware just doesn't have drivers to work with Linux. It's rare, and growing rarer all the time, but it still happens.

Wireless cards, however, can be wildly incompatible with Linux thanks to close-mouthed manufacturers who don't want to help Linux developers make their hardware work. To prevent headaches, it's a good idea to check online to make sure a wireless card you're thinking about purchasing will be copasetic with Linux. Good sites to review include Hardware Supported by Madwifi (http://madwifi.org/wiki/Compatibility); Linux Wireless LAN Support (http://linux-wless.passys.nl/), which is a bit outdated but still useful; and my constantly updated list of bookmarks relating to Linux and wireless connectivity (http://del.icio.us/rsgranne/wireless). When it comes to specific hardware, I can wholeheartedly recommend the Netgear WG511T wireless PCMCIA card. I simply inserted it into my laptop running the latest K/Ubuntu, and it worked immediately.

Oh, and to finish our troubleshooting: If you can successfully ping both the IP address and the domain name, stop reading thisyou're online! Go have fun!



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net