Static Routing


When using the ip route command, you can identify where packets should be routed to in two ways:

  • The next-hop address

  • The exit interface

Both ways are shown in both the "Configuration Example: Static Routes" section and the "Default Routing" section.

Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2

172.16.20.0 = destination network

 

255.255.255.0 = subnet mask

 

172.16.10.2 = next-hop address

 

Read this to say: To get to the destination network of 172.16.20.0, with a subnet mask of 255.255.255.0, send all packets to 172.16.10.2

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

172.16.20.0 = destination network

 

255.255.255.0 = subnet mask

 

s0/0 = exit interface

 

Read this to say: To get to the destination network of 172.16.20.0, with a subnet mask of 255.255.255.0, send all packets out interface Serial 0/0


The permanent Keyword (Optional)

Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2 permanent

Specifies that the route will not be removed, even if the interface shuts down


Without the permanent keyword in a static route statement, a static route will be removed if an interface goes down. If you don't tighten those serial cables or if you have a bad connector on a UTP cable, a cable can easily become loose, causing an interface to go down. But plugging the cable back in does not add that static route back into the routing table. The only way to get that route back into the table is to reload the router or use the permanent keyword in your ip route command. This option is especially useful when the night janitor knocks a cable loose and replaces it, hoping no one will notice.... Can your network afford to lose a route for a few hours until the next morning when you or your IT staff comes in to work? The permanent keyword is also useful in helping to avoid constant shortest path first (SPF) calculations in OSPF when there is a flapping link; if the link goes down, the route will stay in the routing table.

However, you must be careful when using this optional keyword. You might want that route to be removed from the routing table. You might also want to know why the night janitor was in your wiring closet in the first place.

Static Routes and Administrative Distance (Optional)

Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2 200

Specifies that an administrative distance of 200 has been assigned to this route.


Note:

By default, a static route is assigned an administrative distance (AD) of 1. Administrative distance rates the "trustworthiness" of a route. AD is a number from 0-255, where 0 is absolutely trusted, and 255 cannot be trusted at all. Therefore, an AD of 1 is an extremely reliable rating, with only an AD of 0 being better. An AD of 0 is assigned to a directly connected route. The following table lists the administrative distance for each type of route.


Route Type

Administrative Distance

Connected

0

Static

1

EIGRP Summary Route

5

EBGP

20

EIGRP (Internal)

90

IGRP

100

OSPF

110

IS-IS

115

RIP

120

EGP

140

On-Demand Routing

160

EIGRP (External)

170

iBGP (External)

200

Unknown

255


Tip:

By default, a static route will always be used instead of a routing protocol. By adding an AD number to your ip route statement, however, you can effectively create a backup route to your routing protocol. If your network is using EIGRP, and you need a backup route, add a static route with an AD greater than 90. EIGRP will be used because its AD is better (lower) than the static route. But if EIGRP goes down, the static route will be used in its place. This is known as a floating static route. See Appendix A, "Complete Configuration Example," for an example where a floating static route is used as a backup route.





CCNA Self-Study(c) CCNA Portable Command Guide
CCNA Portable Command Guide
ISBN: 1587201585
EAN: 2147483647
Year: 2006
Pages: 261
Authors: Scott Empson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net