input filter to set outgoing prefferences
Arjan Filius
iafilius at xs4all.nl
Thu Jun 10 09:57:59 CEST 2010
Hello bird-users,
(email send in html to prevent text wrapping, .txt version attached)
running bird 1.2.3 ppa x64 ubuntu 10.04LTS. 2 bird routers connected
with 2 iBGP sessions over different links.
I'm trying to route specific outgoing traffic over a specific Transit.
It starts with that I'm not really sure how to do it, so tested a bit.
Setting Local performance
on protocol definition works just fine for a complete Transit, however
when i want to do it more fine grained, i run into trouble.
First started with prepending routes in bgp input filter with my own AS,
which works OK on a single bird router, however, with iBGP all prepended
local AS-es are stripped, and that concept doesn't work.
Then, started to set the preference in the bgp input filter, which also
works fine on a single bird router, but that preference seems not to
propagate to the second iBGP router.
on router1 i set in the bgp input filter the preference to 300 for a
specific network(91.189.88.0/21), and on router 2 the preference to 400.
What i would want, is that both iBGP routers agree on route for a
specific manual
overruled prefix.
below you can see each router takes its direct route to a Transit,
relevant
filters and show route all below.
Any idea on how you want to do that?
detail info:
router1:
bird> show route 91.189.88.0/21
91.189.88.0/21 via <Transit1_BGPRTR_1> on eth5 [Transit1_BGPRTR_1
2010-06-09 10:30:31] * (300) [AS41231i]
via <iBGP_router2_gw1> on eth0 [iBGP_router1_1
2010-06-09 11:22:55] (100) [AS41231i]
via <iBGP_router2_gw2> on eth1 [iBGP_router1_2
2010-06-09 11:22:55] (100) [AS41231i]
via <Transit1_BGPRTR_2> on eth5 [Transit1_BGPRTR_2
2010-06-09 10:30:34] (300) [AS41231i]
router2:
bird> show route 91.189.88.0/21
91.189.88.0/21 via <Transit2_BGPRTR_1> on eth5 [Transit2_BGPRTR_1
2010-06-09 11:22:06] * (400) [AS41231i]
via <iBGP_router1_gw1> on eth1 [iBGP_router1_1
2010-06-09 10:29:43] (100) [AS41231i]
via <Transit3_BGPRTR_1> on opn-ext.382
[Transit3_BGPRTR_1 2010-06-09 11:19:12] (100) [AS41231i]
via <iBGP_router1_1> on opn-ext.382
[Transit3_BGPRTR_2 2010-06-09 11:14:03] (100) [AS41231i]
via <iBGP_router1_gw2> on eth0 [iBGP_router1_2
2010-06-09 10:29:43] (100) [AS41231i]
bgp input filter, applied for eBGP
router1:
function bgp_in(int peeras)
{
<snip>
# Traffic engineering:
# launchpad.net
if (net = 91.189.88.0/21 && bgp_path.first = Transit1AS ) then
preference=300;
# end Traffic engineering
return true;
}
router2:
function bgp_in(int peeras)
{
<snip>
# Traffic engineering:
# ppa.launchpad.net
if (net = 91.189.88.0/21 && bgp_path.first = Transit2AS ) then
preference=400;
# end Traffic engineering
return true;
}
router1:
bird> show route 91.189.88.0/21 all
91.189.88.0/21 via <Transit1_BGPRTR_1> on eth5 [Transit1_BGPRTR_1
2010-06-09 10:30:30] * (300) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
via <iBGP_router2_gw1> on eth0 [iBGP_router1_1
2010-06-09 11:22:54] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044)
(16265,65400)
via <iBGP_router2_gw2> on eth1 [iBGP_router1_2
2010-06-09 11:22:54] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044)
(16265,65400)
via <Transit1_BGPRTR_2> on eth5 [Transit1_BGPRTR_2
2010-06-09 10:30:33] (300) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_2>
BGP.med: 100
BGP.local_pref: 100
bird>
router2:
bird> show route 91.189.88.0/21 all
91.189.88.0/21 via <Transit2_BGPRTR_1> on eth5 [Transit2_BGPRTR_1
2010-06-09 11:22:07] * (400) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044)
(16265,65400)
via <iBGP_router1_gw1> on eth1 [iBGP_router1_1
2010-06-09 10:29:44] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
via <Transit3_BGPRTR_1> on opn-ext.382
[Transit3_BGPRTR_1 2010-06-09 11:19:13] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 20562 24785 286 6908 41231
BGP.next_hop: <Transit3_BGPRTR_1>
BGP.med: 0
BGP.local_pref: 100
via <iBGP_router1_1> on opn-ext.382
[Transit3_BGPRTR_2 2010-06-09 11:14:04] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 20562 24785 286 6908 41231
BGP.next_hop: <iBGP_router1_1>
BGP.med: 0
BGP.local_pref: 100
via <iBGP_router1_gw2> on eth0 [iBGP_router1_2
2010-06-09 10:29:44] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
bird>
Regards,
Arjan Filius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20100610/a9f3bb01/attachment.html>
-------------- next part --------------
Hello bird-users,
running bird 1.2.3 ppa x64 ubuntu 10.04LTS. 2 bird routers connected with 2 iBGP sessions over different links.
I'm trying to route specific outgoing traffic over a specific Transit.
It starts with that i'm not realy sure how to do it, so tested a bit. Setting Local perference
on protocol definition works just fine for a complete Transit, however when i want to do it more finegrained, i run into trouble.
First started with prepending routes in bgp input filter with my own AS, which works OK on a single bird router, however, with iBGP all prepended local AS-es are stripped, and that concept doesn't work.
Then, started to set the preference in the bgp input filter, which also works fine on a single bird router, but that preference seems not to propagate to the second iBGP router.
on router1 i set in the bgp input filter the preference to 300 for a specific network(91.189.88.0/21), and on router 2 the preference to 400.
What i would want, is that both iBGP routers agree on route for a specific manual
overruled prefix.
below you can see earch router takes its direct route to a Transit, relevant
filters and show route all below.
Any idea on how you want to do that?
detail info:
router1:
bird> show route 91.189.88.0/21
91.189.88.0/21 via <Transit1_BGPRTR_1> on eth5 [Transit1_BGPRTR_1 2010-06-09 10:30:31] * (300) [AS41231i]
via <iBGP_router2_gw1> on eth0 [iBGP_router1_1 2010-06-09 11:22:55] (100) [AS41231i]
via <iBGP_router2_gw2> on eth1 [iBGP_router1_2 2010-06-09 11:22:55] (100) [AS41231i]
via <Transit1_BGPRTR_2> on eth5 [Transit1_BGPRTR_2 2010-06-09 10:30:34] (300) [AS41231i]
router2:
bird> show route 91.189.88.0/21
91.189.88.0/21 via <Transit2_BGPRTR_1> on eth5 [Transit2_BGPRTR_1 2010-06-09 11:22:06] * (400) [AS41231i]
via <iBGP_router1_gw1> on eth1 [iBGP_router1_1 2010-06-09 10:29:43] (100) [AS41231i]
via <Transit3_BGPRTR_1> on opn-ext.382 [Transit3_BGPRTR_1 2010-06-09 11:19:12] (100) [AS41231i]
via <iBGP_router1_1> on opn-ext.382 [Transit3_BGPRTR_2 2010-06-09 11:14:03] (100) [AS41231i]
via <iBGP_router1_gw2> on eth0 [iBGP_router1_2 2010-06-09 10:29:43] (100) [AS41231i]
bgp input filter, applied for eBGP
router1:
function bgp_in(int peeras)
{
<snip>
# Traffic engineering:
# launchpad.net
if (net = 91.189.88.0/21 && bgp_path.first = Transit1AS ) then preference=300;
# end Traffic engineering
return true;
}
router2:
function bgp_in(int peeras)
{
<snip>
# Traffic engineering:
# ppa.launchpad.net
if (net = 91.189.88.0/21 && bgp_path.first = Transit2AS ) then preference=400;
# end Traffic engineering
return true;
}
router1:
bird> show route 91.189.88.0/21 all
91.189.88.0/21 via <Transit1_BGPRTR_1> on eth5 [Transit1_BGPRTR_1 2010-06-09 10:30:30] * (300) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
via <iBGP_router2_gw1> on eth0 [iBGP_router1_1 2010-06-09 11:22:54] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044) (16265,65400)
via <iBGP_router2_gw2> on eth1 [iBGP_router1_2 2010-06-09 11:22:54] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044) (16265,65400)
via <Transit1_BGPRTR_2> on eth5 [Transit1_BGPRTR_2 2010-06-09 10:30:33] (300) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_2>
BGP.med: 100
BGP.local_pref: 100
bird>
router2:
bird> show route 91.189.88.0/21 all
91.189.88.0/21 via <Transit2_BGPRTR_1> on eth5 [Transit2_BGPRTR_1 2010-06-09 11:22:07] * (400) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 38930 16265 286 6908 41231
BGP.next_hop: <Transit2_BGPRTR_1>
BGP.local_pref: 100
BGP.community: (286,19) (286,29) (286,49) (286,286) (286,3044) (16265,65400)
via <iBGP_router1_gw1> on eth1 [iBGP_router1_1 2010-06-09 10:29:44] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
via <Transit3_BGPRTR_1> on opn-ext.382 [Transit3_BGPRTR_1 2010-06-09 11:19:13] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 20562 24785 286 6908 41231
BGP.next_hop: <Transit3_BGPRTR_1>
BGP.med: 0
BGP.local_pref: 100
via <iBGP_router1_1> on opn-ext.382 [Transit3_BGPRTR_2 2010-06-09 11:14:04] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 20562 24785 286 6908 41231
BGP.next_hop: <iBGP_router1_1>
BGP.med: 0
BGP.local_pref: 100
via <iBGP_router1_gw2> on eth0 [iBGP_router1_2 2010-06-09 10:29:44] (100) [AS41231i]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 24785 286 6908 41231
BGP.next_hop: <Transit1_BGPRTR_1>
BGP.med: 100
BGP.local_pref: 100
bird>
Regards,
Arjan Filius
More information about the Bird-users
mailing list