PCCITIZEN.com - SAFE COMPUTING/HOME NETWORKING/COMPUTING TIPS/CLEANUP-FIXUP-ADDUP

PicoSearch

 

HOME

START HERE

BE SAFE

ROUTERS

SIGNUP INFO

DIAGRAMS

TROUBLECITY

DEBUGGING

SPYING

WIRELESS

NETWORKING

ENCRYPTION

INTRUDERS

SPYWARE

ADD DISK

ANTIVIRUS

CLEANUP

FIREWALL

REMOTE

LINUX

UPGRADE

WPA!!

SWITCHES/HUBS

PC STUFF

CABLING

BACKUP

ETHERNET

TCP/IP INFO

PC INFO

ADSL INFO

WIRELESS INFO

 

HAVE I HELPED?

 

WE'LL MAKE A SYSADMIN OF YOU YET!

Troubleshooting your home network, and your Internet connection.

You should really take the basic networking course first, if you have not already done that.  This will help to clear up a few networking concepts.  And the next thing you need to do is to check that you are actually behind a NAT/router.  If you have not a clue as to whether this is the case or not, it will become clear during this troubleshooting exercise. 

If you have a home network behind a NAT/router, there are a few simple tests you can perform to check your connectivity.  First, you must figure out your default gateway IP address.  This is the address where you send all of your outbound packets - it is the "gateway" to the outside world.  You can determine this address by issuing a simple command in Win2K/XP - "ipconfig [I am assuming you know how to open a cmd window in XP/Win2K]"  If you are behind a NAT/router, it is the LAN side address of the NAT/router.  For Windows 9X/ME, issue the command "winipcfg" [bring up a command window to do this], which brings up a nice little GUI:

 

For XinXP or Win2K, you will get the following when you type "ipconfig    /all:"

Your may have to find the correct ethernet card or NDIS driver in the drop down box.  For XP of course, there is a nice little GUI which can do this for you so you don't have to do the command line thing.  On the properties window of the network connection, check the "show icon in system tray," and you can then right click on it, and bring up all the good info (only on XP tho!), once you click on the "support" tab , and then the "details" tab:" 

   

While you are at it there, you can see the IP address of your own little PC.  Make note of this.  This is how the gateway is going to talk to your PC.

Note the IP address of your PC - this will tell you if you are behind a NAT/router, as we are hoping here, or if you are hanging out bare on the Internet.  If you have a private address, chances are quite good that you are indeed behind a NAT/router.  If you have a "legal" address, there is a pretty good chance that your PC is facing the Internet all by itself.  Check this page for a discussion on IP addresses.  In general, an IP address like 192.168.something, or 172.16.something, or 10.something is a private address. 

To check the connectivity, just issue the command "ping 192.168.1.254," or whatever the IP address is of your particular gateway.  Or you can issue the command "ping -t 192.168.1.254," which just keeps pinging the gateway until you interrupt it by using CTL-C.  Obviously, you should get "replies" from your gateway, and they should be pretty speedy and consistent, like a few msec.  On Linux, a simple ping command will just run until you interrupt it, the opposite of Windows.  So you know your connection to your NAT/router is working - your home network seems OK, at least from this PC. 

Now you would like to know if your NAT/router is connecting to the Internet.  The best technique is to go into the NAT/router and check to see if it has indeed "connected."   Different NAT/routers report this in different ways.  When the NAT/router "connects," it is assigned an IP address, a default gateway, and a DNS server.  This is assigned by the ISP when your NAT/router does the initial negotiation.  This could be via DHCP if you are a cable modem, or possibly pppoE if you are on an ADSL connection.  PppoE also requires that you be authenticated to the ISP, i.e. your username and password are correct!  See this section for some more info.  Be especially mindful of the fact that the "physical layer" has to be working before any of this "PPP" or "TCP/IP" stuff will work.  This means the ADSL line must be working for ADSL and the Cable Modem line must be working.  So now you can perform the same ping on its default gateway, from the same PC of course.  If you don't know how to do this, just use the IP address listed for your DNS server which you can learn from the ipconfig (or winipcfg) command.  Be careful here, if the NAT/router is in fact not connecting to the Internet, there will be no assigned default gateway, or IP address, or DNS server!!  So using the DNS server won't do you any good unless your NAT/router is connected. 

This site www.whatismyipaddress.com  will report the WAN side IP address.  This of course if the real address where you appear on the Internet.  This of course only works, if you are in fact actually connected to the Internet.  You have to GO to this Internet site in order for it to read the packet you sent it and report back to you.  This address will likely change over the space of days and weeks, so you cannot in general depend on it being the same.

The point we are trying to make here, is that you need to find out your router's default gateway and the DNS server, when in fact your connection is working.  (These will not change from day to day like your WAN side IP address).  You can then use these on the PC when you want to check to see if these are in place!  In fact we can construct a little script (batch file) to do  just this.  Here is a file I constructed and just named "test-adsl.bat"  You can copy and paste it into your PC, and modify the values as appropriate.  The first IP address is the default gateway of your PC, i.e. the The LAN side of the NAT/router.  The second IP address is the gateway address listed in your router - this probably stays the same over long periods of time, though you may want to skip this and just use the DNS server, as specified in the next entry if you find that it changes.  Beware that this can change over time as well, so you need to be careful.  BSIS is just the name of my particular ISP - you can change this!

The next testing we do is to actually check the operation of the DNS server, by attempting to ping several machines by name, instead of IP address.  This checks to see that the actual DNS server is operating.  Many problems are caused on the Internet by non-functioning, slow, or missing DNS servers.  See my explanation of DNS servers for some elucidations....

 

@ECHO OFF
ECHO Ping ADSL-Router by IP address
ECHO This verifies PC-ADSL router.
ECHO It must show "reply from" and be less than 50ms
ping 192.168.1.254
PAUSE
CLS
ECHO ping your gateway
ECHO This verifies connectivity to BSIS
ping 205.152.56.254
PAUSE
CLS
ECHO Ping DNS servers. This verifies PC-INTERNET
ping 205.152.37.254
ping 205.152.0.20
PAUSE
CLS
ECHO Ping by name-Check DNS server operation.
ping www.bellsouth.net
ping www.bucknell.edu
ECHO AT LEAST ONE should have "reply from"
PAUSE


So you can use this script as a quick check of your Internet connectivity.  Just put it, or a shortcut on your desktop someplace.  Much, much, much simpler, and consumes zero resources compared to the connection reliability bloatware that many ISPs install on your PC!  You can even add your email server in there as well, though just pinging it does not meant that the email functionality is actually working! 

There are several things to be careful of in DNS servers and gateways.  You are given usually two DNS servers by your ISP.  But your PC will NOT use the second one, until timeouts have occurred attempting to use the first DNS server.  So it is not like your PC will do a round robin between the two.  It uses only a single DNS server, until it times out, and then it will switch to the secondary DNS server.  The timeouts tend to be on the order of 15-30 seconds.  And you must understand this - the next time it wants to do a DNS query, it reverts to the first, potentially nonworking one!  So the second DNS address is indeed a backup choice, for each DNS query.  The PC does not switch to the second DNS server and stay there!  A lot of time, this is the delay and stalling that you are experiencing.  You must also be careful of assigning static DNS servers in some of your network settings.  Sometimes this is appropriate, especially when your ISP is having all kinds of DNS problems - just specify your local university's DNS server in the meantime.  It will work just fine.  You can use anybody's DNS server, though they may not always appreciate it.  [This is becoming less and less true..... I have noticed that when I specify a different DNS server, it actually denies me!  So some of the ISPs are restricting the use of the DNS server to their customers.]  You should use the one assigned by your ISP, however, assuming things are working, and it should be left as dynamic, to allow the movement and upgrading and fallback mechanisms to work properly.  .  Here is a neat debugging tool you can use on Windows XP.  Simply go into services via "run -> services.msc."  Turn OFF-STOP the DNS client!  You will still be making DNS queries, but you won't have all the fancy software surrounding the DNS queries, such as caching, negative caching, etc. 

Gateways are similar, in some ways.....   Occasionally you will be on a network where there are multiple gateways out of the network.  This tends NOT to be the case on simple home networks with ADSL or cable modem connections, but it can happen in more complicated environments.  A PC will only use a SINGLE gateway until it times out, in which case it will switch to the backup gateway.  You can get pretty fancy in your setups if you want to use a dialup as a backup for your ADSL or cable modem. 

You also want to be careful of specifying static settings on your home PCs.  Behind a NAT/router, this can be acceptable, as long as your remember that if you ever change your home network, you must change these settings.  But if your PC is connected directly to the Internet (using a firewall of course.....!), the typical ADSL or cable modem connection requires that these settings be dynamic, with the values assigned by the ISP.  ISPs may change DNS servers without your knowledge, so if you have hard coded your DNS server (made it a static setting in your network properties), you may lose your browsing ability if the DNS server disappears from that address, bogs down, or fails. 

There are some cautions that must be exercised when using the "ping" command.  You may think that you can just ping anybody and everybody.  Well, this was true at one time, but many sites routinely block the ICMP protocol underneath the ping command nowadays.  This is because there are exploits which can be run using ICMP commands.  So if you ping www.microsoft.com and you don't get a reply, it is not because it is not there, it is just because they do not respond to your ping.  Hey, if you can still browse to them, using http protocol, they are there, OK? 

There is another nice little command to help you find out what is going on out "there" in the Internet.  Using the "tracert" command [traceroute on Linux/Unix -where you must be root] on windows is sometimes very revealing.  It actually traces the likely route the packets are taking from your PC to the destination, and reports on each router hop.  Try a "tracert -d www.microsoft.com" in a command window and look at the results.  The "-d" tells your PC not to resolve the IP addresses into names, which can result in faster execution, and less hangups.  If you want the PC to resolve the IP addresses, just do "tracert www.microsoft.com"  Don't always expect a result from the end node, and you may routinely experience intervening nodes that ignore your attempts to send them these ICMP packets.  They will sometimes block the underlying ICMP protocol that is used by the tracert command in Windows.  So the use of tracert can be iffy.  You need to use it with caution - you cannot call up your ISP and tell them that the tracert to some site is looking pretty fishy.  First of all they only have direct control over their own hops.  If the tracert packets make it all the the target, then there may or may not be problems in intervening nodes.  Look for especially nodes that take long times compared to other nodes.  Look for results that differ widely from day to day. 

Ping Plotter is a great little utility which you can download - shareware for the better tool, but free 3o day use.  This tool does a great job accumulating statistics over long periods of time.  You can see routes switches, and time of day sensitivities, etc.

Another command that can be very helpful in more complicated environments is the "netstat" command.  I have a whole section dedicated to this nifty little command.

On your local home network, you can use the "arp -a" command to list the physical addresses and their corresponding IP addresses which are known by the PC.  The physical "MAC" address is what the PC actually uses to communicate with the other PCs over the "ethernet."

Addendum:

1) How to bring up a "cmd prompt."  To do any serious debugging, many times you have to be staring at the infamous "command line interface (CLI)," or "DOS prompt ."  Now this is a scary proposition to people who grew up in the era of the GUI - Graphical User Interface.   Old timers still often prefer to deal with the CLI.  To do this in Windows XP or 2K, you punch the start button, left click the "run" and then type the command "cmd."  NOT the word "command."  This will bring up a window wherein you can type actual commands to the computer.  Pretty neat, huh?  The only problem is that you have to know what to type!!  This can be a problem for clueless people. 

For Windows 95/98/ME, you would issue the command "command."

2) How to test your newserver: [replace "newsgroups.bellsouth.net" with your own newsserver]

Open a Command Prompt and type this stuff in:
set local_echo=on
telnet newsgrpoups.bellsouth.net 119
You should get the server banner. If not, you can't get a socket and
there is no point in continuing. If you do get the banner, type the
following in:
authinfo user username
authinfo pass password

You'll either pass or fail authentication.

3) How to test your email access:

You can actually bypass your email client and speak POP3 directly to your ISP server if you like.  You can use the TOP command here if your client does not do it. THis shows you how:
http://kewl.phear.org/pop3/

 

TCP/IP STUFF

WIRELESS STUFF

PC STUFF

ADSL/CABLE MODEM STUFF

 

Copyright John D Loop Wednesday October 26, 2005