Routing Tables
Routing Tables At this point you may be wondering, “What is a routing table?” The first thing you need to understand is what a route is. The easiest way to explain a route is to think of using an online map. You are required to enter your current location, or source location, and your destination. After you enter this information, the online map will do its nice little calculation and print the best route to take you from your source location to the destination. A route in the world of internetworking is essentially the same, with each router keeping track of the next hop in the route between itself and the next downstream router toward the destination. Once a router has learned a route, it places it in a repository for future use, assuming it has not already learned a route that it considers to be better. This repository is known as a routing table . In order to view the IP routing table on your router, you need to use the command show ip route . Let’s take a look at an actual routing table: 2501A# sh ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B – BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E – EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR, P - periodic downloaded static route T - traffic engineered route Gateway of last resort is not set 172.16.0.0/16 is subnetted, 1 subnets C 172.16.50.0 is directly connected, FastEthernet0/0 C 192.168.24.0 is directly connected, FastEthernet0/0 10.0.0.0/8 is subnetted, 1 subnets C 10.10.10.0 is directly connected, Serial0/0 R 175.21.0.0/16 [120/1] via 10.10.10.1, 00:00:18, Serial0/0 2501A# Now you may be wondering what all of this means. So, let’s break it down. 6 Chapter 1 Routing Principles The Codes section at the very top tells you how the route was learned. As you may have noticed, there are many different ways a route can be learned. It’s not important for you to memorize all of the possible codes. What is important is for you to know how to use the Codes section to find out how a route was learned. Next, note the line Gateway of last resort is not set . The gateway of last resort, also known as a default route, is where your router will send IP packets if there isn’t a match in the routing table. In this example, the gateway of last resort has not been set. This means if the router receives a packet destined for an unknown network, it will drop the packet and send an ICMP destination network unreachable message to the originator of the packet. The next items in the routing table are the routes the router knows about. Let’s go ahead and break down a route into its components. We will use the following example: R 175.21.0.0/16 [120/1] via 10.10.10.1, 00:00:18, Serial0 R The means by which the route entry was learned on this router. In this case, the R stands for RIP. From this, you can deduce that the entry you are looking at was learned by the RIP routing protocol. 175.21.0.0/16 The network address and prefix length (number of bits set to 1 in the subnet mask) of the destination network. [120 The administrative distance of the route. (We will explain administrative distance a little later in this chapter.) /1] The metric of the route specific to the routing protocol used to determine the route. RIP uses hops as its metric. A hop is how many routers away—excluding this router—the destination network is. In this example, there is one router between this router and the destination. via 10.10.10.1 The next-hop address for the route. This is the address that the packet will need to be sent to in order for the packet to reach its destination. 00:00:18 The length of time since the route has been updated in the routing table. In this example, the route was updated 18 seconds ago. Serial0 The interface the route was learned through. This is also the interface the packet will be switched to in order for the packet to be forwarded toward its destination. If you see another IP address here, at least one additional lookup will have to occur within the same routing table, which is defined as a recursiv
251 times read
|