362 Chapter 6 IP Routing
1242AP(config)#ip default-gateway 10.1.1.1
1242AP(config)#ip dhcp pool CORPWLAN
1242AP(dhcp-config)#network 10.1.1.0 255.255.255.0
1242AP(dhcp-config)#default-router 10.1.1.1
1242AP(dhcp-config)#exit
1242AP(config)#ip dhcp excluded-address 10.1.1.1
1242AP(config)#ip dhcp excluded-address 10.1.1.2
1242AP(config)#no ip domain-lookup
1242AP(config)#^Z
1242AP#copy run start
Destination filename [startup-config]?[enter]
Building configuration...
[OK]
1242AP#
Even though the SSID configuration is the same as it is for the R2 routed radio interface,
notice there’s no IP address under the Dot11radio 0 interface. Why? Because it’s not a routed
port, so the IP address is instead placed under the Bridge Virtual Interface (BVI). I also set a
default gateway so this device can be managed from outside the LAN.
You need to know that just as with a switch, you don’t need to add an IP address to the AP
for it to function. I could just as easily have added the DHCP pool to the Corp router for the
wireless LAN, not added an IP address or pool to the AP at all, and it still would have worked
just the same.
Configuring IP Routing in Our Network
Our 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? Our configured routers
only have information 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 we’re 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
Configuring IP Routing in Our Network 363
I’m going to start off by describing and implementing static routing on our network because
if you can implement static routing and make it work, it means you have a solid understanding
of the internetwork. So 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.
Okay—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 a router interface that’s on a directly connected network.
You must be able to ping the router interface before you 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 chapter when we get to the section on dynamic routing.
364 Chapter 6 IP Routing
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. Choosing the
permanent option keeps the entry in the routing table no matter what happens.
Before we dive into configuring static routes, let’s take a look at a sample static route and
see what we 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 us simply that it is a static route.
172.16.3.0 is the remote network we 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, we 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 we 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, then we’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, we 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.
Corp
Each routing table automatically includes directly connected networks. To be able to route to all
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:
10.1.6.0
10.1.7.0
10.1.8.0
10.1.9.0
10.1.10.0
10.1.11.0
10.1.12.0
Configuring IP Routing in Our Network 365
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 we get to dynamic routing, you’ll see why I did it this way.)
Corp(config)#ip route 10.1.6.0 255.255.255.0 10.1.2.2 150
Corp(config)#ip route 10.1.6.0 255.255.255.0 10.1.3.2 151
Corp(config)#ip route 10.1.7.0 255.255.255.0 10.1.3.2 150
Corp(config)#ip route 10.1.7.0 255.255.255.0 10.1.2.2 151
Corp(config)#ip route 10.1.8.0 255.255.255.0 10.1.4.2 150
Corp(config)#ip route 10.1.9.0 255.255.255.0 10.1.4.2 150
Corp(config)#ip route 10.1.10.0 255.255.255.0 10.1.5.2 150
Corp(config)#ip route 10.1.11.0 255.255.255.0 10.1.5.2 150
Corp(config)#ip route 10.1.12.0 255.255.255.0 10.1.5.2 150
Corp(config)#do show run | begin ip route
ip route 10.1.6.0 255.255.255.0 10.1.2.2 150
ip route 10.1.6.0 255.255.255.0 10.1.3.2 151
ip route 10.1.7.0 255.255.255.0 10.1.3.2 150
ip route 10.1.7.0 255.255.255.0 10.1.2.2 151
ip route 10.1.8.0 255.255.255.0 10.1.4.2 150
ip route 10.1.9.0 255.255.255.0 10.1.4.2 150
ip route 10.1.10.0 255.255.255.0 10.1.5.2 150
ip route 10.1.11.0 255.255.255.0 10.1.5.2 150
ip route 10.1.12.0 255.255.255.0 10.1.5.2 150
For networks 10.1.6.0 and 10.1.7.0, I put in both paths to each network, but I made one
link a higher (151) AD. This will be a backup route in case the other link fails. If I made them
both the same AD, we would end up with a routing loop. (Static routing can’t handle multiple
links to the same destination.) 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, 12 subnets
S 10.1.11.0 [150/0] via 10.1.5.2
S 10.1.10.0 [150/0] via 10.1.5.2
S 10.1.9.0 [150/0] via 10.1.4.2
S 10.1.8.0 [150/0] via 10.1.4.2
S 10.1.12.0 [150/0] via 10.1.5.2
C 10.1.3.0 is directly connected, Serial0/0/1
C 10.1.2.0 is directly connected, Serial0/0/0
C 10.1.1.0 is directly connected, FastEthernet0/1
366 Chapter 6 IP Routing
S 10.1.7.0 [150/0] via 10.1.3.2
S 10.1.6.0 [150/0] via 10.1.2.2
C 10.1.5.0 is directly connected, Serial0/2/0
C 10.1.4.0 is directly connected, Serial0/1/0
The Corp router is configured to route and know about all routes to all networks. I configured
two routes to each remote network on R1, but the routing table will only show the
route with the lower AD. The other link will show up in the routing table only if the link with
that lower value it’s currently using fails.
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 network is a static entry. The
[1/0] is the administrative distance and metric (something we’ll cover later) to the remote network.
Here, the next-hop interface is 0, indicating that it’s directly connected.
Okay—we’re 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, R3, and 871W routers
aren’t configured with all the same information, the packets will simply be discarded. We’ll
need to fix this by configuring static routes.
Don’t stress about the 150/151 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, 10.1.6.0, and 10.1.7.0,
so we’ve got to configure the following static routes on the R1 router:
10.1.1.0
10.1.4.0
10.1.5.0
10.1.8.0
10.1.9.0
10.1.10.0
10.1.11.0
10.1.12.0
Here’s the configuration for the R1 router. Remember, we’ll never create a static route to
any network we’re directly connected to, and we can use the next hop of either 10.1.2.1 or
Configuring IP Routing in Our Network 367
10.1.3.1 since we have two links between the Corp and R1 routers. I’ll change between next
hops so all data doesn’t go down one link. It really doesn’t matter which link I use since I can’t
load-balance with static routing. We’ll be able to load-balance when we use dynamic routing
like RIP, EIGRP, and OSPF, but for now, the links will just provide a backup route to each network.
Let’s check out the output:
R1(config)#ip route 10.1.1.0 255.255.255.0 10.1.2.1 150
R1(config)#ip route 10.1.1.0 255.255.255.0 10.1.3.1 151
R1(config)#ip route 10.1.4.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 151
R1(config)#ip route 10.1.5.0 255.255.255.0 10.1.2.1 150
R1(config)#ip route 10.1.5.0 255.255.255.0 10.1.3.1 151
R1(config)#ip route 10.1.8.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.8.0 255.255.255.0 10.1.2.1 151
R1(config)#ip route 10.1.9.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.9.0 255.255.255.0 10.1.2.1 151
R1(config)#ip route 10.1.10.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.10.0 255.255.255.0 10.1.2.1 151
R1(config)#ip route 10.1.11.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.11.0 255.255.255.0 10.1.2.1 151
R1(config)#ip route 10.1.12.0 255.255.255.0 10.1.3.1 150
R1(config)#ip route 10.1.12.0 255.255.255.0 10.1.2.1 151
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.1.0 255.255.255.0 10.1.3.1 151
ip route 10.1.4.0 255.255.255.0 10.1.2.1 150
ip route 10.1.4.0 255.255.255.0 10.1.3.1 151
ip route 10.1.5.0 255.255.255.0 10.1.2.1 150
ip route 10.1.5.0 255.255.255.0 10.1.3.1 151
ip route 10.1.8.0 255.255.255.0 10.1.3.1 150
ip route 10.1.8.0 255.255.255.0 10.1.2.1 151
ip route 10.1.9.0 255.255.255.0 10.1.3.1 150
ip route 10.1.9.0 255.255.255.0 10.1.2.1 151
ip route 10.1.10.0 255.255.255.0 10.1.3.1 150
ip route 10.1.10.0 255.255.255.0 10.1.2.1 151
ip route 10.1.11.0 255.255.255.0 10.1.3.1 150
ip route 10.1.11.0 255.255.255.0 10.1.2.1 151
ip route 10.1.12.0 255.255.255.0 10.1.3.1 150
ip route 10.1.12.0 255.255.255.0 10.1.2.1 151
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario