Routing
Reply
Contributor
aeroplane
Posts: 723
Registered: ‎06-30-2009
0
Accepted Solution

import-rib VS export-rib in RIB group Configuration

Hi Experts

 

I have confusion regarding the import-rib and export-rib commands in RIB group configuration. As per my understanding from the documents, the export-rib commands specifies the name of table from which the routes will be exported whereas the import-rib command specifies the name of tables to which routes would be imported. This is as per KB16133

 

But many people says that in the import-rib command the first table specifies the source from which routes would be exported and the second table in the command specifies the destination to which routes would be imported.

 

could any body please explain which is true I mean export-rib command specifies the source table and import-rib command specifies the destination tables?

 

Thanks

Trusted Expert
Surya
Posts: 262
Registered: ‎08-25-2009

Re: import-rib VS export-rib in RIB group Configuration

[ Edited ]

Hi,

 

The first one as per KB16133 is correct.

 

With import-rib it is COPY operation wherein the contents from FIRST table is copied to the SECOND table.

 

For instance "import-rib [ inet.0 inet.2 ]" will copy protocol specific routes from inet.0 to inet.2

 

There is also another usage of import-rib where you specify only one table "import-rib inet.2". Typical usecase for this is to specify use of inet.2 table for RPF check in multicast.

 

Regards

Surya Prakash

Contributor
aeroplane
Posts: 723
Registered: ‎06-30-2009
0

Re: import-rib VS export-rib in RIB group Configuration

Dear Surya

 

Thanks for the reply. Actually I am confuse about export-rib. When use export-rib then it specifies the source table and import-rib specifies the destination tables?

 

Similary when we use only import-rib (not export-rib) then first table specifies the source table and second table specifies the destination table?

 

Kindly correct me if I am right in understanding?

Distinguished Expert
aarseniev
Posts: 1,545
Registered: ‎08-21-2009

Re: import-rib VS export-rib in RIB group Configuration

Hello there,

 

The source is always a protocol. Direct,static,aggregate,generate routes are also considered as coming from repective protocol (called "direct","static","aggregate" and "generate" :-)

 

The import-rib is a group of 2 or more tables where 1st/leftmost listed is "primary" and 2nd & others are "secondary".

 

Regarding a popular assumption of "first table is source and second is destination" - I think this comes from "routing-options interface-routes" stanza where one usually specifies inet.0 as 1st/primary table and VRF/VR tables as 2nd/3rd/4th etc.And because all interface routes are always in inet.0, this creates assumption that interface-routes are exported from inet.0 to VR/VRF tables. This is a fair assumption since one cannot filter interface-routes on their way to inet.0 (to prevent shooting self in the foot :-) but the actual import is "from protocol" and "into primary table+secondary tables".

HTH

Rgds

Alex 

 

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Trusted Expert
Surya
Posts: 262
Registered: ‎08-25-2009
0

Re: import-rib VS export-rib in RIB group Configuration

Hi,

 

Yes.

 

When you specify export-rib, it is the source table from where the routing information is advertised.

With import-rib having multiple tables, the first one is the source and second/subsequent are the destinations table.

 

Regards

Surya Prakash

If I answered your query, please accept it as Solution.

In case you liked it, Kudos would be appreciated.

Contributor
aeroplane
Posts: 723
Registered: ‎06-30-2009
0

Re: import-rib VS export-rib in RIB group Configuration

Thanks for both.

Contributor
aeroplane
Posts: 723
Registered: ‎06-30-2009
0

Re: import-rib VS export-rib in RIB group Configuration

Just last question. If I leak some routes from some VRF to inet.0 or viceversa then I need to leak the interface routes as well?

Trusted Expert
dpapana
Posts: 282
Registered: ‎04-01-2011
0

Re: import-rib VS export-rib in RIB group Configuration

[ Edited ]

Yes, you'll have to leak the interface routes in order to have the next-hop reachable.

 

Regards,
Dumitru Papana
Trusted Expert
dpapana
Posts: 282
Registered: ‎04-01-2011
0

Re: import-rib VS export-rib in RIB group Configuration

I have one question, is it posible to leak routes from VRF that were received via MP-BGP(from other PEs) to inet.0 and viceversa?

As far as I know, there's no way of doing this, at least I could not find.

Regards,
Dumitru Papana
Trusted Expert
Surya
Posts: 262
Registered: ‎08-25-2009
0

Re: import-rib VS export-rib in RIB group Configuration

Hi,

 

Since it is possible to leak the route from  CE into inet.0 table, this eventually make other PE receive VRF routes thorugh MP-BGP.

 

Ex:

routing-options {
    rib-groups {
        VPNA-to-INET0 {
            import-rib [ VPNA.inet.0 inet.0 ];
        }
    }
}
routing-instances {
    VPNA {
        ....................................
        ....................................
        ....................................
        ....................................
        protocols {
            bgp {
                group CE1 {
                    neighbor 172.168.1.2 {
                        family inet {  
                            unicast {
                                rib-group VPNA-to-INET0;
                            }
                        }
                    }
                }
            }
        }
        ....................................
        ....................................
        ....................................
}

 

Regards

Surya Prakash

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.