bgp local preference from static protocol
Hello, trying to preset local preference for originated route on static protocol like this protocol static mynetwork { import all; route 10.1.1.0/24 reject { bgp_local_pref = 200; }; } on BGP peer configuration i'm using following export filter export filter { if proto = "mynetwork" then { accept; } reject; }; in routing table everything seems fine, bgp.local_pref from static protocol is set bird> show route all for 10.1.1.0/24 10.1.1.0/24 unreachable [mynetwork 11:13:34] * (200) Type: static unicast univ BGP.local_pref: 200 but on exported route BGP.local_pref is 100 bird> show route all export peer2 10.1.1.0/24 unreachable [mynetwork 11:13:34] * (200) Type: static unicast univ BGP.origin: IGP BGP.as_path: 65001 BGP.local_pref: 100 ---- if i set local preference on bgp peer export filter, like this - it is OK if proto = "mynetwork" then { if net = 10.1.1.0/24 then bgp_local_pref = 200; accept; } reject; }; bird> show route all export peer2 10.1.1.0/24 unreachable [mynetwork 11:13:34] * (200) Type: static unicast univ BGP.origin: IGP BGP.as_path: 65001 BGP.local_pref: 200 my question is, is there any way to use bgp_local_pref from static protocol when originate routes, without touching neighbor export filter? Thanks in advance
On Thu, Apr 19, 2018 at 11:20:29AM +0300, Milen Bogunski wrote:
Hello,
trying to preset local preference for originated route on static protocol like this
protocol static mynetwork { import all; route 10.1.1.0/24 reject { bgp_local_pref = 200; };
} ... in routing table everything seems fine, bgp.local_pref from static protocol is set
bird> show route all for 10.1.1.0/24 10.1.1.0/24 unreachable [mynetwork 11:13:34] * (200) Type: static unicast univ BGP.local_pref: 200
but on exported route BGP.local_pref is 100 ...
my question is, is there any way to use bgp_local_pref from static protocol when originate routes, without touching neighbor export filter?
Hello In BIRD 1.6 when a non-BGP route is exported to BGP, core BGP attributes (like bgp_local_pref, bgp_path and some others) are initialized regardless of their previous value. So if you want to sed bgp_local_pref, you have to do it BGP export filter. Or switch to BIRD 2.0, where this behavior was changed and and only undefined attributes are initialized when route is exported to BGP. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Milen Bogunski -
Ondrej Zajicek