[j-nsp] Moving routes between VRF and inet.0

Masood Ahmad Shah masoodnt10 at gmail.com
Sat Apr 19 06:13:38 EDT 2014


Here is how I would do that:

1. Import the routes into inet.0 by rib-groups (that is what you have
already done, great)
2. Assuming PE<>CE interface is 1.1.1.0/30 and working on the PE
3. Also I would not use “accept all” when doing import/export, so I created
a policy for that too.

<routing-instance>
floating {
    routing-options {
        interface-routes {
            rib-group inet COPY_FLOAT_TO_GLOBAL;     ## required for inet.0
to reach out to the next-hop of BGP routes
        }
    }

    protocols {
        bgp {
            group CE{
                family inet {
                    unicast {
                        rib-group COPY_FLOAT_TO_GLOBAL;
                    }
                }
                neighbor 1.1.1.1 {
                    peer-as ABCD;
                }
            }
        }
    }
}

<policy-options>
policy-statement pol-accept {
    term MY_ROUTES {
        from {
            route-filter xx.yy.220.61/32 exact;       # required prefix
            route-filter 1.1.1.0/30 exact;    # pe-ce bgp next-hop
interface route
        }
        then accept;
    }
    term NO_LEAKS {
        then reject;
    }
}

<routing-options>
rib-groups {
    COPY_FLOAT_TO_GLOBAL {
        import-rib [ floating.inet.0 inet.0 ];     # Primary table
floating.inet.0
        import-policy pol-accept;
    }
}


Cheers,
Masood


On Sat, Apr 19, 2014 at 6:01 PM, Tom Eichhorn <tom at wirkbetrieb.net> wrote:

> Dear all,
>
> I am currently fighting a bit with rib-groups, and I hope someone
> could point me in the right direction:
>
> What I have is:
>
> floating.inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
> + = Active Route, - = Last Active, * = Both
>
> xx.yy.220.61/32   *[BGP/170] 00:10:28, localpref 100, from xx.yy.221.101
>                       AS path: 64512 ?
>                     > to xx.yy.221.102 via ge-0/0/0.0, Push 20
>
> I am getting a route from a contrail controller towards my router,
> this is so far working fine. But I need this route in the default table
> inet.0.
>
> So I tried with RIB-groups:
>
> teichhorn at firefly-contrail> show configuration routing-options
>
> }
> rib-groups {
>     COPY_FLOAT_TO_GLOBAL {
>         import-rib [ floating.inet.0 inet.0 ];
>         import-policy pol-accept;
>     }
> }
>
> pol-accept simply accepts all - but the route is not beeing copied and I
> have no
> clue why - the rib group magic was always voodoo for me...
>
> Any idea or "best practices" to solve with another way?
>
> Thanks,
> Tom
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp
>


More information about the juniper-nsp mailing list