Skip to content
Ask AI

VxLAN and BGP-EVPN

Table 1 VXLAN and BGP-EVPN View

CommandPurpose
show vxlan mapDisplay VXLAN mapping.
show vxlan tunnelDisplay VXLAN tunnels.
show vxlan statistics vxlan_interface_name peer peer-ip vni vni-idDisplay VXLAN statistic.
clear vxlan static vxlan_interface_name peer peer-ip vni vni-idClear VXLAN statistic.
show vxlan remotemac {all|A.B.C.D}Display VXLAN remote MAC entries.

[Command] show vxlan map

[Purpose] Display VXLAN mapping.

[View] Privileged User View

[Use Cases]

sonic# show vxlan map
+-------+--------+-------+
| vni | vlan | vrf |
+=======+========+=======+
| 100 | 10 | |
+-------+--------+-------+
| 200 | 20 | |
+-------+--------+-------+
| 1000 | | 123 |
+-------+--------+-------+

[Command] show vxlan tunnel

[Purpose] Display VXLAN tunnels.

[View] Privileged User View

[Use Cases]

sonic# show vxlan tunnel

[Command] show vxlan statistics vxlan_interface_name peer peer-ip vni vni-id

[Purpose] Display VXLAN statistic.

[Parameters]

ParameterDescription
vxlan_interface_nameVXLAN interface name.
peer-ipRemote VTEP IP.
vni-idVXLAN Network Identifier, VNI.

[View] Privileged User View

[Notes] CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 is not supported yet.

[Use Cases]

sonic# show vxlan statistics 0 peer 10.1.0.207 vni 100

[Command] clear vxlan statistics vxlan_interface_name peer peer-ip vni vni-id

[Purpose] Clear VXLAN statistic.

[Parameters]

ParameterDescription
vxlan_interface_nameVXLAN interface name.
peer-ipRemote VTEP IP.
vni-idVXLAN Network Identifier, VNI.

[View] Privileged User View

[Notes] CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 is not supported yet.

[Use Cases]

sonic# clear vxlan statistics 0 peer 10.1.0.207 vni 100

[Command] show vxlan remotemac {all|A.B.C.D}

[Purpose] Display VXLAN remote MAC entries.

[Parameters]

ParameterDescription
A.B.C.DIPv4 address

[View] Privileged User View

[Use Cases]

sonic# show vxlan remotemac all
+--------+-------------------+--------------+-------+---------+
| VLAN | MAC | RemoteVTEP | VNI | Type |
+========+===================+==============+=======+=========+
| Vlan17 | 60:eb:5a:00:d4:22 | 10.1.0.236 | 17 | dynamic |
+--------+-------------------+--------------+-------+---------+
| Vlan18 | 60:eb:5a:00:d4:22 | 10.1.0.236 | 18 | dynamic |
+--------+-------------------+--------------+-------+---------+
Total count : 2
sonic# show vxlan remotemac 10.1.0.236
+--------+-------------------+--------------+-------+---------+
| VLAN | MAC | RemoteVTEP | VNI | Type |
+========+===================+==============+=======+=========+
| Vlan17 | 60:eb:5a:00:d4:22 | 10.1.0.236 | 17 | dynamic |
+--------+-------------------+--------------+-------+---------+
| Vlan18 | 60:eb:5a:00:d4:22 | 10.1.0.236 | 18 | dynamic |
+--------+-------------------+--------------+-------+---------+
Total count : 2

Table 2 VXLAN and BGP-EVPN Config

CommandPurpose
interface vxlan vxlan_interface_nameConfigure VXLAN interface.
mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id vxlanvni vni-id peer peer-ipConfigure static MAC entry for VXLAN.
source ip-addressSet local VTEP IP of VXLAN.
vni vni-id [vxlan vxlan_interface_name]Add VXLAN mapping.
ip route A.B.C.D/M A.B.C.D vxlan-vni vni-idConfigure static routes for VXLAN.
address-family l2vpn evpnEnter L2VPN EVPN Address-family View
neighbor A.B.C.D activateEnable EVPN of BGP neighbors.
advertise-all-vniEnable advertisement of all VNIs.
advertise ipv4 unicastEnable type-5 route advertisement.
table-map map_nameAdd a route leak policy.
import vrf vrf_nameSpecify the VRF of route leak.
vxlan statistics peer peer-ip vni vni-id enableConfigure EVPN Layer 3 tunnel traffic statistics.
vxlan mode centralizedEnable VXLAN centralized gateway.
vxlan udp-port port-numberSpecify the UDP destination port number used for VXLAN encapsulation.
rd rd-numConfigure the RD for Layer 2 VNI.
route-target {both|import|export} rt-numConfigure the RT for Layer 2 VNI.
rd rd-numConfigure the RD for Layer 3 VNI.
route-target {both|import|export} rt-numConfigure the RT for Layer 3 VNI.

[Command] interface vxlan vxlan_interface_name

[Purpose] Configure VXLAN interface.

[Parameters]

ParameterDescription
vxlan_interface_nameVXLAN interface name, The value range is 0-9 on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, and 0 on other models.

[View] Global Configuration View

[Notes] Run command no interface vxlan vxlan_interface_name to delete VXLAN interface.

[Use Cases]

sonic# configure terminal
sonic(config)# interface vxlan 0

[Command] mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id vxlan vni vni-id peer peer-ip

[Purpose] Configure static MAC entry for VXLAN.

[Parameters]

ParameterDescription
HH:HH:HH:HH:HH:HHMAC address.
vlan-idVLAN ID, the range is [1,4094].
vni-idVXLAN Network Identifier, VNI.
peer-ipRemote VTEP IP.

[View] Global Configuration View

[Notes] Run command no mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id to delete VXLAN static MAC entry.

[Use Cases]

sonic# configure terminal
sonic(config)# mac-address static 18:17:25:37:65:0a vlan 100 vxlan vni 10 peer 20.0.0.2

[Command] source ip-address

[Purpose] Set local VTEP IP of VXLAN.

[Parameters]

ParameterDescription
ip-addressLocal VTEP IP address.

[View] VXLAN Interface Configuration View

[Notes] Run command no source to delete VXLAN local_vtep_ip

[Use Cases]

sonic# configure terminal
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# source 10.0.0.1

[Command] vni vni-id [vxlan vxlan_interface_name]

[Purpose] Add VXLAN mapping.

[Parameters]

ParameterDescription
vni-idVXLAN Network Identifier, VNI.
vxlan_interface_nameVXLAN interface name. The value range is 0-9 on CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2, and 0 on other models. Default value is 0 when not specified.

[View] Global Configuration View / VLAN Configuration View / VRF Configuration View

[Notes] Run command no vni vni-id to delete VXLAN mapping.

[Use Cases]

sonic# configure terminal
sonic(config)# vni 1
sonic(config)# vlan 100
sonic(config-vlan-100)# vni 2
sonic(config)# vrf 123
sonic(config-vrf)# vni 1000

[Command] ip route A.B.C.D/M A.B.C.D vxlan-vni vni-id

[Purpose] Configure static routes for VXLAN.

[Parameters]

ParameterDescription
A.B.C.D/MSpecify the destination network segment for routing.
A.B.C.DSpecify the IP address of next hop of the route.
vni-idVXLAN Network Identifier, VNI.

[View] VRF Configuration View

[Notes] Run command no ip route A.B.C.D/M A.B.C.D vxlan-vni vni-id to delete static routes for VXLAN.

[Use Cases]

sonic# configure terminal
sonic(config)# ip route 20.0.0.0/24 10.0.0.57 vxlan-vni 200

[Command] address-family l2vpn evpn

[Purpose] Enter L2VPN EVPN Address-family View

[View] BGP Configuration View

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family l2vpn evpn

[Command] neighbor A.B.C.D activate

[Purpose] Enable EVPN of BGP neighbors.

[Parameters]

ParameterDescription
A.B.C.DBGP neighbor IPv4 address

[View] BGP EVPN Address-family View

[Notes] Run command no neighbor A.B.C.D activate to disable EVPN of BGP neighbors.

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# neighbor 68.0.0.1 activate

[Command] advertise-all-vni

[Purpose] Enable advertisement of all VNIs.

[View] BGP EVPN Address-family View

[Notes] Run command no advertise-all-vni to disable advertisement of all VNIs.

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# advertise-all-vni

[Command] advertise ipv4 unicast

[Purpose] Enable type-5 route advertisement.

[View] BGP EVPN Address-family View

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# advertise ipv4 unicast

[Command] table-map map_name

[Purpose] Add a route leak policy.

[Parameters]

ParameterDescription
map_nameRoute Map name.

[View] BGP IPv4 unicast Address-family View

[Notes] Run command no table-map map_name to delete the route leak policy.

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# table-map RM_ROUTE_LEAK_2000

[Command] import vrf vrf_name

[Purpose] Specify the VRF of route leak.

[Parameters]

ParameterDescription
vrf_nameSpecify the VRF name, the default VRF is default.

[View] BGP IPv4 unicast Address-family View

[Notes] Run command no import vrf vrf_name to delete the VRF of route leak.

[Use Cases]

sonic# config
sonic(config)# router bgp 65227
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# import vrf 200

[Command] vxlan statistics peer peer-ip vni vni-id enable

[Purpose] Configure EVPN Layer 3 tunnel traffic statistics.

[Parameters]

ParameterDescription
peer-ipRemote VTEP IP.
vni-idVXLAN Network Identifier, VNI.

[View] VXLAN Interface Configuration View

[Notes] CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 is not supported yet. Run command no vxlan statistics peer peer-ip vni vni-id enable to delete EVPN tunnel traffic statistics configuration.

[Use Cases]

sonic# config
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# vxlan statistics peer 10.1.0.226 vni 1000 enable

[Command] vxlan mode centralized

[Purpose] Enable VXLAN centralized gateway.

[View] Global Configuration View

[Notes] Run command no vxlan mode centralized to disable VXLAN centralized gateway.

[Use Cases]

sonic# config
sonic(config)# vxlan mode centralized

[Command] vxlan udp-port port-number

[Purpose] Specify the UDP destination port number used for VXLAN encapsulation.

[Parameters]

ParameterDescription
port-numberRange from 1 to 65535, and the default value is 4789.

[View] Global Configuration View

[Notes] This configuration requires that it be saved and then reload the device to take effect. Run command no vxlan udp-port command to restore the UDP destination port number used for VXLAN to the default value..

[Use Cases]

sonic# config
sonic(config)# vxlan udp-port 7788

[Command] rd rd-num

[Purpose] Configure the RD for Layer 2 VNI.

[Parameters]

ParameterDescription
rd-numThe format is A.B.C.D:MN| ASN:XX.

[View] Layer 2 VNI view under BGP EVPN address-family.

[Notes] RD storage takes up 6 bytes in three formats: 2-byte ASN with 4-byte custom integer value; 4-byte IP with 2-byte custom integer value; and 4-byte ASN with 2-byte custom integer value. Run command **no rd ** [rd-num] command to delete the RD configuration.

[Use Cases]

sonic# config
sonic(config)# router bgp 65100
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# vni 26
sonic(config-router-af-vni)# rd 11:22

[Command] route-target {both|import|export} rt-num

[Purpose] Configure the RT for Layer 2 VNI.

[Parameters]

ParameterDescription
both|import|exportDecide the direction in which RT takes effect.
rt-numThe format is A.B.C.D:MN|EF:OPQR|GHJK:MN.

[View] Layer 2 VNI view under BGP EVPN address-family.

[Notes] Run command no route-target {**both ** [rt-num]| import rt-num | export rt-num } command to delete the RT configuration.

[Use Cases]

sonic# config
sonic(config)# router bgp 65100
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# vni 26
sonic(config-router-af-vni)# route-target both 12.3.4.5:66

[Command] rd rd-num

[Purpose] Configure the RD for Layer 3 VNI.

[Parameters]

ParameterDescription
rd-numThe format is A.B.C.D:MN

[View] BGP EVPN address-family view under the corresponding VRF of the Layer 3 VNI

[Notes] RD storage takes up 6 bytes in three formats: 2-byte ASN with 4-byte custom integer value; 4-byte IP with 2-byte custom integer value; and 4-byte ASN with 2-byte custom integer value. Run command no rd rd-num command to delete the RD configuration.

[Use Cases]

sonic# config
sonic(config)# router bgp 65100 vrf 132
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# rd 55:120

[Command] route-target {both|import|export} rt-num

[Purpose] Configure the RT for Layer 3 VNI.

[Parameters]

ParameterDescription
both|import|exportDecide the direction in which RT takes effect.
rt-numThe format is A.B.C.D:MN|EF:OPQR|GHJK:MN.

[View] BGP EVPN address-family view under the corresponding VRF of the Layer 3 VNI.

[Notes] Run command no route-target {both| import| export} rt-num command to delete the RT configuration.

[Use Cases]

sonic# config
sonic(config)# router bgp 65100 vrf 132
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# route-target both 65207:66