routing instances and rib-groups

Here is a short routing instance and rib-group configuration. I assume you have configured routing instance named “untrust”

Configure routing instance
root@host# show routing-instances
untrust {
    instance-type virtual-router;
    interface ge-0/0/1.0;
}
Display Routes
root@host> show route
inet.0: 6 destinations, 6 routes (3 active, 0 holddown, 3 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0          *[Static/4] 22:54:24
                    > to 172.30.72.1 via ge-0/0/0.0
172.30.72.0/23     *[Direct/0] 23:49:01
                    > via ge-0/0/0.0
172.30.73.79/32    *[Local/0] 23:49:01
                      Local via ge-0/0/0.0
untrust.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
192.168.4.0/24     *[Direct/0] 00:35:19
                    > via ge-0/0/1.0
192.168.4.1/32     *[Local/0] 00:35:19
                      Local via ge-0/0/1.0
We have two routing tables but how we can share routes in between? here it is
[edit routing-options]
root@host# show
interface-routes {
    rib-group inet myshare;
}
rib-groups {
    myshare {
        import-rib [ inet.0 untrust.inet.0 ];
    }
}
We created rib-groups and applied on interface-routes section by which we let untrust.inet.0 table to access routes on master instance.
root@host> show route
inet.0: 6 destinations, 6 routes (3 active, 0 holddown, 3 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0          *[Static/4] 22:59:19
                    > to 172.30.72.1 via ge-0/0/0.0
172.30.72.0/23     *[Direct/0] 23:53:56
                    > via ge-0/0/0.0
172.30.73.79/32    *[Local/0] 23:53:56
                      Local via ge-0/0/0.0
untrust.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
172.30.72.0/23     *[Direct/0] 00:02:20
                    > via ge-0/0/0.0
172.30.73.79/32    *[Local/0] 00:02:20
                      Local via ge-0/0/0.0
192.168.4.0/24     *[Direct/0] 00:40:14
                    > via ge-0/0/1.0
192.168.4.1/32     *[Local/0] 00:40:14
                      Local via ge-0/0/1.0

About: rtoodtoo

Worked for more than 10 years as a Network/Support Engineer and also interested in Python, Linux, Security and SD-WAN // JNCIE-SEC #223 / RHCE / PCNSE


One thought on “routing instances and rib-groups”

  1. Please help why is the static routes not shown under sx210_untrust.inet?

    root@srx100> show route

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

    0.0.0.0/0 *[Static/5] 01:33:25
    > to 192.168.2.1 via fe-0/0/0.0
    1.1.1.1/32 *[Local/0] 01:33:28
    Reject
    192.168.1.1/32 *[Local/0] 01:33:40
    Reject
    192.168.2.0/24 *[Direct/0] 01:33:25
    > via fe-0/0/0.0
    192.168.2.200/32 *[Static/1] 01:33:28
    Receive
    192.168.2.254/32 *[Local/0] 01:33:28
    Local via fe-0/0/0.0
    192.168.4.1/32 *[Local/0] 01:33:28
    Reject
    192.168.10.0/24 *[Direct/0] 01:33:41
    > via st0.0
    192.168.10.1/32 *[Local/0] 01:33:41
    Local via st0.0
    192.168.100.0/24 *[Static/5] 01:33:41
    > via st0.0
    192.168.239.1/32 *[Local/0] 01:33:28
    Reject

    srx210_untrust.inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidd en)
    + = Active Route, – = Last Active, * = Both

    1.1.1.1/32 *[Local/0] 00:10:59
    Reject
    172.16.10.0/24 *[Direct/0] 01:32:00
    > via vlan.10
    172.16.10.2/32 *[Local/0] 01:33:40
    Local via vlan.10
    172.16.20.0/24 *[Static/5] 01:32:00
    > to 172.16.10.1 via vlan.10
    192.168.1.1/32 *[Local/0] 00:10:59
    Reject
    192.168.2.0/24 *[Direct/0] 00:10:59
    > via fe-0/0/0.0
    192.168.2.254/32 *[Local/0] 00:10:59
    Local via fe-0/0/0.0
    192.168.4.1/32 *[Local/0] 00:10:59
    Reject
    192.168.10.0/24 *[Direct/0] 00:10:59
    > via st0.0
    192.168.10.1/32 *[Local/0] 00:10:59
    Local via st0.0
    192.168.239.1/32 *[Local/0] 00:10:59
    Reject

    root@srx100> edit
    Entering configuration mode

    [edit]
    root@srx100# edit routing-options

    [edit routing-options]
    root@srx100# show
    interface-routes {
    rib-group inet myshare;
    }
    static {
    route 0.0.0.0/0 next-hop 192.168.2.1;
    route 192.168.100.0/24 next-hop st0.0;
    }
    rib-groups {
    myshare {
    import-rib [ inet.0 srx210_untrust.inet.0 ];
    }
    }

    [edit routing-options]
    root@srx100#

You have a feedback?

Discover more from RtoDto.net

Subscribe now to keep reading and get access to the full archive.

Continue reading