[j-nsp] import BGP routes in RIB

Andrew Ramsey akramsey@juniper.net
Thu, 5 Sep 2002 15:02:52 -0700


Chris,

You can do this with an "import-policy" on the rib-group.  I have this
setup:


 +-----+              +-----+
 |     +--------------+     |
 | R102|              | R40 |
 +-----+              +-----+

R102 has the instance type "forwarding"

[edit routing-instances]
lab@M10-R102# show=20
new_rib {
    instance-type forwarding;
}

I'm announcing 3 iBGP routes from R40 to R102.  1 of the routes has a
community 1:1. =20

[edit]
lab@M40-R40# ...ing-protocol bgp 10.10.10.102 extensive


inet.0: 17 destinations, 18 routes (17 active, 0 holddown, 0 hidden)
1.1.1.1/32 (1 entry, 1 announced)
 BGP group int type Internal
     Nexthop: Self
     MED: 0
     Localpref: 100
     AS path: I
     Communities: 1:1

2.2.2.2/32 (1 entry, 1 announced)
 BGP group int type Internal
     Nexthop: Self
     MED: 0
     Localpref: 100
     AS path: I
     Communities:

3.3.3.3/32 (1 entry, 1 announced)
 BGP group int type Internal
     Nexthop: Self
     MED: 0
     Localpref: 100
     AS path: I
     Communities:

[edit]
lab@M40-R40#=20

R102 sees all 3 routes

[edit routing-instances]
lab@M10-R102# run show bgp summary=20
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State
Pending
inet.0                 3          3          0          0          0
0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn
State|#Active/Received/Damped...
10.10.10.40       100         25         25       0       0       11:22
3/3/0                0/0/0

[edit routing-instances]
lab@M10-R102#=20



On R102 I create a rib-group and an import-policy to put only the iBGP
route w/ the community 1:1 into the routing instance "new_rib"

[edit routing-options rib-groups]
lab@M10-R102# show=20
new_rib {
    import-rib [ inet.0 new_rib.inet.0 ];
    import-policy routes_into_rib;
}

policy-statement routes_into_rib {
    term one {
        from {
            protocol bgp;
            community customer1;
        }
        then accept;
    }
    term two {
        then reject;
    }
}
community customer1 members 1:1;

BGP config on R102

[edit protocols bgp]
lab@M10-R102# show=20
group internal {
    type internal;
    local-address 10.10.10.102;
    family inet {
        unicast {
            rib-group new_rib;
        }
    }
    neighbor 10.10.10.40;
}

And now a look at the routing table(s) on R102

lab@M10-R102# run show route=20

inet.0: 13 destinations, 14 routes (13 active, 0 holddown, 0 hidden)
+ =3D Active Route, - =3D Last Active, * =3D Both

0.0.0.0/0          *[Static/5] 1w2d 01:04:58
                    > to 172.25.46.1 via fxp0.0
1.1.1.1/32         *[BGP/170] 00:14:22, MED 0, localpref 100, from
10.10.10.40
                      AS path: I
                    > via t3-0/0/0.0
2.2.2.2/32         *[BGP/170] 00:14:22, MED 0, localpref 100, from
10.10.10.40
                      AS path: I
                    > via t3-0/0/0.0
3.3.3.3/32         *[BGP/170] 00:14:22, MED 0, localpref 100, from
10.10.10.40
                      AS path: I
                    > via t3-0/0/0.0
10.0.0.0/30        *[Direct/0] 00:10:58
                    > via t3-0/0/0.0
                    [OSPF/10] 00:10:58, metric 2
                    > via t3-0/0/0.0
10.0.0.2/32        *[Local/0] 00:10:58
                      Local via t3-0/0/0.0
10.0.1.1/32        *[Local/0] 00:10:58
                      Reject
10.0.3.1/32        *[Local/0] 00:10:58
                      Reject
10.10.10.40/32     *[OSPF/10] 00:10:58, metric 2
                    > via t3-0/0/0.0
10.10.10.102/32    *[Direct/0] 00:10:58
                    > via lo0.0
172.25.46.0/24     *[Direct/0] 00:10:58
                    > via fxp0.0
172.25.46.102/32   *[Local/0] 00:10:58
                      Local via fxp0.0
224.0.0.5/32       *[OSPF/10] 1w2d 01:09:07, metric 1
                      MultiRecv

new_rib.inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0
hidden)
+ =3D Active Route, - =3D Last Active, * =3D Both

1.1.1.1/32         *[BGP/170] 00:10:58, MED 0, localpref 100, from
10.10.10.40
                      AS path: I
                    > via t3-0/0/0.0

You can see that all 3 BGP routes are in inet.0, but only the 1 BGP
route I wanted to put into new_rib.inet.0 is there.

hope this helps,
Andy

>-----Original Message-----
>From: Christian Malo [mailto:chris@fiberpimp.net]
>Sent: Thursday, September 05, 2002 4:24 PM
>To: Andrew Ramsey
>Cc: juniper-nsp@puck.nether.net
>Subject: RE: [j-nsp] import BGP routes in RIB
>
>
>I need to put iBGP routes in a RIB for a customer needing FBF.
>
>-chris
>
>On Thu, 5 Sep 2002, Andrew Ramsey wrote:
>
>> Chris,
>>
>> Can you explain your application a little better.  For example, 2547
>> VPNs use BGP extended communities to import MP-BGP routes into a
>> particular RIB(s).  In fact, it does exactly what you describe below.
>> Is that what you want to do?  If not, what is it you want to do?
>>
>> Thanks,
>> Andy
>>
>> >-----Original Message-----
>> >From: Christian Malo [mailto:chris@fiberpimp.net]
>> >Sent: Thursday, September 05, 2002 4:09 PM
>> >To: Andrew Ramsey
>> >Cc: juniper-nsp@puck.nether.net
>> >Subject: RE: [j-nsp] import BGP routes in RIB
>> >
>> >
>> >try doing it with a policy.
>> >
>> >like putting only BGP routes with a certain community in the RIB.
>> >
>> >-chris
>> >
>> >On Thu, 5 Sep 2002, Andrew Ramsey wrote:
>> >
>> >> Chris,
>> >>
>> >> Try this...
>> >>
>> >>
>> >https://www.juniper.net/techpubs/software/junos54/swconfig54-ro
>> >uting/htm
>> >> l/bgp-config39.html#1016224
>> >>
>> >> Andy
>> >>
>> >> >-----Original Message-----
>> >> >From: Christian Malo [mailto:chris@fiberpimp.net]
>> >> >Sent: Thursday, September 05, 2002 1:56 PM
>> >> >To: juniper-nsp@puck.nether.net
>> >> >Subject: [j-nsp] import BGP routes in RIB
>> >> >
>> >> >
>> >> >
>> >> >Is it possible to import BGP routes into a newly created RIB ?
>> >> >
>> >> >
>> >> >static/ospf/isis can be done easily but I found no docs on how
>> >> >to import
>> >> >BGP routes in the new rib.
>> >> >
>> >> >
>> >> >any idea ?
>> >> >
>> >> >-chris
>> >> >
>> >> >_______________________________________________
>> >> >juniper-nsp mailing list juniper-nsp@puck.nether.net
>> >> >http://puck.nether.net/mailman/listinfo/juniper-nsp
>> >> >
>> >>
>> >
>> >
>>
>
>