Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Redistributing Routes Among RIP Instances

Understanding Route Redistribution Among RIP instances

You can redistribute routes among RIP processes. Another way to say this is to export RIP routes from one RIP instance to other RIP instances.

In Junos OS, route redistribution among routing instances is accomplished by using routing table groups, also called RIB groups. Routing table groups allow you to import and export routes from a protocol within one routing table into another routing table.

Note: In contrast, the policy-based import and export functions allow you import and export routes between different protocols within the same routing table.

Consider the following partial example:

protocols {rip {rib-group inet-to-voice;}}
routing-instances {voice {protocols {rip {rib-group voice-to-inet;}}}}
routing-options {rib-groups {inet-to-voice {import-rib [ inet.0 voice.inet.0 ];}voice-to-inet {import-rib [ voice.inet.0 inet.0 ];}}}

The way to read the import-rib statement is as follows. Take the routes from the protocol (RIP, in this case), and import them into the primary (or local) routing table and also into any other routing tables listed after this. The primary routing table is the routing table where the routing table group is being used. That would be either inet.0 if used in the main routing instance or voice.inet.0 if used within the routing instance. In the inet-to-voice routing table group, inet.0 is listed first because this routing table group is used in the main routing instance. In the voice-to-inet routing table group, voice.inet.0 is listed first because this routing table group is used in the voice routing instance.

Example: Redistributing Routes Between Two RIP Instances

This example shows how to configure a RIP routing instance and control the redistribution of RIP routes between the routing instance and the master instance.

Requirements

No special configuration beyond device initialization is required before configuring this example.

Overview

When you create a routing instance called voice, Junos OS creates a routing table called voice.inet.0. The example shows how to install routes learned through the master RIP instance into the voice.inet.0 routing table. The example also shows how to install routes learned through the voice routing instance into inet.0. This is done by configuring routing table groups. RIP routes are installed into each routing table that belongs to a routing table group.

Figure 1 shows the topology used in this example.

Figure 1: Redistributing Routes Between RIP Instances Network Topology

Redistributing Routes Between
RIP Instances Network Topology

CLI Quick Configuration shows the configuration for all of the devices in Figure 1. The section Step-by-Step Procedure describes the steps on Device R2.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device R1

set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30set interfaces lo0 unit 1 family inet address 172.16.0.1/32set interfaces lo0 unit 1 family inet address 192.168.1.1/32set protocols rip group to-R2 export advertise-routes-through-ripset protocols rip group to-R2 neighbor fe-1/2/0.1set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then accept

Device R2

set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30set interfaces lo0 unit 2 family inet address 192.168.2.2/32set interfaces lo0 unit 2 family inet address 172.16.2.2/32set protocols rip rib-group inet-to-voiceset protocols rip group to-R3 export advertise-routes-through-ripset protocols rip group to-R3 neighbor fe-1/2/1.5set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then acceptset routing-instances voice protocols rip group to-R1 export advertise-routes-through-ripset routing-instances voice interface fe-1/2/0.2set routing-instances voice protocols rip rib-group voice-to-inetset routing-instances voice protocols rip group to-R1 neighbor fe-1/2/0.2set routing-options rib-groups inet-to-voice import-rib inet.0set routing-options rib-groups inet-to-voice import-rib voice.inet.0set routing-options rib-groups voice-to-inet import-rib voice.inet.0set routing-options rib-groups voice-to-inet import-rib inet.0

Device R3

set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30set interfaces lo0 unit 3 family inet address 192.168.3.3/32set interfaces lo0 unit 3 family inet address 172.16.3.3/32set protocols rip group to-R2 export advertise-routes-through-ripset protocols rip group to-R2 neighbor fe-1/2/0.6set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then accept

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To redistribute RIP routes between routing instances:

  1. Configure the network interfaces.
    [edit interfaces]user@R2# set fe-1/2/0 unit 2 family inet address 10.0.0.2/30
    user@R2# set fe-1/2/1 unit 5 family inet address 10.0.0.5/30
    user@R2# set lo0 unit 2 family inet address 192.168.2.2/32user@R2# set lo0 unit 2 family inet address 172.16.2.2/32
  2. Create the routing instance, and add one or more interfaces to the routing instance.
    [edit routing-instances voice]user@R2# set interface fe-1/2/0.2
  3. Create the RIP groups and add the interfaces.
    [edit protocols rip group to-R3]user@R2# set neighbor fe-1/2/1.5
    [edit routing-instances voice protocols rip group to-R1]user@R2# set neighbor fe-1/2/0.2
  4. Create the routing table groups.
    [edit routing-options rib-groups]user@R2# set inet-to-voice import-rib inet.0user@R2# set inet-to-voice import-rib voice.inet.0
    user@R2# set voice-to-inet import-rib voice.inet.0user@R2# set voice-to-inet import-rib inet.0
  5. Apply the routing table groups.
    [edit protocols rip]user@R2# set rib-group inet-to-voice
    [edit routing-instances voice protocols rip]user@R2# set rib-group voice-to-inet
  6. Create the routing policy to advertise both direct and RIP-learned routes.
    [edit policy-options policy-statement advertise-routes-through-rip term 1]user@R2# set from protocol directuser@R2# set from protocol ripuser@R2# set then accept
  7. Apply the routing policy.

    In Junos OS, you can only apply RIP export policies at the group level.

    [edit protocols rip group to-R3]user@R2# set export advertise-routes-through-rip
    [edit routing-instances voice protocols rip group to-R1]user@R2# set export advertise-routes-through-rip

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, show routing-instances, and show routing-options commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

user@R2# show interfaces
fe-1/2/0 {unit 2 {family inet {address 10.0.0.2/30;}}}
fe-1/2/1 {unit 5 {family inet {address 10.0.0.5/30;}}}
lo0 {unit 2 {family inet {address 192.168.2.2/32;address 172.16.2.2/32;}}}
user@R2# show protocols
rip {rib-group inet-to-voice;group to-R3 {export advertise-routes-through-rip;neighbor fe-1/2/1.5;}}
user@R2# show policy-options
policy-statement advertise-routes-through-rip {term 1 {from protocol [ direct rip ];then accept;}}
user@R2# show routing-instances
voice {interface fe-1/2/0.2;protocols {rip {rib-group voice-to-inet;group to-R1 {export advertise-routes-through-rip;neighbor fe-1/2/0.2;}}}}
user@R2# show routing-options
rib-groups {inet-to-voice {import-rib [ inet.0 voice.inet.0 ];}voice-to-inet {import-rib [ voice.inet.0 inet.0 ];}}

If you are done configuring the device, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly.

Checking the Routing Tables

Purpose

Make sure that the routing tables contain the expected routes.

Action

From operational mode, enter the show route protocol rip command.

user@R2> show route protocol rip
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.0.1/32      *[RIP/100] 01:58:14, metric 2, tag 0
                    > to 10.0.0.1 via fe-1/2/0.2
172.16.3.3/32      *[RIP/100] 02:06:03, metric 2, tag 0
                    > to 10.0.0.6 via fe-1/2/0.5
192.168.1.1/32     *[RIP/100] 01:58:14, metric 2, tag 0
                    > to 10.0.0.1 via fe-1/2/0.2
192.168.3.3/32     *[RIP/100] 02:06:03, metric 2, tag 0
                    > to 10.0.0.6 via fe-1/2/0.5
224.0.0.9/32       *[RIP/100] 01:44:13, metric 1
                         MultiRecv

voice.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.0.1/32      *[RIP/100] 02:06:03, metric 2, tag 0
                    > to 10.0.0.1 via fe-1/2/0.2
172.16.3.3/32      *[RIP/100] 01:58:14, metric 2, tag 0
                    > to 10.0.0.6 via fe-1/2/0.5
192.168.1.1/32     *[RIP/100] 02:06:03, metric 2, tag 0
                    > to 10.0.0.1 via fe-1/2/0.2
192.168.3.3/32     *[RIP/100] 01:58:14, metric 2, tag 0
                    > to 10.0.0.6 via fe-1/2/0.5
224.0.0.9/32       *[RIP/100] 01:44:13, metric 1
                         MultiRecv

Meaning

The output shows that both routing tables contain all of the RIP routes.

Published: 2013-09-24