.NODE

Applying Offsets to Routes

Problem

You want to modify the routing metrics for routes learned from or sent out through a particular interface.

Solution

You can modify the RIP metrics for a list of routes learned through a particular interface with the offset-list configuration command:

Router2#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#access-list 22 permit 192.168.20.0 
Router2(config)#router rip
Router2(config-router)#offset-list 22 in 5 Serial0.1
Router2(config-router)#exit
Router2(config)#end
Router2#

A similar command changes the metrics for a list of routes as they are sent out through a specified interface:

Router2#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#access-list 33 permit 192.168.30.0
Router2(config)#router rip
Router2(config-router)#offset-list 33 out 10 Serial0.1
Router2(config-router)#exit
Router2(config)#end
Router2#

 

Discussion

The offset-list command is most useful when you need RIP to take account of the costs of different links. By default, RIP only looks at the number of hops to the destination. But sometimes the longer path is significantly faster. For example, you might have a primary link that uses a T1 to get to a router in another building, and an Ethernet segment to get from there to another router that connects to a server. It's probably better to take this primary link than a backup 56Kbps circuit that happens to connect directly to the last hop router.

Other routing protocols, such as OSPF, address this problem by assigning a cost to each link and adding up the costs to find the best path. But RIP only has a simple hop count metric. So if you want to ensure that one path is preferred over another, shorter one, you have to modify the metrics so that slower links actually appear to be more than one hop long.

Cisco routers give considerable flexibility in changing metrics by adding an offset. This allows you to change each route independently as it is received or sent. You can even affect routes according to which interface the router receives them through. But you need to be extremely careful because you can only increase a metric; you can never decrease it, and the maximum metric value is only 16. When the metric reaches a value of 16, RIP considers the network to be unreachable.

Sometimes you want to ensure that a particular path is never used to reach a certain destination. In this case, you can apply an offset of 16, and the router will have to find a different path. The router also allows you to apply an offset of 0, but this has no effect.

The show ip protocols command lists all of the offsets that are configured, including information about the access-lists, interfaces, and the size of the offset that is applied:

Router2#show ip protocols 
Routing Protocol is "rip"
 Sending updates every 30 seconds, next due in 25 seconds
 Invalid after 180 seconds, hold down 180, flushed after 240
 Outgoing update filter list for all interfaces is not set
 Incoming update filter list for all interfaces is not set
 Outgoing routes in Serial0.1 will have 10 added to metric if on list 33
 Incoming routes in Serial0.1 will have 5 added to metric if on list 22
 Redistributing: rip
 Default version control: send version 1, receive any version
 Interface Send Recv Triggered RIP Key-chain
 Ethernet0 1 1 2 
 Loopback0 1 1 2 
 Serial0.1 1 1 2 
 Automatic network summarization is in effect
 Maximum path: 4
 Routing for Networks:
 172.25.0.0
 192.168.30.0
 Routing Information Sources:
 Gateway Distance Last Update
 172.25.2.1 120 00:00:12
 Distance: (default is 120)
Router2#

A debug trace shows the incoming and outgoing routes. Note that the trace always shows the metric values after applying the offset for both inbound and outbound updates:

Router2#debug ip rip
RIP protocol debugging is on
Aug 10 23:24:36: RIP: sending v1 update to 255.255.255.255 via Serial0.1 
Aug 10 23:24:36: RIP: build update entries
Aug 10 23:24:36: subnet 172.25.25.2 metric 1
Aug 10 23:24:36: network 192.168.30.0 metric 11
Aug 10 23:24:48: RIP: received v1 update from 172.25.2.1 on Serial0.1
Aug 10 23:24:48: 0.0.0.0 in 1 hops
Aug 10 23:24:48: 172.22.0.0 in 1 hops
Aug 10 23:24:48: 172.25.1.0 in 1 hops
Aug 10 23:24:48: 192.168.20.0 in 7 hops
Router2#


Router Configuration and File Management

Router Management

User Access and Privilege Levels

TACACS+

IP Routing

RIP

EIGRP

OSPF

BGP

Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time

DLSw

Router Interfaces and Media

Simple Network Management Protocol

Logging

Access-Lists

DHCP

NAT

First Hop Redundancy Protocols

IP Multicast

IP Mobility

IPv6

MPLS

Security

Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications

Index

show all menu





Cisco IOS Cookbook
Cisco IOS Cookbook (Cookbooks (OReilly))
ISBN: 0596527225
EAN: 2147483647
Year: 2004
Pages: 505
Similar book on Amazon

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