[quagga-users 9446] bgpd picks wrong nexthop on point-to-point interfaces?

John Morrissey jwm at horde.net
Mon Mar 17 10:43:13 GMT 2008


I'm running IBGP over a GRE tunnel:

[jwm at boost:pts/5 ~> ifconfig gre1
gre1      Link encap:UNSPEC  HWaddr AC-10-41-02-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:172.17.65.2  P-t-P:172.17.65.1  Mask:255.255.255.255

zebra gets the endpoints right:

boost# sh int gre1
Interface gre1 is up, line protocol detection is disabled
  index 18 metric 1 mtu 1476 
  flags: <UP,POINTOPOINT,RUNNING,NOARP>
  HWaddr: ac:10:41:02
  inet 172.17.65.2/32 pointopoint 172.17.65.1
    374 input packets (0 multicast), 30117 bytes, 0 dropped
    0 input errors, 0 length, 0 overrun, 0 CRC, 0 frame
    0 fifo, 0 missed
    544 output packets, 47274 bytes, 0 dropped
    3 output errors, 0 aborted, 3 carrier, 0 fifo, 0 heartbeat
    0 window, 0 collisions

as does bgpd, but it detects the wrong end of the tunnel as the nexthop
(i.e., it sees itself as the only legitimate nexthop instead of the opposite
end of the tunnel):

boost# sh ip bgp nei
[...]
Local host: 172.17.65.2, Local port: 36205
Foreign host: 172.17.65.1, Foreign port: 179
Nexthop: 172.17.65.2

Since I have 'set nexthop self' in the peer (OpenBSD bgpd(8)), quagga bgpd
rejects all of its announcements:

172.17.65.1 rcvd UPDATE about 192.168.197.16/28 -- DENIED due to: martian next-hop;

If I remove the bgp_nexthop_self() check:

--- quagga-0.99.5.orig/bgpd/bgp_route.c
+++ quagga-0.99.5/bgpd/bgp_route.c
@@ -1934,8 +1934,7 @@
 
       /* Next hop must not be 0.0.0.0 nor Class E address.  Next hop
         must not be my own address.  */
-      if (bgp_nexthop_self (afi, &new_attr)
-         || new_attr.nexthop.s_addr == 0
+      if (new_attr.nexthop.s_addr == 0
          || ntohl (new_attr.nexthop.s_addr) >= 0xe0000000)
        {
          reason = "martian next-hop;";

the announcements are accepted and have the correct next hop:

[jwm at boost:pts/5 ~> netstat -rn
[...]
192.168.197.16  172.17.65.1     255.255.255.240 UG        0 0          0 gre1


Shouldn't BGP neighbor output be showing the opposite end of the GRE tunnel
as the next hop, not itself?

john
-- 
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__


More information about the Quagga-users mailing list