Create two loopback interfaces on juniper MX router

In Junos it is not possible to create two Loopback interfaces in one routing instance, so the configuration example below would be invalid:

root@router# show interfaces lo0 unit 0 { family inet { address 10.1.1.1/32; } } unit 1 { family inet { address 10.1.1.2/32; } } [edit] root@ny-edge-r1# commit check [edit interfaces lo0] 'unit 1' if_instance: Multiple loopback interfaces not permitted in master routing instance error: configuration check-out failed [edit] root@router#

 

Instead, we have to create a separate routing instance, create Loopback interface there, and import a direct route of the second loopback to the main routing instance inet.0:

root@router> show configuration interfaces lo0 unit 0 { family inet { address 10.1.1.1/32; } } unit 2 { family inet { address 10.1.1.2/32; } } ------------------------------------------------------------------------------------------ root@router> show configuration routing-options interface-routes { rib-group inet GROUP1; } rib-groups { GROUP1 { import-rib [ RI01.inet.0 inet.0 ]; import-policy LO2-2-INET; } } ------------------------------------------------------------------------------------------ root@router> show configuration policy-options policy-statement LO2-2-INET term 10 { from instance RI01; then accept; } term 100 { then reject; } ------------------------------------------------------------------------------------------ root@router> show configuration routing-instances RI01 { instance-type virtual-router; interface lo0.2; routing-options { interface-routes { rib-group inet GROUP1; } } }





Rib-groups example

Rib-groups simple example.

We created two routing instances: test1 and test2, each instances has one interface in it:
    test1 - vlan.641:     172.16.10.1/24
    test2 - vlan.642:       172.16.20.1/24

# show routing-instances
test1 {
    instance-type virtual-router;
    interface vlan.641;

}
test2 {
    instance-type virtual-router;
    interface vlan.642;
}


Routing table looks like this:

Read more

RIB Group Confusion

This article is take from http://www.subnetzero.info/2014/04/10/rib-group-confusion/

Continuing on the subject of confusing Junos features, I’d like to talk about RIB groups. When I started here at Juniper, I remember being utterly baffled by this feature and its use. RIB groups are confusing both because the official documentation is confusing, and because many people, trying to be helpful, say things that are entirely wrong. I do think there would have been an easier way to design this feature, but RIB groups are what we have, so that’s what I’ll talk about.

Read more