osrg / gobgp

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

evpn IP Prefix Route advertisement has wrong gateway ip #1919

Closed chenghit closed 5 years ago

chenghit commented 5 years ago

version 1.33

chengc2@ubuntu:~/go/bin$ gobgp global rib -a evpn del macadv 000c.0005.0001 172.16.5.10 origin igp esi 0 etag 0 label 50500,50999 rd 50500:1 rt 50500:1 50999:1 encap vxlan router-mac 00:0c:29:44:18:6e
chengc2@ubuntu:~/go/bin$ chengc2@ubuntu:~/go/bin$ chengc2@ubuntu:~/go/bin$ gobgp neighbor 10.0.0.1 adj-out -a evpn
ID Network Labels Next Hop AS_PATH Attrs 1 [type:Prefix][rd:50200:1][etag:0][prefix:0.0.0.0/0] [50999] 10.15.0.5 [{Origin: ?} {LocalPref: 100} {Extcomms: [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]] 1 [type:Prefix][rd:50300:1][etag:0][prefix:0.0.0.0/0] [50999] 10.15.0.5 [{Origin: ?} {LocalPref: 100} {Extcomms: [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]] 1 [type:Prefix][rd:50500:1][etag:0][prefix:0.0.0.0/0] [50999] 10.15.0.5 [{Origin: ?} {LocalPref: 100} {Extcomms: [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]] 1 [type:macadv][rd:50200:1][etag:0][mac:00:0c:00:05:00:01][ip:172.16.5.10] [50200,50999] 10.15.0.5 [{Origin: i} {LocalPref: 100} {Extcomms: [50200:1], [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]] 1 [type:macadv][rd:50300:1][etag:0][mac:00:0c:00:05:00:01][ip:172.16.5.10] [50300,50999] 10.15.0.5 [{Origin: i} {LocalPref: 100} {Extcomms: [50300:1], [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]] 1 [type:macadv][rd:50500:1][etag:0][mac:00:0c:00:05:00:01][ip:172.16.5.10] [50500,50999] 10.15.0.5 [{Origin: i} {LocalPref: 100} {Extcomms: [50500:1], [50999:1], [VXLAN], [router's mac: 00:0c:29:44:18:6e]} [ESI: single-homed]]

It seems like gobgp has advertise correct next-hop to the neighbor, but I find that GW IP is 0.0.0.0 in capture file. The .conf and pcap file have beed attached, please check. gobgp testing type5.zip

chenghit commented 5 years ago

snipaste_2018-12-23_17-04-21

chenghit commented 5 years ago

Sorry, I posted the wrong command. Actually, I used below command to advertised IP prefix route update:

chengc2@ubuntu:~/go/bin$ gobgp global rib -a evpn add prefix 0.0.0.0/0 gw 172.16.5.10 origin igp esi 0 etag 0 label 50999 rd 50999:1 rt 50999:1 encap vxlan router-mac 00:0c:29:44:18:6e

chenghit commented 5 years ago

I built another test environment that all vtep and dci border are cisco nxosv switches. Normally, the border will send two type-5 routes to l3-vni: one carries destination ip prefix and the other one carries next-hop edge router's ip address.

snipaste_2018-12-25_13-35-27

There is no need to use an IP address as an overlay next hop to interconnect Layer 3 virtual routing and forwarding (VRF) routes sitting in different data centers. Because no type-2 routes are used for route recursive resolution, this provisioning model is also called the IP-VRF-to-IP-VRF model without a core-facing IRB interface.

https://www.juniper.net/documentation/en_US/junos/topics/concept/evpn-route-type5-understanding.html

So gobgp worked fine. I will close this issue.