Static route bgp_next_hop attribute.
Hi all! I'm trying to use Bird to announce route with predefined bgp next hop and to avoid filter manipulation on this route to set next-hop on it. My goal is to put route configuration into separate include file with fewer lines as possible. Relevant part of my config is as follows: protocol bgp 'test_nbr' { local as 65001; neighbor 10.0.0.2 as 65002; hold time 30; multihop 5; import all; export all; next hop keep; } protocol static test { route 192.168.0.1/32 blackhole { bgp_next_hop = 172.16.0.1; }; } I can see that route has bgp_next_hop attribute with command "show route all": bird> show route all 192.168.0.1/32 blackhole [test 07:05:07] * (200) Type: static unicast univ BGP.next_hop: 172.16.0.1 But when neighbor receives this announce, it still gets the peer address as a next-hop. This is debug output at neighbor side: *May 29 14:05:02.327: BGP(0): 10.0.0.1 rcvd UPDATE w/ attr: nexthop 10.0.0.1, origin i, merged path 65001, AS_PATH *May 29 14:05:02.331: BGP(0): 10.0.0.1 rcvd 192.168.0.1/32 So, the question is: is there any way to keep bgp_next_hop attribute from static route into protocol bgp announces? -- Regards, Sergey
On Tue, May 29, 2018 at 02:23:30PM +0300, oldnick nsp wrote:
Hi all!
I'm trying to use Bird to announce route with predefined bgp next hop and to avoid filter manipulation on this route to set next-hop on it. My goal is to put route configuration into separate include file with fewer lines as possible.
Hi In BIRD 1.x, default BGP route attributes were preinitialized for non-BGP routes before BGP export filter was called, so the value set in static protocol is ignored. You have to set bgp_next_hop attribute in the BGP export filter. In BIRD 2.x, the behavior was simplified to work as one expects - bgp_next_hop can be set anywhere and then it is handled similarly to one received from BGP peer (so it would work with 'next hop keep'). -- 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."
Thank you Ondrej, it really works in BIRD 2.x. On Tue, May 29, 2018 at 3:22 PM, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Tue, May 29, 2018 at 02:23:30PM +0300, oldnick nsp wrote:
Hi all!
I'm trying to use Bird to announce route with predefined bgp next hop and to avoid filter manipulation on this route to set next-hop on it. My goal is to put route configuration into separate include file with fewer lines as possible.
Hi
In BIRD 1.x, default BGP route attributes were preinitialized for non-BGP routes before BGP export filter was called, so the value set in static protocol is ignored. You have to set bgp_next_hop attribute in the BGP export filter.
In BIRD 2.x, the behavior was simplified to work as one expects - bgp_next_hop can be set anywhere and then it is handled similarly to one received from BGP peer (so it would work with 'next hop keep').
-- 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."
-- Regards, Sergey
participants (2)
-
oldnick nsp -
Ondrej Zajicek