skip navigation

www.Hilands.com


Content:: Troubleshooting your network connection

Trouble Shooting a Network Connection Besides the basics of checking the lights on the cable you are using to connect to the internet here are a few more tips. We will be using our systems command line tools to troubleshoot our connection. The tools we will be using are : ping, ipconfig, ifconfig, route, nslookup, tracert and traceroute.

1. Determine your computer IP Address and Gateway
We're going to start by checking out some of your systems basic configurations. We'll do this by determining your the IP Address and Gateway.

On a windows system you can do this by typing the following at the command prompt. # ipconfig The result will look like the following
Windows IP Configuration


Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : domain.com
        IP Address. . . . . . . . . . . . : 192.168.1.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.254
This will show both your computer IP Address and the Gateway you are using.

On a Linux System you can get your IP Address by typing # ifconfig The output will be similar to the following
eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: XXXX::XXX:XXXX:XXXX:XXXX/XX Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:32555020 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27261621 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3611212648 (3.3 GiB)  TX bytes:690325935 (658.3 MiB)
          Interrupt:201 Base address:0xc000
to get your gateway you can run either of the following commands # route
# netstat -nr
The output will appear as follows
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.1.254     0.0.0.0         UG        0 0          0 eth0
The configuration can be found in a variety of places depending on the "flavor" of linux you run. Two common locations are
/etc/network/interfaces
/etc/sysconfig/network
With the work we have completed above we can determine that our IP Address is 192.168.1.1 and our gateway is 192.168.1.254. You may want to write down the numbers that you have found.

If your IP Address starts with 169.254 like 169.254.230.103 your system is configured for a dynamic IP Address and unable to obtain one. This can occur from a multitude of scenarios. (get into this later)

2. Using the Ping command to find where your connection is failing.
We will now use the ping command to run a couple of simple tests. First we will attempt to ping our own computer. (replace 192.168.1.1 with the IP Address you wrote down above) # ping 192.168.1.1 A successful ping will return something similar to the following on a windows system
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=128
On a linux system a successful ping will appear similar to the following
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=5.77 ms
A failure message will look similar to the following
Request timed out.
If you no data is displayed try holding down the CTRL key and pressing the C key (CTRL+C), this will force a break in the ping application. A record of your ping attempts will be displayed upon termination. On windows
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
On Linux
1 packets transmitted, 1 received, 0% packet loss, time 0ms

Pinging your own system should always work, in some cases your systems firewall may block all ICMP packets including your own.

Next we will attempt to ping our Gateways IP Address # ping 192.168.1.254 If you fail connecting to your gateway a few things could have occured. You may have lost connection due to bad wiring or loosing your wireless signal. It is highly recommended to attempt to switch ports on your hub, switch or router and change your ethernet cable. The "tails" on the RJ45 jack that lock the cables into place can break due to age and wear and tear. If you are connecting to a wireless network try to move as close as possible to your wireless access point.

You may need to restart your hub, switch, router or access point. Your network equipment may fail randomly due to heating issues or if the equipment was poorly manufactured.

If our connection so far appears to be working we can try to ping an system on the internet. Google is great for this. ping google.com A failure here can mean multiple things, DNS failure or connection failure. We'll try to ping the IP Address of one of the many google servers. # ping 74.125.19.105 It is possible that this IP Address has changed, call a friend and ask them to ping google.com and tell you the IP address their system finds

3. Testing your DNS settings with nslookup
If your system is able to ping the IP Address and not the Domain name of google you may have an issue with your DNS server. To determine if this is the problem we can use the nslookup tool. # nslookup You should see a > symbol at the prompt type in > google.com A positive response will look like
Non-authoritative answer:
Name:   google.com
Address: 74.125.19.105
Name:   google.com
Address: 74.125.19.147
A failure will appear like the following
** server can't find google.com: NXDOMAIN
If nslookup is not able to resolve the domain name try typing the following in the nslookup console > server 208.67.222.222 This will change the DNS server you are using to an open dns server. More information about OpenDNS can be found at http://www.opendns.com/

You can change your DNS settings in multiple locations. We will be changing the DNS settings on our local system.

From your windows system you can go into the control Panel > Network Connections then the right click on the connection you are using (Local Area Connection, or Wireless Network Connection are common) and go to the properties menu option from the context menu. Select "Internet Protocol (TCP/IP) from the "This connection uses the following items:" window and click the "Properties" button. Select "Use the following DNS server addresses" from the second set of radio buttons.

From a linux system edit your resolv.conf # nano /etc/resolv.confyou will need to restart your connection upon completion "ifup eth0" would be a common command to restart your primary ethernet controller.

Cross over cables
Used when connecting multiple hubs or switches together. Or connecting directly to a single port router. Images for cross over cables can be found here http://digital.ni.com/public.nsf/allkb/72AE8CADA1AF075686256A16005D55B1
Last Modified: 2010-04-11