Hi ,
It is better not to understand the rib-group mechanism as "copying from left to right".
Actually, it depends on where you apply the rib-groups.
<routing-instances User-B routing-options interface-routes> rib-group InetB
rib-groups {
InetB {
import-rib [ User-B.inet.0 User-A.inet.0 ];
}
}
The above, installs all interface routes of routing-instance User-B into tables User-B.inet.0 & User-A.inet.0.
Even, if you configure the rib-group other way around, ( User-A.inet.0 in left ) and apply the rib-group inetB to <routing-instances User-B routing-options interface-routes> ,the same results will ge achieved.
rib-groups {
InetB {
import-rib [ User-A.inet.0 User-B.inet.0 ];
}
}
So, copying from left table to right table is not true.
The following explains mor about the operation.
Consider the same example.
rib-groups {
InetB {
import-rib [ User-B.inet.0 User-A.inet.0 ];
}
}
<routing-instances User-B routing-options interface-routes> rib-group InetB
As I mentioned, this installs all interface routes of routing-instance User-B into tables User-B.inet.0 & User-A.inet.0.
If you apply the same rib-group to
<routing-instances User-A routing-options interface-routes> rib-group InetB
This will install all interface routes of routing-instance User-A into tables User-B.inet.0 & User-A.inet.0
However, the first table in the rib-group is considered as "primary" table and the rest of the table/ tables are considered as "secondary" tables.
Primary table is the table where the intended routes will be installed if we don't have a rib-group configured.
for routes of instance User-B => Primary table is User-B.inet.0
for routes of instance User-A => Primary table is User-A.inet.0
We need to mention the primary table first ( at the left isde), because some protocols ( eg: ISIS) will expect the correct order ( Primary should be first) otherwise it will give you a commit error. But in our case interface routes do not bother the order.
In the following example i didn't define the inet.0 as a primary table for rib-group "test", when I apply this rib group to global ISIS routing instance.
R1# commit check
[edit protocols isis]
'rib-group'
rib-group test: Primary routing table should be inet.0
error: configuration check-out failed
Also, if you want to import routes selectively to secondary tables , you can configure "import-policy" with rib-group.
This import policy will be applied to the secondary tables , but not to the primary table.
[edit routing-options]
rib-groups {
test {
import-rib [ inet.0 VPN-1.inet.0 ];
import-policy VPN1-import;
}
}
Conclusion :
1) when you apply rib-groups to a routing-protocol instance, it installs the routes from that protocol to the tables mentioned in the rib-groups. ( Not from one table (left) to other tables (right))
2) It is always best practice to define the primary table first and secondary table / tables then.