FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.33k stars 1.25k forks source link

bgpd statistics for l2vpn evpn advertised prefixes always shows 0 #8162

Closed fdomain closed 3 years ago

fdomain commented 3 years ago

Describe the bug

I have a VXLAN/EVPN + VRF setup. I'm advertising several IPv4/IPv6 prefixes from my VRF that are redistributed over the l2vpn evpn afi/safi.

# show bgp l2vpn evpn summary 
BGP router identifier 192.168.153.65, local AS number 64528 vrf-id 0
BGP table version 0
RIB entries 3, using 576 bytes of memory
Peers 1, using 21 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.153.66  4      64529      6193      6197        0    0    0 05:09:34            0        4

Total number of neighbors 1

The above command output shows that we're sending 4 prefixes, however, statistics are always showing 0:

# show bgp l2vpn evpn statistics 
BGP L2VPN EVPN RIB statistics (VRF default)
Total Advertisements          :            0
Total Prefixes                :            0
Average prefix length         :         0.00
Unaggregateable prefixes      :            0
Maximum aggregateable prefixes:            0
BGP Aggregate advertisements  :            0
Address space advertised      :            0
                  % announced :         0.00
                /8 equivalent :         0.00
               /24 equivalent :         0.00

Advertisements with paths     :            0
Longest AS-Path (hops)        :            0
Average AS-Path length (hops) :         0.00
Largest AS-Path (bytes)       :            0
Average AS-Path size (bytes)  :         0.00
Highest public ASN            :            0

[x ] Did you check if this is a duplicate issue? [ ] Did you test it on the latest FRRouting/frr master branch? No but I didn't find anything related in commits since 7.5

To Reproduce

Establish a peering with the following configuration: host configuration create a netns "vrfa" with a Vxlan interface (vni 3) create a netns "vrfb" with a Vxlan interface (vni 4) daemons.conf

vtysh_enable=yes

bgpd=yes
bgpd_options="-A 127.0.0.1 -P 2605 "
zebra=yes
zebra_options="-A 127.0.0.1 -s 90000000 --vrfwnetns"
staticd=yes
staticd_options="-A 127.0.0.1"

frr.conf

frr version 7.5
frr defaults datacenter
hostname router
!
vrf vrfa
 netns /run/netns/vrfa
 vni 3
 exit-vrf
!
vrf vrfb
 netns /run/netns/vrfb
 vni 4
 exit-vrf
!
router bgp 64528
 bgp router-id 192.168.153.65
 no bgp default ipv4-unicast
 no bgp network import-check
 neighbor PG-IPV4 peer-group
 neighbor PG-IPV4 remote-as 64529
 neighbor 192.168.153.66 peer-group PG-IPV4
 !
 address-family l2vpn evpn
  neighbor PG-IPV4 activate
  advertise-all-vni
 exit-address-family
!
router bgp 64528 vrf vrfa
 bgp router-id 192.168.153.65
 no bgp network import-check
 !
 address-family ipv4 unicast
  network 10.1.2.0/32
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8::/128
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
!
router bgp 64528 vrf vrfb
 bgp router-id 192.168.153.65
 no bgp network import-check
 !
 address-family ipv4 unicast
  network 10.1.3.0/32
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8:0:1::/128
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
!
ip nht resolve-via-default
!
line vty
 no login
!
end

Prefixes are advertised

sudo vtysh -c "show bgp l2vpn evpn neighbors 192.168.153.66 advertised-routes json" | jq .totalPrefixCounter
4

Statistics are still showing 0

sudo vtysh -c "show bgp l2vpn evpn statistics json" | jq .l2VpnEvpn[0].totalAdvertisements
0

Expected behavior

sudo vtysh -c "show bgp l2vpn evpn statistics json" | jq .l2VpnEvpn[0].totalAdvertisements
4

Screenshots

Versions

Additional context

taspelund commented 3 years ago

I have a fix for this in https://github.com/FRRouting/frr/pull/8199