Configuring IP Routing in the Network

The network is good to go—right? After all, it's been correctly configured with IP addressing, administrative functions, and even clocking (automatically on the ISR routers). But how does a router send packets to remote networks when the only way it can send them is by looking at the routing table to find out how to get to the remote networks? The configured routers have information only about directly connected networks in each routing table. And what happens when a router receives a packet for a network that isn't listed in the routing table? It doesn't send a broadcast looking for the remote network—the router just discards it. Period.

So, I'm not exactly ready to rock after all. But no worries—there are several ways to configure the routing tables to include all the networks in our little internetwork so that packets will be forwarded. And what's best for one network isn't necessarily what's best for another. Understanding the different types of routing will really help you come up with the best solution for your specific environment and business requirements.

You'll learn about the following types of routing in the following sections:

  • Static routing
  • Default routing
  • Dynamic routing

I'll start off by describing and implementing static routing on the network because if you can implement static routing and make it work, it means you have a solid understanding of the internetwork. Let's get started.

Static Routing

Static routing occurs when you manually add routes in each router's routing table. There are pros and cons to static routing, but that's true for all routing processes.

Static routing has the following benefits:

  • There is no overhead on the router CPU, which means you could possibly buy a cheaper router than you would use if you were using dynamic routing.
  • There is no bandwidth usage between routers, which means you could possibly save money on WAN links.
  • It adds security because the administrator can choose to allow routing access to certain networks only.

Static routing has the following disadvantages:

  • The administrator must really understand the internetwork and how each router is connected in order to configure routes correctly.
  • If a network is added to the internetwork, the administrator has to add a route to it on all routers—by hand.
  • It's not feasible in large networks because maintaining it would be a full-time job in itself.

That said, here's the command syntax you use to add a static route to a routing table:

ip route [destination_network] [mask] [next-hop_address or
  exitinterface] [administrative_distance] [permanent]

This list describes each command in the string:

ip route The command used to create the static route.

destination_network The network you're placing in the routing table.

mask The subnet mask being used on the network.

next-hop_address The address of the next-hop router that will receive the packet and forward it to the remote network. This is the IP address of a router interface that's on a directly connected network. You must be able to ping the router interface before you can successfully add the route. If you type in the wrong next-hop address or the interface to that router is down, the static route will show up in the router's configuration but not in the routing table.

exitinterface Used in place of the next-hop address if you want and shows up as a directly connected route.

administrative_distance By default, static routes have an administrative distance of 1 (or even 0 if you use an exit interface instead of a next-hop address). You can change the default value by adding an administrative weight at the end of the command. I'll talk a lot more about this subject later in the “Dynamic Routing” section.

permanent If the interface is shut down or the router can't communicate to the next-hop router, the route will automatically be discarded from the routing table by default. Choosing the permanent option keeps the entry in the routing table no matter what happens.

Before diving into configuring static routes, take a look at a sample static route and see what you can find out about it.

Router(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4
  • The ip route command tells you simply that it is a static route.
  • 172.16.3.0 is the remote network you want to send packets to.
  • 255.255.255.0 is the mask of the remote network.
  • 192.168.2.4 is the next hop, or router, you will send packets to.

However, suppose the static route looked like this:

Router(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4 150

The 150 at the end changes the default administrative distance (AD) of 1 to 150. No worries—I'll talk much more about AD when I get into dynamic routing. For now, just remember that the AD is the trustworthiness of a route, where 0 is best and 255 is worst.

One more example, and then I'll start configuring.

Router(config)#ip route 172.16.3.0 255.255.255.0 s0/0/0

Instead of using a next-hop address, you can use an exit interface that will make the route show up as a directly connected network. Functionally, the next hop and exit interface work exactly the same.

To help you understand how static routes work, I'll demonstrate the configuration on the internetwork shown previously in Figure 6.9. I have shown this internetwork again here, in Figure 6.10, to save you from having to go back many pages to view the same figure when needed.

FIGURE 6.10 The example internetwork

images

Corp

Each routing table automatically includes directly connected networks. To be able to route to all indirectly connected networks within the internetwork, the routing table must include information that describes where these other networks are located and how to get to them.

The Corp router is connected to five networks. For the Corp router to be able to route to all networks, the following networks have to be configured into its routing table:

  • 192.168.10.0
  • 192.168.20.0
  • 192.168.30.0
  • 192.168.40.0
  • 172.16.10.0

The following router output shows the static routes on the Corp router and the routing table after the configuration. For the Corp router to find the remote networks, I had to place an entry into the routing table describing the remote network, the remote mask, and where to send the packets. I am going to add a 150 at the end of each line to raise the administrative distance. (When I get to dynamic routing, you'll see why I did it this way.)

Corp(config)#ip route 192.168.10.0 255.255.255.0 10.1.2.2 150
Corp(config)#ip route 192.168.20.0 255.255.255.0 10.1.3.2 150
Corp(config)#ip route 192.168.30.0 255.255.255.0 10.1.4.2 150
Corp(config)#ip route 192.168.40.0 255.255.255.0 10.1.4.2 150
Corp(config)#ip route 172.16.10.0 255.255.255.0 10.1.5.2 150
Corp(config)#do show run | begin ip route
ip route 192.168.10.0 255.255.255.0 10.1.2.2 150
ip route 192.168.20.0 255.255.255.0 10.1.3.2 150
ip route 192.168.30.0 255.255.255.0 10.1.4.2 150
ip route 192.168.40.0 255.255.255.0 10.1.4.2 150
ip route 172.16.10.0 255.255.255.0 10.1.5.2 150

For networks 192.168.10.0 and 192.168.20.0, I used a different path for each network, although I could have used just one. After the router is configured, you can type show ip route to see the static routes.

Corp(config)#do show ip route
10.0.0.0/24 is subnetted, 5 subnets
C       10.1.1.0 is directly connected, Vlan1
C       10.1.2.0 is directly connected, Serial0/0/0
C       10.1.3.0 is directly connected, Serial0/0/1
C       10.1.4.0 is directly connected, Serial0/1/0
C       10.1.5.0 is directly connected, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
S       172.16.10.0 [150/0] via 10.1.5.2
S    192.168.10.0/24 [150/0] via 10.1.2.2
S    192.168.20.0/24 [150/0] via 10.1.3.2
S    192.168.30.0/24 [150/0] via 10.1.4.2
S    192.168.40.0/24 [150/0] via 10.1.4.2

The Corp router is configured to route and know about all routes to all networks.

I want you to understand that if the routes don't appear in the routing table, it's because the router can't communicate with the next-hop address you've configured. You can use the permanent parameter to keep the route in the routing table even if the next-hop device can't be contacted.

The S in the preceding routing table entries means that the route is a static entry. The [150/0] is the administrative distance and metric (something I'll cover later) to the remote network. Here, the next-hop interface is 0, indicating that it's a directly connected static route.

Okay—I'm good. The Corp router now has all the information it needs to communicate with the other remote networks. But keep in mind that if the R1, R2, and R3 routers aren't configured with all the same information, the packets will simply be discarded. I'll need to fix this by configuring static routes.

images Don't stress about the 150 at the end of the static route configuration. I promise I will discuss the topic really soon in this chapter, not a later one! Be assured that you don't need to worry about it at this point.

R1

The R1 router is directly connected to the networks 10.1.2.0, 10.1.3.0, 192.168.10.0, and 192.168.20.0, so I have to configure the following static routes on the R1 router:

  • 10.1.1.0
  • 10.1.4.0
  • 10.1.5.0
  • 192.168.30.0
  • 192.168.40.0
  • 172.16.10.0

Here's the configuration for the R1 router. Remember, you'll never create a static route to any network you're directly connected to, and you can use the next hop of either 10.1.2.1 or 10.1.3.1 since you have two links between the Corp and R1 router. I'll change between next hops so all data doesn't go down one link. It really doesn't matter which link I use at this point. Let's check out the commands.

R1(config)#ip route 10.1.1.0 255.255.255.0 10.1.2.1 150
R1(config)#ip route 10.1.4.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.5.0 255.255.255.0 10.1.2.1 150
R1(config)#ip route 192.168.30.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 192.168.40.0 255.255.255.0 10.1.2.1 150
R1(config)#ip route 172.16.10.0 255.255.255.0 10.1.3.1 150
R1(config)#do show run | begin ip route
ip route 10.1.1.0 255.255.255.0 10.1.2.1 150
ip route 10.1.4.0 255.255.255.0 10.1.3.1 150
ip route 10.1.5.0 255.255.255.0 10.1.2.1 150
ip route 192.168.30.0 255.255.255.0 10.1.3.1 150
ip route 192.168.40.0 255.255.255.0 10.1.2.1 150
ip route 172.16.10.0 255.255.255.0 10.1.3.1 150

By looking at the routing table, you can see that the R1 router now understands how to find each network.

R1(config)#do show ip route
      10.0.0.0/24 is subnetted, 5 subnets
S       10.1.1.0 [150/0] via 10.1.2.1
C       10.1.2.0 is directly connected, Serial0/0/0
C       10.1.3.0 is directly connected, Serial0/0/1
S       10.1.4.0 [150/0] via 10.1.3.1
S       10.1.5.0 [150/0] via 10.1.2.1
     172.16.0.0/24 is subnetted, 1 subnets
S       172.16.10.0 [150/0] via 10.1.3.1
C    192.168.10.0/24 is directly connected, FastEthernet0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/1
S    192.168.30.0/24 [150/0] via 10.1.3.1
S    192.168.40.0/24 [150/0] via 10.1.2.1

The R1 router now has a complete routing table. As soon as the other routers in the internetwork have all the networks in their routing table, R1 will be able to communicate with all remote networks.

R2

The R2 router is directly connected to three networks 10.1.4.0, 192.168.30.0, and 192.168.40.0, so these are the routes that need to be added:

  • 10.1.1.0
  • 10.1.2.0
  • 10.1.3.0
  • 10.1.5.0
  • 192.168.10.0
  • 192.168.20.0
  • 172.16.10.0

Here's the configuration for the R2 router:

R2(config)#ip route 10.1.1.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 10.1.2.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 10.1.3.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 10.1.5.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 192.168.10.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 192.168.20.0 255.255.255.0 10.1.4.1 150
R2(config)#ip route 172.16.10.0 255.255.255.0 10.1.4.1 150
R2(config)#do show run | begin ip route
ip route 10.1.1.0 255.255.255.0 10.1.4.1 150
ip route 10.1.2.0 255.255.255.0 10.1.4.1 150
ip route 10.1.3.0 255.255.255.0 10.1.4.1 150
ip route 10.1.5.0 255.255.255.0 10.1.4.1 150
ip route 192.168.10.0 255.255.255.0 10.1.4.1 150
ip route 192.168.20.0 255.255.255.0 10.1.4.1 150
ip route 172.16.10.0 255.255.255.0 10.1.4.1 150

The following output shows the routing table on the R2 router:

R2(config)#do show ip route
      10.0.0.0/24 is subnetted, 5 subnets
S       10.1.1.0 [150/0] via 10.1.4.1
S       10.1.2.0 [150/0] via 10.1.4.1
S       10.1.3.0 [150/0] via 10.1.4.1
C       10.1.4.0 is directly connected, Serial0/0/0
S       10.1.5.0 [150/0] via 10.1.4.1
     172.16.0.0/24 is subnetted, 1 subnets
S       172.16.10.0 [150/0] via 10.1.4.1
S    192.168.10.0/24 [150/0] via 10.1.4.1
S    192.168.20.0/24 [150/0] via 10.1.4.1
C    192.168.30.0/24 is directly connected, FastEthernet0/0
C    192.168.40.0/24 is directly connected, FastEthernet0/1

R2 now shows all 10 networks in the internetwork, so it too can now communicate with all routers and networks (that are configured so far).

R3

The R3 router is directly connected to networks 10.1.5.0 and 172.16.10.0, but I need to add all these routes, eight in total:

  • 10.1.1.0
  • 10.1.2.0
  • 10.1.3.0
  • 10.1.4.0
  • 192.168.10.0
  • 192.168.20.0
  • 192.168.30.0
  • 192.168.40.0

Here's the configuration for the R3 router; however, I am going to use the exit interface instead of the next hop address for this router:

R3#show run | begin ip route
R3(config)#ip route 10.1.1.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 10.1.2.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 10.1.3.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 10.1.4.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 192.168.10.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 192.168.20.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 192.168.30.0 255.255.255.0 fastethernet 0/0 150
R3(config)#ip route 192.168.40.0 255.255.255.0 fastethernet 0/0 150
R3#show ip route
       10.0.0.0/24 is subnetted, 5 subnets
S       10.1.1.0 is directly connected, FastEthernet0/0
S       10.1.2.0 is directly connected, FastEthernet0/0
S       10.1.3.0 is directly connected, FastEthernet0/0
S       10.1.4.0 is directly connected, FastEthernet0/0
C       10.1.5.0 is directly connected, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, Dot11Radio0/0/0
S    192.168.10.0/24 is directly connected, FastEthernet0/0
S    192.168.20.0/24 is directly connected, FastEthernet0/0
S    192.168.30.0/24 is directly connected, FastEthernet0/0
S    192.168.40.0/24 is directly connected, FastEthernet0/0
R3#

Looking at the show ip route command output, you can see that the static routes are listed as directly connected. Strange? Not really, because I used the exit interface instead of the next-hop address, and functionally, there's no difference between them, only how they display in the routing table. However, now that I showed you what using an exit interface displays in the routing table instead of using a next hop with static routing, let me show you an easier way for the R3 router.

Default Routing

Although I don't fully explain default routing for another couple pages, I feel it would be advantageous to configure default routing at this time to help you understand when you'd typically consider configuring it. The R2 and R3 routers, which I have connected to the Corp router, are considered stub routers. A stub indicates that the networks in this design have only one way out to reach all other networks. I'll show you the configuration, verify the network in the next section, and then discuss default routing in detail. Here's the configuration I could have done on the R3 router instead of typing in eight static routes because of its stub status:

R3(config)#no ip route 10.1.1.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 10.1.2.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 10.1.3.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 10.1.4.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 192.168.10.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 192.168.20.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 192.168.30.0 255.255.255.0 FastEthernet0/0 150
R3(config)#no ip route 192.168.40.0 255.255.255.0 FastEthernet0/0 150
R3(config)#ip route 0.0.0.0 0.0.0.0 10.1.5.1
R3(config)#ip classless
R3(config)#do show ip route
       10.0.0.0/24 is subnetted, 1 subnets
C       10.1.5.0 is directly connected, Vlan1
172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, Dot11Radio0
S*   0.0.0.0/0 [1/0] via 10.1.5.1

Okay—once I removed all the initial static routes I configured, this seems a lot easier than typing eight static routes, doesn't it? And it is, but there's a catch—you can't do things like this on all routers, only on stub routers. I could've used default routing on the R2 as well since that router is considered a stub, and I didn't add the 150 to this default route even though I easily could have. I didn't do that because it's really simple to just remove the route if you need to when I get to dynamic routing later.

So, I've done it! All the routers have the correct routing table, so all routers and hosts should be able to communicate without a hitch—for now. But if you add even one more network or another router to the internetwork, you'll have to update each and every router's routing tables by hand—yikes! This isn't a problem at all if you have a small network, but it's obviously extremely time-consuming if you're dealing with a large internetwork!

Verifying Your Configuration

I'm not done yet—once all the routers' routing tables are configured, they need to be verified. The best way to do this, besides using the show ip route command, is with the Ping program. I'll start by pinging from the R3 router to the R1 router.

Here's the output:

R3#ping 10.1.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

From router R3, a ping to the WWW, Email, and DNS servers on the Corp backbone would be a good test as well. Here's the router output:

R3#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms

R3#ping 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/10 ms

R3# ping 10.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/7/10 ms

R3#ping 10.1.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/5/10 ms

Also, I can trace from the Mobile User wireless host to the Finance host connected to the R2 router to see the hops the packet takes to get to the Finance host, but first I have to make sure the Mobile User host received a DHCP server address from the R3 router.

PC>ipconfig

IP Address......................: 172.16.10.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 172.16.10.1

PC>ping 192.168.10.2
Pinging 192.168.10.2 with 32 bytes of data:
Reply from 192.168.10.2: bytes=32 time=17ms TTL=125
Reply from 192.168.10.2: bytes=32 time=21ms TTL=125
Reply from 192.168.10.2: bytes=32 time=19ms TTL=125
Reply from 192.168.10.2: bytes=32 time=17ms TTL=125

Ping statistics for 192.168.10.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 17ms, Maximum = 21ms, Average = 18ms

PC>tracert 192.168.10.2
Tracing route to 192.168.10.2 over a maximum of 30 hops:

  1   15 ms     11 ms     14 ms    172.16.10.1
  2   13 ms     13 ms     8 ms     10.1.5.1
  3   12 ms     14 ms     15 ms    10.1.2.2
  4   16 ms     14 ms     15 ms    192.168.10.2
Trace complete.

Notice I used a tracert command because I am on a Windows host. Remember, tracert is not a valid Cisco command; you must use the command traceroute from a router prompt.

Okay, since I can communicate from end to end and to each host without a problem, the static and default route configurations have been a success!

Default Routing

We use default routing to send packets with a remote destination network not in the routing table to the next-hop router. You should use default routing only on stub networks—those with only one exit path out of the network, although there are exceptions to this statement, and default routing is configured on a case-by-case basis when a network is designed. This is a rule of thumb to keep in mind.

If you tried to put a default route on a router that isn't a stub, it is possible that packets wouldn't be forwarded to the correct networks because they have more than one interface routing to other routers. You can easily create loops with default routing, so be careful!

To configure a default route, you use wildcards in both the network address and mask of a static route (as I demonstrated in the R3 configuration). In fact, you can just think of a default route as a static route that uses wildcards instead of network and mask information.

By using a default route, you can just create one static route entry instead. This sure is easier than typing in all those routes!

R3(config)#ip route 0.0.0.0 0.0.0.0 10.1.5.1
R3(config)#ip classless
R3(config)#do show ip route
Gateway of last resort is 10.1.5.1 to network 0.0.0.0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.5.0 is directly connected, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, Dot11Radio0/0/0
S*   0.0.0.0/0 [1/0] via 10.1.5.1

If you look at the routing table, you'll see only the two directly connected networks plus an S*, which indicates that this entry is a candidate for a default route. So, instead of configuring eight static routes on R3, I could also have completed the default route command another way.

R3(config)#ip route 0.0.0.0 0.0.0.0 Fa0/0

What this is telling you is that if you don't have an entry for a packet with a destination IP in the routing table, just forward it out Fa0/0. You can choose the IP address of the next-hop router or the exit interface—either way, it will work the same. Remember, I used the exit interface configuration with the R3 static route configs, which showed as directly connected in the router table. However, when I configured the default route on R3, I used the next-hop functionally; there is no difference.

Notice also on the first line in the routing table that the gateway of last resort is now set. Even so, there's one more command you must be aware of when using default routes: the ip classless command.

All Cisco routers are classful routers, meaning they expect a default subnet mask on each interface of the router. When a router receives a packet for a destination subnet that's not in the routing table, it will drop the packet by default. If you're using default routing, you must use the ip classless command because it is possible that no remote subnets will be in the routing table. Why? Because a configured default route will be ignored for subnets that are members of the same classful network as the other routes in the router's routing table, and this command basically says, “Hey, IP! Before you discard that packet, check to see whether a gateway of last resort is set!”

Since I have version 12.4 of the IOS on my routers, the ip classless command is on by default, and it doesn't even show in the configuration. If you're using default routing and this command isn't in your configuration, you will need to add it if you have subnetted networks on your routers. The command is shown here:

R3(config)#ip classless

There's another command you can use to help you in your internetwork if you have configured a gateway of last resort—the ip default-network command. I'll use this in a configuration example at the end of the chapter. Figure 6.11 shows a network that needs to have a gateway of last resort statement configured.

FIGURE 6.11 Configuring a gateway of last resort

images

Here are three commands (all providing a default route solution) for adding a gateway of last resort on the router to the ISP:

Gateway(config)#ip route 0.0.0.0 0.0.0.0 217.124.6.1

Gateway(config)#ip route 0.0.0.0 0.0.0.0 s0/0

Gateway(config)#ip default-network 217.124.6.0

The first two are the same command; one just uses the next hop and the other the exit interface. You will find no difference in this configuration, as I've already discussed. However, if you set them both for some reason, the exit interface would be used. Do you know why? Directly connected routes have an administrative distance of 0, but in this example, you'd see absolutely no functional difference between the two commands.

The ip default-network command would advertise the default route you configured on your border router when you configure an IGP (like RIPv2) on the router. This is so other routers in your internetwork will receive this route as a default route automatically. Again, I'll configure this in the network at the end of the chapter, so now you have something pretty exciting to look forward to!

But what happens if you misconfigured a default route? Let's take a look at the output of a show ip route command and compare that to the network in Figure 6.12 to see whether you can find a problem.

Router#sh ip route
[output cut]
Gateway of last resort is 172.19.22.2 to network 0.0.0.0

C      172.17.22.0 is directly connected, FastEthernet0/0
C      172.18.22.0 is directly connected, Serial0/0
S*     0.0.0.0/0 [1/0] via 172.19.22.2

FIGURE 6.12 Misconfigured default route

images

Find anything? You can see by looking at the figure and the directly connected routes in the routing table that the WAN link is on network 172.18.22.0 and that the default route is forwarding all packets to the 172.19.22.2 next-hop address. This is just bad—it will never work, so the problem is a misconfigured static (default) route. The default route should have been set to 172.18.22.2 or the exit interface.

One last thing before moving on to dynamic routing. If you have the routing table output as shown in the following lines, what happens if the router receives a packet from 10.1.6.100 destined for host 10.1.8.5?

Router#sh ip route
[output cut]
Gateway of last resort is 10.1.5.5 to network 0.0.0.0
R      10.1.3.0 [120/1] via 101.2.2, 00:00:00, Serial 0/0
C      10.1.2.0  is directly connected, Serial0/0
C      10.1.5.0  is directly connected, Serial0/1
C      10.1.6.0  is directly connected, Fastethernet0/0
R*     0.0.0.0/0 [120/0] via 10.1.5.5, 00:00:00 Serial 0/1

This is a tad different from what I've shown you up until now because the default route is listed as R*, which means it's a RIP-injected route. This is because someone configured the ip default-network command on a remote router as well as configuring RIP, causing RIP to advertise this route through the internetwork as a default route. Since the destination address is 10.1.8.5 and there is no route to network 10.1.8.0, the router would use the default route and send the packet out serial 0/1.

Dynamic Routing

Dynamic routing is when protocols are used to find networks and update routing tables on routers. True, this is easier than using static or default routing, but it'll cost you in terms of router CPU processing and bandwidth on the network links. A routing protocol defines the set of rules used by a router when it communicates routing information between neighboring routers.

The routing protocol I'm going to talk about in this chapter is Routing Information Protocol (RIP) versions 1 and 2.

Two types of routing protocols are used in internetworks: interior gateway protocols (IGPs) and exterior gateway protocols (EGPs). IGPs are used to exchange routing information with routers in the same autonomous system (AS). An AS is a collection of networks under a common administrative domain, which basically means that all routers sharing the same routing table information are in the same AS. EGPs are used to communicate between ASs. An example of an EGP is Border Gateway Protocol (BGP), which is beyond the scope of this book.

Since routing protocols are so essential to dynamic routing, I'll give you the basic information you need to know about them next. Later in this chapter, I'll focus on configuration.

Routing Protocol Basics

There are some important things you should know about routing protocols before getting deeper into RIP. Specifically, you need to understand administrative distances, the three different kinds of routing protocols, and routing loops. I will cover each of these in more detail in the following sections.

Administrative Distances

The administrative distance (AD) is used to rate the trustworthiness of routing information received on a router from a neighbor router. An administrative distance is an integer from 0 to 255, where 0 is the most trusted and 255 means no traffic will be passed via this route.

If a router receives two updates listing the same remote network, the first thing the router checks is the AD. If one of the advertised routes has a lower AD than the other, then the route with the lowest AD will be placed in the routing table.

If both advertised routes to the same network have the same AD, then routing protocol metrics (such as hop count or bandwidth of the lines) will be used to find the best path to the remote network. The advertised route with the lowest metric will be placed in the routing table. But if both advertised routes have the same AD as well as the same metrics, then the routing protocol will load balance to the remote network (which means that it sends packets down each link).

Table 6.2 shows the default administrative distances that a Cisco router uses to decide which route to take to a remote network.

TABLE 6.2 Default administrative distances

Route Source Default AD
Connected interface 0
Static route 1
EIGRP 90
IGRP 100
OSPF 110
RIP 120
External EIGRP 170
Unknown 255 (This route will never be used.)

If a network is directly connected, the router will always use the interface connected to the network. If you configure a static route, the router will then believe that route over any other learned routes. You can change the administrative distance of static routes, but by default, they have an AD of 1. In the previous static route configuration, the AD of each route is set at 150. This lets you configure routing protocols without having to remove the static routes. They'll be used as backup routes in case the routing protocol experiences a failure of some type.

For example, if you have a static route, a RIP advertised route, and an EIGRP-advertised route listing the same network, then by default, the router will always use the static route unless you change the AD of the static route—which I did.

Routing Protocols

There are three classes of routing protocols.

Distance Vector The distance-vector protocols in use today find the best path to a remote network by judging distance. For example, in the case of RIP routing, each time a packet goes through a router, that's called a hop. The route with the least number of hops to the network is determined to be the best route. The vector indicates the direction to the remote network. RIPv2 is a distance-vector routing protocol. RIPv2 periodically sends the entire routing table to directly connected neighbors.

Link state In link-state protocols, also called shortest-path-first protocols, the routers each create three separate tables. One of these tables keeps track of directly attached neighbors, one determines the topology of the entire internetwork, and one is used as the routing table. Link-state routers know more about the internetwork than routers running a distance-vector routing protocol. OSPF is an IP routing protocol that is completely link state. Link-state protocols send updates containing the state of their own links to all other directly connected routers on the network, which is then propagated to their neighbors.

Hybrid Hybrid protocols use aspects of both distance vector and link state—for example, EIGRP. However, Cisco mostly calls EIGRP an Advanced Distance Vector routing protocol.

There's no set way of defining routing protocols for use with every business. This is something you really have to do on a case-by-case basis. If you understand how the different routing protocols work, you can make good, solid decisions that truly meet the individual needs of any business.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.138.65