osrg / gobgp

BGP implemented in the Go Programming Language
https://osrg.github.io/gobgp/
Apache License 2.0
3.65k stars 696 forks source link

gobgp not sending ZEBRA_ROUTE_ADD command for IPv6? #2552

Open kbknapp opened 2 years ago

kbknapp commented 2 years ago

First, thank you for this tool, it's great! (Side note, I'm especially looking forward to how the rustybgp server comes along! 😄)

While experimenting with a simple BGP setup, we noticed that one nodes where we have FRR (v8.1) installed, only IPv4 routes are being added to the kernel routing table, not IPv6.

Upon sniffing the /var/run/frr/zserv.api socket, we see that gobgpd sends the correct ZEBRA_ROUTE_{ADD,DEL} for IPv4, but doesn't send anything at all for IPv6; it's totally silent.

Am I holding this wrong, or could this be a bug? A super minimal configuration that allowed me to reproduce was this:

Node A (FRR and gobgp, host IPv4: 172.16.0.5, host IPv6: fd42:367a::a1, AS: 64512):

[global.config]
  as = 64512
  router-id = "172.16.0.5"

[[neighbors]]
  [neighbors.config]
    neighbor-address = "172.16.1.5"
    peer-as = 65001

[zebra]
    [zebra.config]
        enabled = true
        url = "unix:/var/run/frr/zserv.api"
        redistribute-route-type-list = ["connect"]
        version = 6

And then on Node B (gobgp, host IPv4: 172.16.1.5, host IPv6: fd42:367a::b1, AS: 65001), this node advertises the routes:

[global.config]
  as = 65001
  router-id = "172.16.1.5"

[[neighbors]]
  [neighbors.config]
    neighbor-address = "172.16.0.5"
    peer-as = 64512

On Node B advertise two routes; both will show up on Node A, but only the IPv4 will show up in the kernel routing table (Note the Node before the command):

B$ gobgp global rib add 192.168.255.254/32 -a ipv4
B$ gobgp global rib add fdfd:1234::2/128 -a ipv6

  ... Then on A ...

A$ gobgp global rib -a ipv4
   Network              Next Hop             AS_PATH              Age        Attrs
*> 172.16.0.0/16        0.0.0.0                                   2d 01:15:58 [{Origin: i} {Med: 100}]
*> 192.168.255.254/32   172.16.1.5         65001                00:00:04   [{Origin: ?} {Med: 100}]

A$ gobgp global rib -a ipv6
   Network              Next Hop             AS_PATH              Age        Attrs
*> fd42:367a::a1/128    ::                                        00:05:11   [{Origin: i} {Med: 0}]
*> fdfd:1234::1/128      fd42:367a::b1    65001       00:05:11   [{Origin: ?} {Med: 0}]

A$ ip -4 route | grep 192
192.168.255.254 nhid 12 via 172.16.1.5 dev enp5s0 proto bgp metric 20

A$ ip -6 route | grep fdfd
renyunkang commented 3 days ago

Any updates? cc @fujita