Configuration Guide Vol. 3


14.2.3 RIP advertised route filtering

<Structure of this section>

(1) Advertisement of specific protocol routes

Configure the advertisement of static routes and OSPF domain 1 routes by RIP.

Points to note

The example below shows how to use the redistribute command to advertise routes that would not be advertised by default. In the redistribute command, specify the protocols that you want advertised.

When configuring the advertisement of OSPF routes, you must also specify a metric. OSPF and BGP4 routes cannot be advertised without a metric.

Command examples

  1. (config)# router rip

    (config-router)# redistribute static

    Advertises static routes into RIP.

  2. (config-router)# redistribute ospf 1 metric 2

    Advertises OSPF domain 1 routes, assigning them a metric of 2.

(2) Advertising Specific Destination Network Routes for Specific Protocols

Configure RIP to advertise static routes, and only those OSPF routes that have a destination network in the 192.168.0.0/16 range.

Points to note

To filter advertised routes based on their learning source protocol, specify route-map in the redistribute command. Use an ip prefix-list filter to supply the destination network conditions for route-map.

First, configure an ip prefix-list filter to permit only routes in the 192.168.0.0/16 range. Next, configure route-map to use this filter as filter conditions. Finally, use redistribute commands to specify static routes and OSPF routes. In the redistribute command for the OSPF routes, specify route-map.

Command examples

  1. (config)# ip prefix-list ONLY192168 seq 10 permit 192.168.0.0/16

    Configures prefix-list to permit only routes in the 192.168.0.0/16 range. Because ONLY192168 has no other conditions, the filter denies routes with any other destination address or mask length.

  2. (config)# route-map ONLY192168 permit 10

    (config-route-map)# match ip address prefix-list ONLY192168

    (config-route-map)# exit

    Configures route-map to permit routes whose destination network is in the 192.168.0.0/16 range.

  3. (config)# router rip

    (config-router)# redistribute static

    Configures RIP to advertise static routes.

  4. (config-router)# redistribute ospf 1 metric 2 route-map ONLY192168

    Configures RIP to filter OSPF domain 1 routes by ONLY192168 and advertise permitted routes, assigning them a metric of 2.

(3) Suppressing advertisement of specific destination network routes

You can prevent RIP from advertising routes destined for the 192.168.0.0/16 address range.

Points to note

The example below shows how to use the distribute-list out command to filter advertised routes regardless of their learning source protocol.

First, configure an ip prefix-list filter to deny routes to the 192.168.0.0/16 address range. By referencing this filter from the distribute-list out command, you can configure RIP to filter learned routes according to their destination network.

Command examples

  1. (config)# ip prefix-list OMIT192168 seq 10 deny 192.168.0.0/16

    Configures prefix-list to deny routes in the 192.168.0.0/16 range.

  2. (config)# ip prefix-list OMIT192168 seq 100 permit 0.0.0.0/0 ge 0 le 32

    Configures an ip prefix-list filter to permit routes with any destination address and mask length. Because OMIT192168 has no other conditions, the filter denies routes to 192.168.0.0/16 only.

  3. (config)# router rip

    (config-router)# distribute-list prefix OMIT192168 out

    Configures RIP to apply the OMIT192168 filter to every route it advertises.

(4) Filtering advertised routes for each advertised interface

Configure the Switch to use RIP interface VLAN 10 to advertise routes only to 192.168.0.0/16 , and RIP interface VLAN 20 to advertise all other routes. In this scenario, no interface-level filtering is applied to the other RIP interfaces.

Points to note

To apply route filtering at the level of individual RIP interfaces, specify the <Interface> in the parameters of the distribute-list out command.

First, configure a prefix-list filter to permit routes in the 192.168.0.0/16 range, and another to permit any route not in the 192.168.0.0/16 range. Next, specify the distribute-list out <Interface> command for RIP interfaces VLAN 10 and VLAN 20. In the distribute-list out <Interface> command, specify the prefix-list filter appropriate to that RIP interface.

Command examples

  1. (config)# ip prefix-list ONLY192168 seq 10 permit 192.168.0.0/16

    Configures an ip prefix-list to permit routes in the 192.168.0.0/16 range. Because ONLY192168 has no other conditions, the filter denies routes with any other destination address or mask length.

  2. (config)# ip prefix-list OMIT192168 seq 10 deny 192.168.0.0/16

    Configures an ip prefix-list to deny routes in the 192.168.0.0/16 range.

  3. (config)# ip prefix-list OMIT192168 seq 100 permit 0.0.0.0/0 ge 0 le 32

    Configures prefix-list to permit routes with any destination address and mask length. Because OMIT192168 has no other conditions, the filter denies routes to 192.168.0.0/16 only.

  4. (config)# router rip

    (config-router)# distribute-list prefix ONLY192168 out vlan 10

    Configures RIP to apply the ONLY192168 filter to routes advertised from VLAN 10.

  5. (config-router)# distribute-list prefix OMIT192168 out vlan 20

    Configures RIP to apply the OMIT192168 filter to routes advertised from VLAN 20.

(5) Controlling advertised routes by tag value

Configure the switch to assign a tag value of 210 to any directly connected routes it advertises and advertise static routes only if they have a tag value of 211. You then configure the switch not to advertise routes that have a tag value of 210 or 211 by RIP. This process prevents RIP advertised routes from looping through the Switch.

You must be using RIP version 2 to filter based on tag values. Keep in mind that RIP version 1 does not support tags.

Points to note

The example below shows how to use route-map to filter a route by an attribute other than its destination network, or you wish to change a route attribute other than the metric. You can reference this route-map from redistribute and distribute-list out among other commands.

The commands below do the following: configure route-map to set the tag value of directly connected routes to 210, configure route-map to permit static routes with a tag value of 211, and configure route-map to deny RIP routes with tag values of 210 or 211.

Command examples

  1. (config)# route-map ConnectedToRIP permit 10

    (config-route-map)# set tag 210

    (config-route-map)# exit

    Configures route-map to assign a tag value of 210.

  2. (config)# route-map StaticToRIP permit 10

    (config-route-map)# match tag 211

    (config-route-map)# exit

    Configures route-map to permit routes with a tag value of 211.

  3. (config)# route-map RIPToRIP deny 10

    (config-route-map)# match tag 210 211

    (config-route-map)# exit

    (config)# route-map RIPToRIP permit 20

    (config-route-map)# exit

    Configures route-map to deny routes with a tag value of 210 or 211 while permitting all others.

  4. (config)# router rip

    (config-router)# version 2

    (config-router)# redistribute connected route-map ConnectedToRIP

    Advertises direct routes into RIP. Specify ConnectedToRIPng as the advertising conditions.

  5. (config-router)# redistribute static route-map StaticToRIP

    Advertises static routes into RIP. Specify StaticToRIP as the advertising conditions.

  6. (config-router)# redistribute rip route-map RIPToRIP

    Advertises RIP routes into RIP. Specify RIPToRIP as the advertising conditions.