Multihop BGP cannot use direct gateway mode - misidentification of multihop sessions?
Sergey Popovich
popovich_sergei at mail.ru
Wed Aug 13 09:52:49 CEST 2014
В письме от 12 августа 2014 20:27:17 пользователь Alex Bligh написал:
> Any ideas on the below?
>
> Alex
>
> On 8 Aug 2014, at 20:05, Alex Bligh <alex at alex.org.uk> wrote:
> > When I start bird using 1.4.0-1 (Ubuntu Trusty) I see the error:
> >
> > warnings.log:Aug 8 13:47:03 node-10-157-128-41 bird: /etc/bird/bird.conf,
> > line 62: Multihop BGP cannot use direct gateway mode
Things get changed with
commit f3e59178506dab9d54cf19ec701f8d9a7fe283f9
Author: Ondrej Zajicek <>
Date: Sun Nov 24 12:37:24 2013 +0100
Enables multihop mode for IBGP by default.
Now multihop enabled by default for iBGP sessions (which is your case), but
can not be turned off with gateway direct so parse error is returned.
> >
> > This error did not occur on 1.3.4-1 with the same config on Ubuntu
> > Precise.
> >
> > The config I am using is pasted below, as is the output of 'ip addr show'.
> >
> > Line 62 of the config is the closing bracket of a BGP protocol definition.
> > The neighbour statement is on line 29: neighbor 10.157.192.1 as 65000
> >
> > You will note that interface evrr-000000 has IP address 10.157.192.41/20,
> > and the peer is IP address 10.157.192.1. This should thus not be a
> > multihop session. The output of 'ip route show' (also below) confirms
> > this.
> >
> > It is an iBGP session (in that both ends have the same address) but I am
> > deliberately hoping to use gateway direct, i.e. want to put the
> > advertised next hop straight into the RIB without doing a recursive
> > lookup. Specifically if something else on the same /20 gets advertised as
> > a next hop, I still want to send the traffic to the advertising router.>
You can use following filter code as workaround scenario in your import filter
of bgp protocol(s) configuration to be sure that nh is from allowed
10.157.192.0/20:
if !(bgp_next_hop ~ 10.157.192.0/20) then
bgp_next_hop = from;
If bgp_next_hop attribute points to IP not within allowed subnet, use
neighbour (from) IP address as bgp_next_hop.
> > The documentation says:
> >> For received routes, their gw (immediate next hop) attribute is computed
> >> from received bgp_next_hopattribute. This option specifies how it is
> >> computed. Direct mode means that the IP address frombgp_next_hop is used
> >> if it is directly reachable, otherwise the neighbor IP address is used.
> >> Recursive mode means that the gateway is computed by an IGP routing
> >> table lookup for the IP address from bgp_next_hop. Recursive mode is the
> >> behavior specified by the BGP standard. Direct mode is simpler, does not
> >> require any routes in a routing table, and was used in older versions of
> >> BIRD, but does not handle well nontrivial iBGP setups and multihop.
> >> Recursive mode is incompatible with sorted tables. Default: direct for
> >> direct sessions, recursive for multihop sessions.>
> > From this, gateway direct should be the default for a direct session in
> > any case. It would appear to me that bird is somehow misidentifying the
> > session as a multihop session.
BIRD by default uses multihop for iBGP sessions since commit f3e59178506dab.
More information about the Bird-users
mailing list