Switching

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  Routig between virtualrouters

    Posted 03-15-2009 13:51

    Hi,

     

    has somebody an example how to configure routeleaking with filtering between multiple virtual routers on an EX?

     

    thanks!



  • 2.  RE: Routig between virtualrouters

     
    Posted 03-16-2009 03:53

    Hi Screenie

     

    Here is a sample config where I redistribute some routes dirrectly between ROUT1 and ROUT2 virtual routers via some policies, it's done with rib-groups:

     

    here is the config:

     

    interfaces {
        ge-0/0/0 {
            unit 0 {
                family inet {
                    address 10.0.0.1/24;
                }
            }
        }
        ge-0/0/1 {
            unit 0 {   
                family inet {
                    address 20.0.0.1/24;
                }
            }
        }
        lo0 {
            unit 0 {
                family inet {
                    address 1.1.1.1/32;
                }
            }
            unit 1 {
                family inet {
                    address 2.2.2.2/32;
                }
            }
        }
    }
    routing-options {
        rib-groups {
            ROUT1_ROUT2 {
                import-rib [ ROUT1.inet.0 ROUT2.inet.0 ];
                import-policy POL_IMP;
            }
            ROUT2_ROUT1 {
                import-rib [ ROUT2.inet.0 ROUT1.inet.0 ];
                import-policy POL_IMP;
            }
        }
    }
    policy-options {
        policy-statement POL_IMP {
            term 1 {
                from {
                    route-filter 1.1.1.1/32 exact;
                    route-filter 2.2.2.2/32 exact;
                }
                then accept;
            }
            term 2 {
                then reject;
            }
        }
    }
    routing-instances {
        ROUT1 {
            instance-type virtual-router;
            interface ge-0/0/0.0;
            interface lo0.0;
            routing-options {
                interface-routes {
                    rib-group inet ROUT1_ROUT2;
                }
            }
        }
        ROUT2 {
            instance-type virtual-router;
            interface ge-0/0/1.0;
            interface lo0.1;
            routing-options {
                interface-routes {
                    rib-group inet ROUT2_ROUT1;
                }
            }
        }
    }
     

     

    You will see in the routing table that in my example the loopbacks are in the two routing tables:

     

    Alain@Switch_EX3200> show route | find ROUT1

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

    1.1.1.1/32         *[Direct/0] 00:42:06
                        > via lo0.0
    2.2.2.2/32         *[Direct/0] 00:06:03
                        > via lo0.1
    10.0.0.0/24        *[Direct/0] 00:42:06
                        > via ge-0/0/0.0
    10.0.0.1/32        *[Local/0] 00:42:06
                          Local via ge-0/0/0.0

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

    1.1.1.1/32         *[Direct/0] 00:06:03
                        > via lo0.0
    2.2.2.2/32         *[Direct/0] 00:42:06
                        > via lo0.1
    20.0.0.0/24        *[Direct/0] 00:42:06
                        > via ge-0/0/1.0
    20.0.0.1/32        *[Local/0] 00:42:06
                          Local via ge-0/0/1.0

     

    This is done and tested on an EX3200 in [9.4R1.8]

     

     

    HTH



  • 3.  RE: Routig between virtualrouters

    Posted 03-16-2009 08:25

    Thank you very much Loup2, this is exactly what I wsa looking for. Funny thing: I found another solution before I saw your post. I didn't use RIB groups but policybased imports:

     

    VLAN definitions:


    vlan20 {
        vlan-id 20;
        l3-interface vlan.20;
    }
    vlan30 {
        vlan-id 30;
        l3-interface vlan.30;
    }

    Vlan interfaces:

    unit 20 {
        family inet {
            address 10.1.75.100/24;
        }
    }

    unit 30 {
        family inet {
            address 192.168.1.1/24;
        }
    }

    Loopback interfaces:  (for testing)

    root# show interfaces lo0
    unit 1 {
        family inet {
            address 172.16.128.1/24;
            address 10.10.10.10/24;
        }
    }

    Physical interfaces

    root# show interfaces ge-0/0/20
    unit 0 {
        family ethernet-switching {
            vlan {
                members vlan20;
            }
        }
    }


    root# show interfaces ge-0/0/30
    unit 0 {
        family ethernet-switching {
            vlan {
                members vlan30;
            }
        }
    }

    policy-options:

    prefix-list prefixes_from_r2 {
        0.0.0.0/0;
        10.10.10.10/32;
        172.16.128.0/24;
        172.16.128.1/32;
    }

    policy-statement accept_from_r2 {
        term t1 {
            from {
                instance r2;
                prefix-list prefixes_from_r2;
            }
            then accept;
        }
        term t2 {
            then reject;
        }
    }
    policy-statement accept_from_r3 {
        term t1 {
            from instance r3;
            then accept;
        }
    }

    Routing instances:

    r2 {
        instance-type virtual-router;
        interface lo0.1;
        interface vlan.20;
        routing-options {
            static {
                route 0.0.0.0/0 next-hop 10.1.75.1;
            }
            instance-import accept_from_r3;
        }
    }

    r3 {
        instance-type virtual-router;
        interface vlan.30;
        routing-options {
            instance-import accept_from_r2;
        }
    }

    Resulting in Routing tables:


     root> show route table r2

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

    0.0.0.0/0          *[Static/5] 00:47:46
                        > to 10.1.75.1 via vlan.20
    10.1.75.0/24       *[Direct/0] 00:47:46
                        > via vlan.20
    10.1.75.100/32     *[Local/0] 01:03:14
                          Local via vlan.20
    10.10.10.0/24      *[Direct/0] 01:53:14
                        > via lo0.1
    10.10.10.10/32     *[Local/0] 01:53:14
                          Local via lo0.1
    172.16.128.0/24    *[Direct/0] 03:12:21
                        > via lo0.1
    172.16.128.1/32    *[Local/0] 03:12:21
                          Local via lo0.1
    192.168.1.0/24     *[Direct/0] 01:12:31
                        > via vlan.30
    192.168.1.1/32     *[Local/0] 01:12:31
                          Local via vlan.30


    root> show route table r3

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

    0.0.0.0/0          *[Static/5] 00:48:10
                        > to 10.1.75.1 via vlan.20
    10.10.10.10/32     *[Local/0] 01:42:37
                          Local via lo0.1
    172.16.128.0/24    *[Direct/0] 01:42:37
                        > via lo0.1
    172.16.128.1/32    *[Local/0] 01:42:37
                          Local via lo0.1
    192.168.1.0/24     *[Direct/0] 01:34:31
                        > via vlan.30
    192.168.1.1/32     *[Local/0] 01:34:31
                          Local via vlan.30

     

    So r2 imports complete r3, r3 filters from r2.

     

    Funny isn't it different ways to achieve this? Maybe somebody can comment on the different approaches?



  • 4.  RE: Routig between virtualrouters
    Best Answer

    Posted 03-16-2009 08:55

     

    Hi Screenie,

     

     Indeed, there are often more than a single way of doing things 🙂

     

     AFAIK, the main idea of instance-import was to simplify configurational requirements for inter-instance route export. Also, there are some differences from the use of rib-group while leaking routes between instances, such as:

     

    - instance-import and instance-export commands are not supported in VRF instances. (since they're more like equivalents of vrf-import and vrf-export, if you will)

     

    - instance-import will automatically enable auto-export for non-VRF instances. (rib-groups will not)

     

    - if you use rib-groups, you need to configure rib-groups per protocol, meaning that rib-groups need to be applied to each protocol from which you want to leak the routes) For example, in Loup2's example only interface routes will be leaked between instances because the rib-groups are applied only to interface-routes.

     

    Hope this helps,

    Erdem


    #instance-import
    #rib-group
    #leaking
    #Route


  • 5.  RE: Routig between virtualrouters

    Posted 03-16-2009 09:00
    Thank you both! Smiley Very Happy


  • 6.  RE: Routig between virtualrouters

     
    Posted 03-16-2009 09:04
    Hi screenie How powerful is JUNOSThere is often several ways to achieve the same goal in JUNOS Let me try to have a look at the differences:I think that the way you've configured it is a little bit more straightforward. In your case you apply an import policy directly in your routing-instance giving you the opportunity to import the entire routing table or to filter some routes  In case of rib-groups you've got more statements to achieve the same goal but you can really create a group of routing-tables and then distribute these routes where you want (and also do filtering in the complete group).In case you've got a lot of routing-instances this will be more straightforward to distribute for example all routes from all customers (if there are plenty) in one other "main" routing-instance.

     

    Kind regards

    Alain (Loup2)



  • 7.  RE: Routig between virtualrouters

    Posted 06-23-2009 01:55

    Hi all

     

    There is any solution if i have only one physical interface ? I have m120 and only xe-0/0/0 and one mac..

     

    I have 2 VR, on each VR i have bgp to other clients, but i need 3 "local" prefixes to routing between this vr..

     

    thanks for any clue

     

    regards

    Ted 

     



  • 8.  RE: Routig between virtualrouters

     
    Posted 06-23-2009 02:05

    Hi Teddy

     

    I am quite sure it's possible but could you explain a litle bit more your need with perhaps a little drawing.

     

    Please post this tread as a new one in the correct section for example JUNOS instead of Switching (M120 Smiley Happy  )



  • 9.  RE: Routig between virtualrouters

    Posted 12-21-2011 07:09
    Hi all,

    What role does rib-group play here?
    If we omit rib-group, what could be the consequences?

    Pls advise...