{"id":828,"date":"2012-07-25T23:41:49","date_gmt":"2012-07-25T23:41:49","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=828"},"modified":"2018-09-06T23:00:51","modified_gmt":"2018-09-06T23:00:51","slug":"making-sense-of-windows-routing-tables","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=828","title":{"rendered":"Making Sense of Windows Routing Tables"},"content":{"rendered":"<p>It\u2019s amazing the way that time can go by. People tend to think of  computers as being high tech, but the TCP\/IP protocol has been around in  one form or another for over three decades. As such, TCP\/IP has had  time to really mature and be made stable and reliable. When it comes to  computers, nothing is foolproof though. When routing packets across a  network, things do occasionally go wrong. In these situations, it is  helpful to be familiar with the Windows routing tables. Routing tables  dictate the flow of packets from the machine in question. In this  article, I will show you how to view the Windows routing tables and how  to make sense of the data that is contained within it.<\/p>\n<h2>Viewing the Routing Tables<\/h2>\n<p>The routing tables are an  important part of Windows\u2019 TCP\/IP protocol stack, but they aren\u2019t  something that the operating system normally displays to the casual  user. If you want to see the routing tables, you will have to open a  Command Prompt window and then enter the ROUTE PRINT command. Upon doing  so, you will see a screen similar to the one that\u2019s shown in Figure A.<\/p>\n<blockquote dir=\"ltr\"><p><img decoding=\"async\" src=\"http:\/\/www.windowsnetworking.com\/img\/upl\/image0021133964045000.jpg\" border=\"0\" alt=\"\" hspace=\"0\" align=\"bottom\" \/><br \/>\n<strong>Figure A:<\/strong> This is what the Windows routing tables look like<\/p><\/blockquote>\n<p>Before I delve into the routing tables, I recommend entering another command into the Command Prompt window. The command is:<\/p>\n<blockquote dir=\"ltr\"><p>IPCONFIG \/ALL<\/p><\/blockquote>\n<p>The reason why I am recommending that you use the IPCONFIG \/ALL  command is because it shows you how TCP\/IP is really setup on the  machine. Sure, you could look in the TCP\/IP section of the network  adapter\u2019s properties sheet, but the information is more reliable if you  get it from IPCONFIG. I have seen a couple of instances over the years  in which IPCONFIG reported completely different information than what  was entered into the machine\u2019s TCP\/IP configuration screen. This doesn\u2019t  happen often, but if the right type of error occurs you can experience  this type of mismatch. To put it bluntly, the information that\u2019s keyed  into the TCP\/IP properties sheet reflects how you would like Windows to  set up the TCP\/IP protocol for the choosen network. The information  presented by IPCONFIG shows how Windows has actually configured the  protocol.<\/p>\n<p>Even if you haven\u2019t had some bizarre Windows error, it\u2019s still useful  to get your configuration information through IPCONFIG. If a machine  has multiple network cards, it can be tough to remember which  configuration is bound to which card. IPCONFIG lists the various  configurations in an easy to read, per NIC basis, as shown in Figure B.<\/p>\n<blockquote dir=\"ltr\"><p><img decoding=\"async\" src=\"http:\/\/www.windowsnetworking.com\/img\/upl\/image0041133964045000.jpg\" border=\"0\" alt=\"\" hspace=\"0\" align=\"bottom\" \/><br \/>\n<strong>Figure B:<\/strong> The IPCONFIG \/ALL displays the machine\u2019s TCP\/IP configuration on a per NIC basis<\/p><\/blockquote>\n<h2>Examining the Routing Tables<\/h2>\n<p>Right about now you might be  wondering why I had you to do an IPCONFIG \/ALL, when this article is  supposed to be discussing routing tables. The reason for this is that  normally you never even look at the routing tables unless you are having  problems with your machine. If you are having problems, then the best  place to start the troubleshooting process is to compare the information  provided by IPCONFIG to the information stored in the routing tables.<\/p>\n<p>As you saw in Figure B, the IPCONFIG \/ALL screen displayed some basic  TCP\/IP information such as the IP address, the default gateway, etc.  The routing tables aren\u2019t quite as intuitive though. Therefore, I want  to take some time to discuss how to read the routing tables and what the  information in the tables mean.<\/p>\n<p>In order to understand what the information in these columns mean,  you need to understand a little bit about how a router works. A router\u2019s  job is to facilitate moving traffic from one network to another. As  such, a router will contain multiple network interface cards, each  connected to a different network segment.<\/p>\n<p>When a user sends a packet that\u2019s destined for a different network  segment than the one that the PC is presently attached to, the packet is  sent to the router. It is up to the router to figure out which network  segment the packet should be forwarded to. It doesn\u2019t matter if the  router is connected to two network segments or a dozen. The decision  making process is the same, and it\u2019s all based on routing tables.<\/p>\n<p>If you look at the Route Print screen, you will notice that the  routing tables are divided into five different columns. The first column  is the network destination column. This column lists all of the network  segments that the router is attached to. The Netmask column provides  the subnet mask not of the network interface that\u2019s attached to the  segment, but of the segment itself. This basically allows the router to  determine the address class for the destination network.<\/p>\n<p>The third column is the gateway column. Once the router has  determined which destination network it needs to send the packet to, it  looks at the gateway listing. The gateway listing tells the router which  IP address the packet should be forwarded through in order to reach the  destination network.<\/p>\n<p>The Interface column tells the router which NIC is connected to the  appropriate destination network. Technically, the interface column only  tells the router the IP address that has been assigned to the NIC that  connects the router to the destination network. However, the router is  smart enough to know which physical interface the address has been bound  to.<\/p>\n<p>The final column in the routing table is the Metric column. Metrics  are a science in themselves, but I will try to give you a brief  explanation of what they do. The best way that I have ever heard metrics  explained is in terms of an airport. Imagine for a moment that I needed  to fly from Charlotte, NC (the closest major airport to my home in  South Carolina) to Miami, Florida. Being that the Charlotte airport is  pretty big, I have a lot of choices of how I could get to Miami Beach. I  could hop a North West Airlines flight. It would take me to Detroit  Michigan and then down to Miami (Detroit is a bit out of the way).  Likewise, I could hop a Continental Airlines flight that would take me  to Houston, TX, and then to Miami. Another option would be to just take a  US Airways flight nonstop to Miami. So which airline should I take?<\/p>\n<p>In real life, there are a lot of factors to consider such as the  price of the ticket and the departure times, but let\u2019s assume that  everything was equal. If there were no differences between the airlines  other than the route, then I would fly the airline that makes the fewest  stops. It would get me to my destination more quickly, and since there  are fewer stops, there would be less chance of having a problem with my  connection, lost luggage, and things like that.<\/p>\n<p>Routing works the same way. Many times, there is more than one way  that a router could send a packet. In such a case, it makes sense to  send the packet along the shortest (or most reliable) path. This is  where the metrics come into play. Windows does not even look at metrics  unless there are multiple paths to a destination. If there are multiple  paths though, Windows checks the metrics to determine the shortest  route. This is an over simplified explanation, but it gets the point  across.<\/p>\n<h2>Additional Routing Options<\/h2>\n<p>Earlier, I showed you the Route  Print command, but there are actually a lot of other things that you can  do with the ROUTE command. The ROUTE command\u2019s syntax is as follows:<\/p>\n<blockquote dir=\"ltr\"><p>ROUTE [-f] [-p] [command [destination] []<\/p><\/blockquote>\n<p dir=\"ltr\">The \u2013f switch is optional. This switch tells  Windows to clear the routing table of all gateway entries. If the \u2013f  switch is used in conjunction with other commands then all gateway  entries will be cleared prior to executing other instructions within the  command.<\/p>\n<p>The \u2013p switch makes a specified route persistent.  Normally, when a server is rebooted then any routes that you specify via  the ROUTE command are removed. The \u2013p switch tells Windows to keep the  route even if the system is rebooted.<\/p>\n<p>The command portion of the ROUTE command\u2019s syntax is  relatively simple. The command set consists of four options PRINT, ADD,  DELETE,\u00a0and CHANGE.\u00a0I\u2019ve already shown you the ROUTE PRINT command, but  even the ROUTE PRINT command has other options. For example, you can  use wild cards with this command. For instance, if you only wanted to  print routes pertaining to the 192.x.x.x subnet, you could use the  command ROUTE PRINT 192*.<\/p>\n<p>The ROUTE DELETE command works very similarly to the  ROUTE Print command. Simply enter the ROUTE DELETE command followed by  the destination or the gateway that you want to delete from the routing  table. For example, if you wanted to remove the 192.0.0.0 gateway, you  could enter the command ROUTE DELETE 192.0.0.0.<\/p>\n<p>The ROUTE CHANGE and the ROUTE ADD commands have the  same basic syntax as each other. When you enter this command, you must  usually specify the destination, subnet mask, and gateway. You might  also specify a metric and an interface, but that\u2019s optional. For  example, if you wanted to add a destination using the bare minimal  syntax, you could do so as follows:<\/p>\n<blockquote dir=\"ltr\"><p>ROUTE ADD 147.0.0.0 255.0.0.0 148.100.100.100<\/p><\/blockquote>\n<p>In this command, 147.0.0.0 is the new destination  that you are adding. 255.0.0.0 would be the subnet mask for the  destination, and 148.100.100.100 would be the gateway address. You can  extend the command with the METRIC and IF parameters. Doing so would  look something like this:<\/p>\n<blockquote dir=\"ltr\"><p>ROUTE ADD 147.0.0.0 255.0.0.0 148.100.100.100 METRIC 1 IF 1<\/p><\/blockquote>\n<p>The metric parameter is optional, but it specifies  the metric or number of hops for the route. The IF parameter tells  Windows which NIC to use. In this particular case, Windows would use the  NIC that\u2019s bound to Windows as interface 1. If you don\u2019t use the IF  parameter then Windows will automatically search for the best interface  to use.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article, I have explained how to use the ROUTE command to  display the Windows routing tables and make changes to those tables if  necessary. If you need a little extra help, you can get more syntax  examples by entering the ROUTE \/? Command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s amazing the way that time can go by. People tend to think of computers as being high tech, but the TCP\/IP protocol has been around in one form or another for over three decades. As such, TCP\/IP has had time to really mature and be made stable and reliable. When it comes to computers, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1,12],"tags":[],"class_list":["post-828","post","type-post","status-publish","format-standard","hentry","category-computer-tech-stuff","category-networking-stuff","category-winxp"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=828"}],"version-history":[{"count":2,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/828\/revisions"}],"predecessor-version":[{"id":2621,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/828\/revisions\/2621"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}