sh ip int brief
Interface IP-Address OK? Method Status
Protocol
FastEthernet0/0 192.168.10.1 YES manual up
up
FastEthernet0/1 unassigned YES unset administratively down
down
Serial0/0/0 172.16.10.2 YES manual up
up
Serial0/0/1 unassigned YES unset administratively down
down
SF#config
SF(config)#
router rip
SF(config-router)#
network 192.168.10.0
SF(config-router)#
network 172.16.0.0
SF(config-router)#
version 2
SF(config-router)#
no auto-summary
SF(config-router)#
do show ip route
C 192.168.10.0/24 is directly connected, FastEthernet0/0
L 192.168.10.1/32 is directly connected, FastEthernet0/0
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.10.4 [120/1] via 172.16.10.1, 00:00:08, Serial0/0/0
C 172.16.10.0 is directly connected, Serial0/0/0
L 172.16.10.2/32 is directly connected, Serial0/0
S 192.168.20.0/24 [150/0] via 172.16.10.1
10.0.0.0/24 is subnetted, 1 subnets
R 10.10.10.0 [120/1] via 172.16.10.1, 00:00:08, Serial0/0/0
That was pretty straightforward. Let’s talk about this routing table. Since
we have one RIP buddy out there with whom we are exchanging routing
tables, we can see the RIP networks coming from the Corp router. All the
other routes still show up as static and local. RIP also found both
connections through the Corp router to networks 10.10.10.0 and
172.16.10.4. But we’re not done yet!
LA
Let’s configure our LA router with RIP, only I’m going to remove the
default route first, even though I don’t have to. You’ll see why soon:
LA#
config t
LA(config)#
no ip route 0.0.0.0 0.0.0.0
LA(config)#
router rip
LA(config-router)#
network 192.168.20.0
LA(config-router)#
network 172.16.0.0
LA(config-router)#
no auto
LA(config-router)#
vers 2
LA(config-router)#
do show ip route
R 192.168.10.0/24 [120/2] via 172.16.10.5, 00:00:10, Serial0/0/1
172.16.0.0/30 is subnetted, 3 subnets
C 172.16.10.4 is directly connected, Serial0/0/1
L 172.16.10.6/32 is directly connected, Serial0/0/1
R 172.16.10.0 [120/1] via 172.16.10.5, 00:00:10, Serial0/0/1
C 192.168.20.0/24 is directly connected, FastEthernet0/0
L 192.168.20.1/32 is directly connected, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
R 10.10.10.0 [120/1] via 172.16.10.5, 00:00:10, Serial0/0/1
The routing table is sprouting new
R
’s as we add RIP buddies! We can still
see that all routes are in the routing table.
This output shows us basically the same routing table and the same
entries that it had when we were using static routes—except for those
R
’s.
An
R
indicates that the networks were added dynamically using the RIP
routing protocol. The
[120/1]
is the administrative distance of the route
(120) along with the metric, which for RIP is the number of hops to that
remote network (1). From the Corp router, all networks are one hop away.
So, while yes, it’s true that RIP has worked in our little internetwork, it’s
just not a great solution for most enterprises. Its maximum hop count of
only 15 is a highly limiting factor. And it performs full routing-table
updates every 30 seconds, which would bring a larger internetwork to a
painful crawl in no time!
There’s still one more thing I want to show you about RIP routing tables
and the parameters used to advertise remote networks. Using a different
router on a different network as an example for a second, look into the
following output. Can you spot where the following routing table shows
[120/15]
in the 10.1.3.0 network metric? This means that the
administrative distance is 120, the default for RIP, but the hop count is
15. Remember that each time a router sends out an update to a neighbor
router, the hop count goes up by one incrementally for each route! Here’s
that output now:
Router#
sh ip route
10.0.0.0/24 is subnetted, 12 subnets
C 10.1.11.0 is directly connected, FastEthernet0/1
L 10.1.11.1/32 is directly connected, FastEthernet0/1
C 10.1.10.0 is directly connected, FastEthernet0/0
L 10.1.10.1/32 is directly connected, FastEthernet/0/0
R 10.1.9.0 [120/2] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.8.0 [120/2] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.12.0 [120/1] via 10.1.11.2, 00:00:00, FastEthernet0/1
R 10.1.3.0 [120/15] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.2.0 [120/1] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.1.0 [120/1] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.7.0 [120/2] via 10.1.5.1, 00:00:15, Serial0/0/1
R 10.1.6.0 [120/2] via 10.1.5.1, 00:00:15, Serial0/0/1
C 10.1.5.0 is directly connected, Serial0/0/1
L 10.1.5.1/32 is directly connected, Serial0/0/1
R 10.1.4.0 [120/1] via 10.1.5.1, 00:00:15, Serial0/0/1
So this
[120/15]
is really bad. We’re basically doomed because the next
router that receives the table from this router will just discard the route to
network 10.1.3.0 since the hop count would rise to 16, which is invalid!
If a router receives a routing update that contains a higher-
cost path to a network that's already in its routing table, the update
will be ignored.
Holding Down RIP Propagations
You probably don’t want your RIP network advertised everywhere on
your LAN and WAN. There’s enough stress in networking already and not
a whole lot to be gained by advertising your RIP network to the Internet!
There are a few different ways to stop unwanted RIP updates from
propagating across your LANs and WANs, and the easiest one is through
the
passive-interface
command. This command prevents RIP update
broadcasts from being sent out of a specified interface but still allows that
same interface to receive RIP updates.
Here’s an example of how to configure a
passive-interface
on the Corp
router’s Fa0/1 interface, which we will pretend is connected to a LAN that
we don’t want RIP on (and the interface isn’t shown in the figure):
Corp#
config t
Corp(config)#
router rip
Corp(config-router)#
passive-interface FastEthernet 0/1
This command will stop RIP updates from being propagated out of
FastEthernet interface 0/1, but it can still receive RIP updates.
Should We Really Use RIP in an Internetwork?
You have been hired as a consultant to install a couple of Cisco
routers into a growing network. They have a couple of old Unix
routers that they want to keep in the network. These routers do not
support any routing protocol except RIP. I guess this means you just
have to run RIP on the entire network. If you were balding before,
your head now shines like chrome.
No need for hairs abandoning ship though—you can run RIP on a
router connecting that old network, but you certainly don't need to
run RIP throughout the whole internetwork!
You can do what is called redistribution, which is basically translating
from one type of routing protocol to another. This means that you can
support those old routers using RIP but use something much better
like Enhanced IGRP on the rest of your network.
This will prevent RIP routes from being sent all over the internetwork
gobbling up all that precious bandwidth!
Advertising a Default Route Using RIP
Now I’m going to guide you through how to advertise a way out of your
autonomous system to other routers, and you’ll see this is completed the
same way with OSPF. Imagine that our Corp router’s Fa0/0 interface is
connected to some type of Metro-Ethernet as a connection to the
Internet. This is a pretty common configuration today that uses a LAN
interface to connect to the ISP instead of a serial interface.
If we do add an Internet connection to Corp, all routers in our AS (SF and
LA) must know where to send packets destined for networks on the
Internet or they’ll just drop the packets when they get a remote request.
One solution to this little hitch would be to place a default route on every
router and funnel the information to Corp, which in turn would have a
default route to the ISP. Most people do this type of configuration in
small- to medium-size networks because it actually works pretty well!
But since I’m running RIPv2 on all routers, I’ll just add a default route on
the Corp router to our ISP, as I would normally. I’ll then add another
command to advertise my network to the other routers in the AS as the
default route to show them where to send packets destined for the
Internet.
Here’s my new Corp configuration:
Corp(config)#
ip route 0.0.0.0 0.0.0.0 fa0/0
Corp(config)#
router rip
Corp(config-router)#
default-information originate
Now, let’s take a look at the last entry found in the Corp routing table:
S* 0.0.0.0/0 is directly connected, FastEthernet0/0
Let’s see if the LA router can see this same entry:
LA#
sh ip route
Gateway of last resort is 172.16.10.5 to network 0.0.0.0
R 192.168.10.0/24 [120/2] via 172.16.10.5, 00:00:04, Serial0/0/1
172.16.0.0/30 is subnetted, 2 subnets
C 172.16.10.4 is directly connected, Serial0/0/1
L 172.16.10.5/32 is directly connected, Serial0/0/1
R 172.16.10.0 [120/1] via 172.16.10.5, 00:00:04, Serial0/0/1
C 192.168.20.0/24 is directly connected, FastEthernet0/0
L 192.168.20.1/32 is directly connected, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
R 10.10.10.0 [120/1] via 172.16.10.5, 00:00:04, Serial0/0/1
R 192.168.218.0/24 [120/3] via 172.16.10.5, 00:00:04,
Serial0/0/1
R 192.168.118.0/24 [120/2] via 172.16.10.5, 00:00:05,
Serial0/0/1
R* 0.0.0.0/0 [120/1] via 172.16.10.5, 00:00:05, Serial0/0/1
Can you see that last entry? It screams that it’s an RIP injected route, but
it’s also a default route, so our
default-information originate
command
is working! Last, notice that the gateway of last resort is now set as well.
If all of what you’ve learned is clear and understood, congratulations—
you’re ready to move on to the next chapter right after you go through the
written and hands-on labs, and while you’re at it, don’t forget the review
questions!
Summary
This chapter covered IP routing in detail. Again, it’s extremely important
to fully understand the basics we covered in this chapter because
everything that’s done on a Cisco router will typically have some kind of
IP routing configured and running.
You learned how IP routing uses frames to transport packets between
routers and to the destination host. From there, we configured static
routing on our routers and discussed the administrative distance used by
IP to determine the best route to a destination network. You found out
that if you have a stub network, you can configure default routing, which
sets the gateway of last resort on a router.
We then discussed dynamic routing, specifically RIPv2 and how it works
on an internetwork, which is not very well!
Exam Essentials
Describe the basic IP routing process. You need to remember that
the frame changes at each hop but that the packet is never changed or
manipulated in any way until it reaches the destination device (the TTL
field in the IP header is decremented for each hop, but that’s it!).
List the information required by a router to successfully route
packets. To be able to route packets, a router must know, at a minimum,
the destination address, the location of neighboring routers through
which it can reach remote networks, possible routes to all remote
networks, the best route to each remote network, and how to maintain
and verify routing information.
Describe how MAC addresses are used during the routing
process. A MAC (hardware) address will only be used on a local LAN. It
will never pass a router’s interface. A frame uses MAC (hardware)
addresses to send a packet on a LAN. The frame will take the packet to
either a host on the LAN or a router’s interface (if the packet is destined
for a remote network). As packets move from one router to another, the
MAC addresses used will change, but normally the original source and
destination IP addresses within the packet will not.
View and interpret the routing table of a router. Use the
show ip
route
command to view the routing table. Each route will be listed along
with the source of the routing information. A
C
to the left of the route will
indicate directly connected routes, and other letters next to the route can
also indicate a particular routing protocol that provided the information,
such as, for example,
R
for RIP.
Differentiate the three types of routing. The three types of routing
are static (in which routes are manually configured at the CLI), dynamic
(in which the routers share routing information via a routing protocol),
and default routing (in which a special route is configured for all traffic
without a more specific destination network found in the table).
Compare and contrast static and dynamic routing. Static routing
creates no routing update traffic and creates less overhead on the router
and network links, but it must be configured manually and does not have
the ability to react to link outages. Dynamic routing creates routing
update traffic and uses more overhead on the router and network links.
Configure static routes at the CLI. The command syntax to add a
route is
ip route [destination_network] [mask] [next-hop_address or
exitinterface] [administrative_distance] [permanent]
.
Create a default route. To add a default route, use the command
syntax
ip route 0.0.0.0 0.0.0.0
ip-address
or
exit interface type and
number
.
Understand administrative distance and its role in the
selection of the best route. Administrative distance (AD) is used to
rate the trustworthiness of routing information received on a router from
a neighbor router. 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. All routing protocols are assigned a default AD, but it can be
changed at the CLI.
Differentiate distance-vector, link-state, and hybrid routing
protocols. Distance-vector routing protocols make routing decisions
based on hop count (think RIP), while link-state routing protocols are
able to consider multiple factors such as bandwidth available and
building a topology table. Hybrid routing protocols exhibit characteristics
of both types.
Configure RIPv2 routing. To configure RIP routing, first you must be
in global configuration mode and then you type the command
router rip
.
Then you add all directly connected networks, making sure to use the
classful address and the
version 2
command and to disable auto-
summarization with the
no auto-summary
command.
Written Lab 9
In this section, you’ll complete the following lab to make sure you’ve got
the information and concepts contained within them fully dialed in:
Lab 9.1: IP Routing
You can find the answers to this lab in Appendix A, “Answers to
Written Labs.”
Write the answers to the following questions:
1. At the appropriate command prompt, create a static route to network
172.16.10.0/24 with a next-hop gateway of 172.16.20.1 and an
administrative distance of 150.
2. When a PC sends a packet to another PC in a remote network, what
destination addresses will be in the frame that it sends to its default
gateway?
3. At the appropriate command prompt, create a default route to
172.16.40.1.
4. On which type of network is a default route most beneficial?
5. At the appropriate command prompt, display the routing table on
your router.
6. When creating a static or default route, you don’t have to use the next-
hop IP address; you can use the______________.
7. True/False: To reach a remote host, you must know the MAC address
of the remote host.
8. True/False: To reach a remote host, you must know the IP address of
the remote host.
9. At the appropriate command prompt(s), prevent a router from
propagating RIP information out serial 1.
10. True/False: RIPv2 is considered classless.
Hands-on Labs
In the following hands-on labs, you will configure a network with three
routers. These exercises assume all the same setup requirements as the
labs found in earlier chapters. You can use real routers, the LammleSim
IOS version found at
www.lammle.com/ccna
, or the Cisco Packet Tracer
program to run these labs.
This chapter includes the following labs:
Lab 9.1: Creating Static Routes
Lab 9.2: Configuring RIP Routing
The internetwork shown in the following graphic will be used to configure
all routers.
Table 9.2
shows our IP addresses for each router (each interface uses a
/24 mask).
TABLE 9.2
Our IP addresses
Router Interface IP Address
Lab_A Fa0/0
172.16.10.1
Lab_A S0/0
172.16.20.1
Lab_B
S0/0
172.16.20.2
Lab_B
S0/1
172.16.30.1
Lab_C
S0/0
172.16.30.2
Lab_C
Fa0/0
172.16.40.1
These labs were written without using the LAN interface on the Lab_B
router. You can choose to add that LAN into the labs if necessary. Also, if
you have enough LAN interfaces, then you don’t need to add the serial
interfaces into this lab. Using all LAN interfaces is fine.
Hands-on Lab 9.1: Creating Static Routes
In this lab, you will create a static route in all three routers so that the
routers see all networks. Verify with the Ping program when complete.
1. The Lab_A router is connected to two networks, 172.16.10.0 and
172.16.20.0. You need to add routes to networks 172.16.30.0 and
172.16.40.0. Use the following commands to add the static routes:
Lab_A#
config t
Lab_A(config)#
ip route 172.16.30.0 255.255.255.0
172.16.20.2
Lab_A(config)#
ip route 172.16.40.0 255.255.255.0
172.16.20.2
2. Save the current configuration for the Lab_A router by going to
privileged mode, typing
copy run start
, and pressing Enter.
3. On the Lab_B router, you have direct connections to networks
172.16.20.0 and 172.16.30.0. You need to add routes to networks
172.16.10.0 and 172.16.40.0. Use the following commands to add the
static routes:
Lab_B#
config t
Lab_B(config)#
ip route 172.16.10.0 255.255.255.0
172.16.20.1
Lab_B(config)#
ip route 172.16.40.0 255.255.255.0
172.16.30.2
4. Save the current configuration for router Lab_B by going to the
enabled mode, typing
copy run start
, and pressing Enter.
5. On router Lab_C, create a static route to networks 172.16.10.0 and
172.16.20.0, which are not directly connected. Create static routes so
that router Lab_C can see all networks, using the commands shown
here:
Lab_C#
config t
Lab_C(config)#
ip route 172.16.10.0 255.255.255.0
172.16.30.1
Lab_C(config)#
ip route 172.16.20.0 255.255.255.0
172.16.30.1
6. Save the current configuration for router Lab_C by going to the
enable mode, typing
copy run start
, and pressing Enter.
7. Check your routing tables to make sure all four networks show up by
executing the
show ip route
command.
8. Now ping from each router to your hosts and from each router to each
router. If it is set up correctly, it will work.
Hands-on Lab 9.2: Configuring RIP Routing
In this lab, we will use the dynamic routing protocol RIP instead of static
routing.
1. Remove any static routes or default routes configured on your routers
by using the
no ip route
command. For example, here is how you
would remove the static routes on the Lab_A router:
Lab_A#
config t
Lab_A(config)#
no ip route 172.16.30.0 255.255.255.0
172.16.20.2
Lab_A(config)#
no ip route 172.16.40.0 255.255.255.0
172.16.20.2
Do the same thing for routers Lab_B and Lab_C. Verify that only your
directly connected networks are in the routing tables.
2. After your static and default routes are clear, go into configuration
mode on router Lab_A by typing
config t
.
3. Tell your router to use RIP routing by typing
router rip
and pressing
Enter, as shown here:
Dostları ilə paylaş: |