Applying Offsets to Routes


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


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 
Router2(config)#router rip
Router2(config-router)#offset-list 22 in 5 Serial0.1

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
Router2(config)#router rip
Router2(config-router)#offset-list 33 out 10 Serial0.1



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:
 Routing Information Sources:
 Gateway Distance Last Update 120 00:00:12
 Distance: (default is 120)

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 via Serial0.1 
Aug 10 23:24:36: RIP: build update entries
Aug 10 23:24:36: subnet metric 1
Aug 10 23:24:36: network metric 11
Aug 10 23:24:48: RIP: received v1 update from on Serial0.1
Aug 10 23:24:48: in 1 hops
Aug 10 23:24:48: in 1 hops
Aug 10 23:24:48: in 1 hops
Aug 10 23:24:48: in 7 hops

Router Configuration and File Management

Router Management

User Access and Privilege Levels


IP Routing





Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time


Router Interfaces and Media

Simple Network Management Protocol





First Hop Redundancy Protocols

IP Multicast

IP Mobility




Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications


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