Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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-08-15