Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Applying Policies to RIPng Routes Imported from Neighbors

Understanding RIPng Import Policies

The default RIPng import policy is to accept all received RIPng routes that pass a validity check. To filter routes being imported by the local routing device from its neighbors, include the import statement and list the names of one or more policies to be evaluated. If you specify more than one policy, they are evaluated in order (first to last) and the first matching policy is applied to the route. If no match is found, the local routing device does not import any routes.

Example: Applying Policies to RIPng Routes Imported from Neighbors

This example shows how to configure an import policy in a RIPng network.

Requirements

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

Overview

In this example, Device R2 has several extra loopback interface addresses configured to simulate additional networks.

Device R1 has an import policy that accepts the fe80::/64 and 2001:db8::/64 routes and rejects all other routes. This means that the extra networks advertised by Device R2 are not accepted into Device R1’s routing table.

An export policy is also shown because an export policy is required as part of the minimum configuration for RIPng.

Figure 1 shows the topology used in this example.

Figure 1: RIPng Import Policy Network Topology

RIPng Import Policy 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 R1.

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 description to-R2set interfaces fe-1/2/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64set interfaces lo0 unit 1 family inet6 address 2001:db8::1/128set protocols ripng group ripng-group export advertise-routes-through-ripngset protocols ripng group ripng-group neighbor fe-1/2/0.1 import ripng-importset policy-options policy-statement advertise-routes-through-ripng term 1 from protocol directset policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripngset policy-options policy-statement advertise-routes-through-ripng term 1 then acceptset policy-options policy-statement ripng-import term 1 from route-filter fe80::/64 orlongerset policy-options policy-statement ripng-import term 1 from route-filter 2001:db8::/64 orlongerset policy-options policy-statement ripng-import term 1 then acceptset policy-options policy-statement ripng-import term 2 then reject

Device R2

set interfaces fe-1/2/0 unit 2 description to-R1set interfaces fe-1/2/0 unit 2 family inet6 address 2001:db8:0:2::/64 eui-64set interfaces fe-1/2/1 unit 5 description to-R3set interfaces fe-1/2/1 unit 5 family inet6 address 2001:db8:0:3::/64 eui-64set interfaces lo0 unit 2 family inet6 address 2001:db8::2/128set interfaces lo0 unit 2 family inet6 address 2002:db8::2/128set interfaces lo0 unit 2 family inet6 address 2002:db9::2/128set interfaces lo0 unit 2 family inet6 address 2002:db7::2/128set protocols ripng group ripng-group export advertise-routes-through-ripngset protocols ripng group ripng-group neighbor fe-1/2/0.2set protocols ripng group ripng-group neighbor fe-1/2/1.5set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol directset policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripngset policy-options policy-statement advertise-routes-through-ripng term 1 then accept

Device R3

set interfaces fe-1/2/0 unit 6 description to-R2set interfaces fe-1/2/0 unit 6 family inet6 address 2001:db8:0:4::/64 eui-64set interfaces lo0 unit 3 family inet6 address 2001:db8::3/128set protocols ripng group ripng-group export advertise-routes-through-ripngset protocols ripng group ripng-group neighbor fe-1/2/0.6set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol directset policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripngset policy-options policy-statement advertise-routes-through-ripng 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 configure a RIPng import policy:

  1. Configure the network interfaces.

    This example shows multiple loopback interface addresses to simulate attached networks.

    [edit interfaces]user@R1# set fe-1/2/0 unit 1 description to-R2user@R1# set fe-1/2/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64
    user@R1# set lo0 unit 1 family inet6 address 2001:db8::1/128
  2. Create the RIPng group and add the interface.

    To configure RIPng in Junos OS, you must configure a group that contains the interfaces on which RIPng is enabled. You do not need to enable RIPng on the loopback interface.

    [edit protocols ripng group ripng-group]user@R1# set neighbor fe-1/2/0.1
  3. Create the routing policy to advertise both direct and RIPng-learned routes.
    [edit policy-options policy-statement advertise-routes-through-ripng term 1]user@R1# set from protocol directuser@R1# set from protocol ripnguser@R1# set then accept
  4. Apply the routing policy.

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

    [edit protocols ripng group ripng-group]user@R1# set export advertise-routes-through-ripng
  5. Configure the import policy.
    [edit policy-options policy-statement ripng-import]user@R1# set term 1 from route-filter fe80::/64 orlongeruser@R1# set term 1 from route-filter 2001:db8::/64 orlongeruser@R1# set term 1 then acceptuser@R1# set term 2 then reject
  6. Apply the import policy.
    [edit protocols ripng group ripng-group]user@R1# set neighbor fe-1/2/0.1 import ripng-import

Results

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

user@R1# show interfaces
fe-1/2/0 {unit 1 {description to-R2;family inet6 {address 2001:db8:0:1::/64 {eui-64;}}}}
lo0 {unit 1 {family inet6 {address 2001:db8::1/128;}}}
user@R1# show protocols
ripng {group ripng-group {export advertise-routes-through-ripng;neighbor fe-1/2/0.1 {import ripng-import;}}}
user@R1# show policy-options
policy-statement advertise-routes-through-ripng {term 1 {from protocol [ direct ripng ];then accept;}}
policy-statement ripng-import {term 1 {from {route-filter fe80::/64 orlonger;route-filter 2001:db8::/64 orlonger;}then accept;}term 2 {then reject;}}

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

Verification

Confirm that the configuration is working properly.

Looking at the Neighbor Addresses for Device R2

Purpose

Determine the neighbor address that Device R2 is using for Device R1.

Action

From operational mode, enter the show ripng neighbor command.

user@R2> show ripng neighbor fe-1/2/0.2
                    Source                           Dest               In
Neighbor     State  Address                          Address  Send Recv Met
--------     -----  -------                          -------  ---- ---- ---
fe-1/2/0.2      Up fe80::2a0:a514:0:24c              ff02::9  yes  yes  1

Meaning

Device R2 is using the fe80::2a0:a514:0:24c address to send routes to Device R1.

Looking at the Routes That Device R2 Is Advertising to Device R1

Purpose

Verify that Device R2 is sending the expected routes.

Action

From operational mode, enter the show route advertising-protocol ripng command.

user@R2> show route advertising-protocol ripng fe80::2a0:a514:0:24c
inet6.0: 17 destinations, 18 routes (17 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2001:db8::2/128    *[Direct/0] 3d 22:00:34
                    >    via lo0.2
2001:db8::3/128    *[RIPng/100] 3d 21:47:00, metric 2, tag 0
                    > to fe80::2a0:a514:0:64c via fe-1/2/1.5
2001:db8:0:2::/64  *[Direct/0] 3d 22:00:34
                    >    via fe-1/2/0.2
2001:db8:0:3::/64  *[Direct/0] 3d 22:00:34
                    >    via fe-1/2/1.5
2001:db8:0:4::/64  *[RIPng/100] 3d 21:47:00, metric 2, tag 0
                    > to fe80::2a0:a514:0:64c via fe-1/2/1.5
2002:db7::2/128    *[Direct/0] 00:29:05
                    >    via lo0.2
2002:db8::2/128    *[Direct/0] 00:31:49
                    >    via lo0.2
2002:db9::2/128    *[Direct/0] 00:29:05
                    >    via lo0.2

Meaning

Device R2 is sending the extra loopback interface /128 routes to Device R1.

Looking at the Routes That Device R1 Is Receiving from Device R2

Purpose

Verify that Device R1 is receiving the expected routes.

Action

From operational mode, enter the show route receive-protocol ripng command.

user@R1> show route receive-protocol ripng fe80::2a0:a514:0:24c
inet6.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2001:db8::2/128    *[RIPng/100] 3d 21:55:49, metric 2, tag 0
                    > to fe80::2a0:a514:0:24c via fe-1/2/0.1
2001:db8::3/128    *[RIPng/100] 3d 21:55:46, metric 3, tag 0
                    > to fe80::2a0:a514:0:24c via fe-1/2/0.1

Meaning

The output shows that the extra loopback interface addresses are excluded.

Checking the Routing Table

Purpose

Verify that the routing table is populated with the expected routes.

Action

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

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

2001:db8::2/128    *[RIPng/100] 3d 22:01:40, metric 2, tag 0
                    > to fe80::2a0:a514:0:24c via fe-1/2/0.1
2001:db8::3/128    *[RIPng/100] 3d 22:01:37, metric 3, tag 0
                    > to fe80::2a0:a514:0:24c via fe-1/2/0.1
ff02::9/128        *[RIPng/100] 00:00:08, metric 1
                         MultiRecv

Meaning

The output shows that the routes have been learned from Device R2 and Device R3.

If you delete or deactivate the import policy, the routing table contains the extra loopback interface routes.

Published: 2013-07-23

Published: 2013-07-23