IPv6 Route Filtering and Metric Manipulation in RIP

Problem

You want to manipulate the IPv6 routing table created by RIP.

Solution

There are several types of route filtering available with RIP and IPv6. The first is a simple summary address, which you can configure on the interface that will be sending this summary information:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC summary-address AAAA:99::8:0/109
Router1(config-if)#exit
Router1(config)#end
Router1#

In addition to summary addresses, RIP can advertise a default route in addition to the routes in its routing table:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC default-information originate
Router1(config-if)#exit
Router1(config)#end
Router1#

Or, to save network and memory resources, you can configure RIP to advertise only a default route:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC default-information only
Router1(config-if)#exit
Router1(config)#end
Router1#

You can filter routes both inbound and outbound with RIP:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ipv6 prefix-list BLOCK_2E6 seq 5 deny AAAA:2E6::/64 le 128
Router1(config)#ipv6 prefix-list BLOCK_2E6 seq 10 permit ::/0 le 128
Router1(config)#ipv6 prefix-list ALLOW_2222 seq 5 permit AAAA:2222::/64 le 128
Router1(config)#ipv6 prefix-list ALLOW_2222 seq 10 deny ::/0 le 128
Router1(config)#ipv6 router rip RIP_PROC
Router1(config-rtr)#distribute-list prefix-list BLOCK_2E6 in FastEthernet0/0
Router1(config-rtr)#distribute-list prefix-list ALLOW_2222 out FastEthernet0/0
Router1(config-rtr)#exit
Router1(config)#end
Router1#

It is also sometimes useful to modify the metrics associated with specific links to help route traffic along the best path, instead of just the path with the fewest hops:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface Serial0/0
Router1(config-if)#ipv6 rip RIP_PROC metric-offset 5
Router1(config-if)#exit
Router1(config)#end
Router1#

 

Discussion

The first example in this recipe looks at route summarization on an interface:

Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC summary-address AAAA:99::8:0/109

To see how this works, we will first create several Loopback interfaces with addresses AAAA:99::9:1/112, AAAA:99::A:1/112, AAAA:99::B:1/112, AAAA:99::C:1/112, AAAA:99::D:1/112, and AAAA:99::E:1/112. We want to replace all of these entries with the single summary route, AAAA:99::8:0/109. Before implementing any summarization, a downstream router has the following routing table:

Router9>show ipv6 route rip
IPv6 Routing Table - 14 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
 U - Per-user Static route
 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
 O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R AAAA:1::/64 [120/11]
 via FE80::2E0:1EFF:FE7F:9E41, Ethernet0
R AAAA:2::/64 [120/11]
 via FE80::2E0:1EFF:FE7F:9E41, Ethernet0
R AAAA:99::9:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
R AAAA:99::A:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
R AAAA:99::B:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
R AAAA:99::C:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
R AAAA:99::D:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
R AAAA:99::E:0/112 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
Router9>

Then, with the summarization configured, the individual routes disappear and are replaced by the single summary route:

Router9>show ipv6 route rip
IPv6 Routing Table - 9 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
 U - Per-user Static route
 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
 O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R AAAA:1::/64 [120/11]
 via FE80::2E0:1EFF:FE7F:9E41, Ethernet0
R AAAA:2::/64 [120/11]
 via FE80::2E0:1EFF:FE7F:9E41, Ethernet0
R AAAA:99::8:0/109 [120/11]
 via FE80::20E:D7FF:FED6:1060, Ethernet0
Router9>

The ultimate route summarization is a default route. There are two ways to advertise a default route in RIP without needing to introduce any external networks through redistribution. The first method advertises a default route in addition to the existing networks:

Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC default-information originate

On a downstream router, the routing table now includes an IPv6 default route prefix, ::/0:

Router3#show ipv6 route rip
IPv6 Routing Table - 12 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
 U - Per-user Static route
 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
 O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R ::/0 [120/3]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
R AAAA:2::/64 [120/3]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
R AAAA:5::/64 [120/2]
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
 via FE80::20E:D7FF:FED6:1060, Serial0/0
R AAAA:99::8:0/109 [120/2]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
R AAAA:FE::/64 [120/3]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
R AAAA:2E6::/64 [120/2]
 via FE80::209:7CFF:FEB7:C9E1, Ethernet0/0
Router3#

The alternative method is useful for creating stub networks, conserving both bandwidth and memory on downstream routers. This method uses the keyword only on the default-originate command to indicate that the router should advertise only the default route and no other prefixes:

Router1(config)#interface FastEthernet0/0
Router1(config-if)#ipv6 rip RIP_PROC default-information only

Now the downstream router no longer shows any of the other prefixes, such as AAAA: FE::/64, and AAAA:2::/64, that originated with the router that introduced the default route. Note, however, that it still sees route prefixes that originated within the same stub network region:

Router3#show ipv6 route rip
IPv6 Routing Table - 10 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
 U - Per-user Static route
 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
 O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R ::/0 [120/3]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
R AAAA:5::/64 [120/2]
 via FE80::20E:D7FF:FED6:4D80, Serial0/0
 via FE80::20E:D7FF:FED6:1060, Serial0/0
R AAAA:99::8:0/109 [120/2]
 via FE80::20E:D7FF:FED6:1060, Serial0/0
R AAAA:2E6::/64 [120/2]
 via FE80::209:7CFF:FEB7:C9E1, Ethernet0/0
Router3#

A more generic form of route filtering is available by means of distribute-lists. This technique is already quite familiar from IPv4. The only real difference here is that the distribute-list command in IPv6 RIP only accepts prefix-lists and not access-lists as arguments. The example in the solutions section actually includes both an inbound and an outbound distribute-list, which we will now look at separately:

Router1(config)#ipv6 prefix-list BLOCK_2E6 seq 5 deny AAAA:2E6::/64 le 128
Router1(config)#ipv6 prefix-list BLOCK_2E6 seq 10 permit ::/0 le 128
Router1(config)#ipv6 router rip RIP_PROC
Router1(config-rtr)#distribute-list prefix-list BLOCK_2E6 in FastEthernet0/0

This inbound distribute-list allows whatever IPv6 prefixes are specified by the prefix-list. In this case, we only want to remove a single prefix, and only if it is received on interface FastEthernet0/0. If we had left off the interface argument, then the command would apply this prefix-list to filter routes received on all interfaces:

Router1(config)#ipv6 router rip RIP_PROC
Router1(config-rtr)#distribute-list prefix-list BLOCK_2E6 in

The outbound distribute-list is similar, except that it affects what route prefixes this router will send to downstream neighbors:

Router1(config)#ipv6 prefix-list ALLOW_2222 seq 5 permit AAAA:2222::/64 le 128
Router1(config)#ipv6 prefix-list ALLOW_2222 seq 10 deny ::/0 le 128
Router1(config)#ipv6 router rip RIP_PROC
Router1(config-rtr)#distribute-list prefix-list ALLOW_2222 out FastEthernet0/0

In this case, we have decided to remove all routes except for AAAA:2222::/64, but only for routing updates sent out through interface FastEthernet0/0.

Finally, we can use the ipv6 rip metric-offset command to change the way that RIP calculates the distance along a particular path:

Router1(config)#interface Serial0/0
Router1(config-if)#ipv6 rip RIP_PROC metric-offset 5

This has the effect of increasing the metrics of all routes received on this interface by the specified amount. So a route that previously had a metric value of 2 will now have a metric of 7. This router will also pass along this new metric with all of the associated prefixes to any downstream routers. This feature is most commonly used to force the network to prefer a primary path over a backup path.

See Also

Recipe 25.4






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

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