sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
735 stars 1.41k forks source link

[EVPN VXLAN] Only one vni to vlan map entry in the output of show vxlan tunnel command #11902

Closed dellwuchuan closed 2 years ago

dellwuchuan commented 2 years ago

Description

When there are many vlan to vni mapping entries, there are only one founded in the output of show vxlan tunnel command.

Steps to reproduce the issue:

  1. Configure vxlan at dut

sudo config vxlan add vtep101032 10.1.0.32 sudo config vxlan evpn_nvo add my-nvo vtep101032 sudo config vxlan map add vtep101032 100 500100 sudo config vxlan map add vtep101032 101 500101

  1. Configure vxlan at HA

    brctl addbr br_500100 brctl addif br_500100 vtep_500100 brctl stp br_500100 off sudo ip link set vtep_500100 up sudo ip link set br_500100 up sudo ip addr add 100.0.0.3/24 dev br_500100 sudo ip addr add 100::3/24 dev br_500100 brctl addbr br_500101 brctl addif br_500101 vtep_500101 brctl stp br_500101 off sudo ip link set vtep_500101 up sudo ip link set br_500101 up sudo ip addr add 101.0.0.2/24 dev br_500101 sudo ip addr add 101::2/64 dev br_500101

  2. Configure IBGP at DUT and HA

! router bgp 65000 bgp router-id 10.1.0.32 neighbor 30.0.0.2 remote-as 65000 neighbor 40.0.0.3 remote-as 65000 ! address-family ipv4 unicast network 10.1.0.32/32 exit-address-family ! address-family l2vpn evpn neighbor 30.0.0.2 activate neighbor 40.0.0.3 activate advertise-all-vni advertise-svi-ip vni 500100 rd 10.1.0.32:100 exit-vni vni 500101 rd 10.1.0.32:101 exit-vni exit-address-family !

! router bgp 65000 bgp router-id 40.0.0.3 neighbor 40.0.0.1 remote-as 65000 ! address-family l2vpn evpn neighbor 40.0.0.1 activate advertise-all-vni advertise-svi-ip vni 500100 rd 40.0.0.3:100 exit-vni exit-address-family !

  1. Check the vni vlan map relationship

show vxlan vlanvnimap +----------+---------+ | VLAN | VNI | +==========+=========+ | Vlan100 | 500100 | +----------+---------+ | Vlan101 | 500101 | +----------+---------+ Total count : 2

  1. Check the vxlan tunnel by command "show vxlan tunnel", there is only one entry in the vni to vlan map part:

show vxlan tunnel vxlan tunnel name source ip destination ip tunnel map name tunnel map mapping(vni -> vlan)


vtep101032 10.1.0.32 map_500100_Vlan100 500100 -> Vlan100

Describe the results you received:

Only one vlan-vni map entry - map_500100_Vlan100 500100 -> Vlan100

Describe the results you expected:

It should list all the vlan vni mapping entries

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

There is the analysis result of developer:

The issue is due to the show command parsing code getting only the first vxlan map key and including it in the show command.

    vxlan_map_keys = config_db.keys(config_db.CONFIG_DB,
                                    'VXLAN_TUNNEL_MAP{}{}{}*'.format(config_db.KEY_SEPARATOR, vxlan_name, config_db.KEY_SEPARATOR))
    if vxlan_map_keys:
        vxlan_map_mapping = config_db.get_all(config_db.CONFIG_DB, vxlan_map_keys[0])
        r.append(vxlan_map_keys[0].split(config_db.KEY_SEPARATOR, 2)[2])
        r.append("{} -> {}".format(vxlan_map_mapping.get('vni'), vxlan_map_mapping.get('vlan')))
    table.append(r)
zhangyanzhao commented 2 years ago

BRCM will help to take a look. Thanks @adyeung

skbhava commented 2 years ago

Will work for the solution and create PR for review. ETA 09/19.

adyeung commented 2 years ago

Fix posted to https://github.com/sonic-net/sonic-utilities/pull/2391

adyeung commented 2 years ago

resolved by https://github.com/sonic-net/sonic-utilities/pull/2391