Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / Juniper / Filter routes when using RIB groups with several routing-instances

Filter routes when using RIB groups with several routing-instances

May 28, 2016 by James Palmer

This article describes how to filter routes going from one routing table to several routing-instances.

The goal is to import routes using RIB groups (RIB: routing information base, also known as routing table), and filter what the RIB copies to other routing instances using policy-options and import-policy over the rib-groups stanza.

Example 1 shows how to use RIB groups over interface-routes, and copy them from inet.0 to several routing instances.

Example 2 shows how to filter routes going from inet.0 to PBR1 and PBR2, and copy all inet.0 information to other TEST routing instances.

Example 1: Use RIB groups over interface-routes, and copy them from inet.0 to several routing instances

routing-options {
interface-routes {
rib-group inet interfaces;
}
rib-groups {
interfaces {
import-rib [ inet.0 TEST1.inet.0 TEST2.inet.0 TEST3.inet.0 PBR1.inet.0 PBR2.inet.0 ];
import-policy only-specific-routes; <--------- This will be reference over the next step.
}
}
}

Example 2: Policy structure: Filter routes going from inet.0 to PBR1 and PBR2, and copy all inet.0 information to other TEST routing instances

policy-options {
policy-statement only-specific-routes {
term PBR1 {
from {
route-filter 10.0.0.2/31 exact;
}
to rib PBR1.inet.0;
then accept;
}
term PBR1-reject-others {
to rib PBR1.inet.0;
then reject;
}
term PBR2 {
from {
route-filter 10.0.0.4/31 exact;
}
to rib PBR2.inet.0;
then accept;
}
term PBR2-reject-others {
to rib PBR2.inet.0;
then reject;
}
term else {
then accept;
}
}
}

Outputs after the implementation filters the Direct routes
Note that TEST2.inet.0 and TEST3.inet.0 have the same output as TEST1.inet.0.

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

10.0.0.0/31 *[Direct/0] 00:13:11
> via lt-1/2/0.1
10.0.0.1/32 *[Local/0] 00:13:12
Local via lt-1/2/0.1
10.0.0.2/31 *[Direct/0] 00:13:11
> via lt-1/2/0.2
10.0.0.2/32 *[Local/0] 00:13:12
Local via lt-1/2/0.2
10.0.0.4/31 *[Direct/0] 00:13:11
> via lt-1/2/0.4
10.0.0.4/32 *[Local/0] 00:13:12
Local via lt-1/2/0.4
10.0.0.12/31 *[Direct/0] 00:13:11
> via lt-1/2/0.12
10.0.0.12/32 *[Local/0] 00:13:12
Local via lt-1/2/0.12
192.168.1.1/32 *[IS-IS/15] 00:12:54, metric 10
> to 10.0.0.0 via lt-1/2/0.1
192.168.1.2/32 *[Direct/0] 00:13:12
> via lo0.2

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

10.0.0.2/31 *[Direct/0] 00:13:11
> via lt-1/2/0.2

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

10.0.0.4/31 *[Direct/0] 00:13:11
> via lt-1/2/0.4

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

10.0.0.0/31 *[Direct/0] 00:13:11
> via lt-1/2/0.1
10.0.0.1/32 *[Local/0] 00:13:11
Local via lt-1/2/0.1
10.0.0.2/31 *[Direct/0] 00:13:11
> via lt-1/2/0.2
10.0.0.2/32 *[Local/0] 00:13:11
Local via lt-1/2/0.2
10.0.0.4/31 *[Direct/0] 00:13:11
> via lt-1/2/0.4
10.0.0.4/32 *[Local/0] 00:13:11
Local via lt-1/2/0.4
10.0.0.6/31 *[Direct/0] 00:13:11
> via lt-1/2/0.6
10.0.0.6/32 *[Local/0] 00:13:11
Local via lt-1/2/0.6
10.0.0.12/31 *[Direct/0] 00:13:11
> via lt-1/2/0.12
10.0.0.12/32 *[Local/0] 00:13:11
Local via lt-1/2/0.12
192.168.1.2/32 *[Direct/0] 00:13:12
> via lo0.2

 

Related

Filed Under: Juniper Tagged With: RIB groups, Routing Information Base

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in