skip navigation

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  . :
        IP Address. . . . . . . . . . . . :
        Subnet Mask . . . . . . . . . . . :
        Default Gateway . . . . . . . . . :
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:  Bcast:  Mask:
          inet6 addr: XXXX::XXX:XXXX:XXXX:XXXX/XX Scope:Link
          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   U         0 0          0 eth0         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
With the work we have completed above we can determine that our IP Address is and our gateway is You may want to write down the numbers that you have found.

If your IP Address starts with 169.254 like 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 with the IP Address you wrote down above) # ping A successful ping will return something similar to the following on a windows system
Pinging with 32 bytes of data:
Reply from bytes=32 time<1ms TTL=128
On a linux system a successful ping will appear similar to the following
PING ( 56(84) bytes of data.
64 bytes from 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 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 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 It is possible that this IP Address has changed, call a friend and ask them to ping 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 > A positive response will look like
Non-authoritative answer:
A failure will appear like the following
** server can't find NXDOMAIN
If nslookup is not able to resolve the domain name try typing the following in the nslookup console > server This will change the DNS server you are using to an open dns server. More information about OpenDNS can be found at

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
Last Modified: 2010-04-11