VXLAN and BGP-EVPN
VXLAN and BGP-EVPN View
Table 1 VXLAN and BGP-EVPN View
Command | Purpose |
|---|---|
show vxlan map | Display VXLAN mapping. |
show vxlan tunnel | Display VXLAN tunnels. |
show vxlan statistics vxlan_interface_name peer peer-ip vni vni-id | Display VXLAN statistic. |
clear vxlan static vxlan_interface_name peer peer-ip vni vni-id | Clear VXLAN statistic. |
show vxlan remotemac {all|A.B.C.D} | Display VXLAN remote MAC entries. |
show vxlan map
[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 |
+-------+--------+-------+show vxlan tunnel
[Command] show vxlan tunnel
[Purpose] Display VXLAN tunnels.
[View] Privileged User View
[Use Cases]
sonic# show vxlan tunnelshow vxlan statistics vxlan_interface_name peer peer-ip vni vni-id
[Command] show vxlan statistics vxlan_interface_name peer peer-ip vni vni-id
[Purpose] Display VXLAN statistic.
[Parameters]
Parameter | Description |
|---|---|
vxlan_interface_name | VXLAN interface name. |
peer-ip | Remote VTEP IP. |
vni-id | VXLAN 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 100clear vxlan static vxlan_interface_name peer peer-ip vni vni-id
[Command] clear vxlan statistics vxlan_interface_name peer peer-ip vni vni-id
[Purpose] Clear VXLAN statistic.
[Parameters]
Parameter | Description |
|---|---|
vxlan_interface_name | VXLAN interface name. |
peer-ip | Remote VTEP IP. |
vni-id | VXLAN 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 100show vxlan remotemac {all|A.B.C.D}
[Command] show vxlan remotemac {all|A.B.C.D}
[Purpose] Display VXLAN remote MAC entries.
[Parameters]
Parameter | Description |
|---|---|
A.B.C.D | IPv4 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 : 2VXLAN and EVPN Config
Table 2 VXLAN and BGP-EVPN Config
Command | Purpose |
|---|---|
interface vxlan vxlan_interface_name | Configure VXLAN interface. |
mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id vxlanvni vni-id peer peer-ip | Configure static MAC entry for VXLAN. |
source ip-address | Set 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-id | Configure static routes for VXLAN. |
address-family l2vpn evpn | Enter L2VPN EVPN Address-family View |
neighbor A.B.C.D activate | Enable EVPN of BGP neighbors. |
advertise-all-vni | Enable advertisement of all VNIs. |
advertise ipv4 unicast | Enable type-5 route advertisement. |
table-map map_name | Add a route leak policy. |
import vrf vrf_name | Specify the VRF of route leak. |
vxlan statistics peer peer-ip vni vni-id enable | Configure EVPN Layer 3 tunnel traffic statistics. |
vxlan mode centralized | Enable VXLAN centralized gateway. |
vxlan udp-port port-number | Specify the UDP destination port number used for VXLAN encapsulation. |
rd rd-num | Configure the RD for Layer 2 VNI. |
route-target {both|import|export} rt-num | Configure the RT for Layer 2 VNI. |
rd rd-num | Configure the RD for Layer 3 VNI. |
route-target {both|import|export} rt-num | Configure the RT for Layer 3 VNI. |
interface vxlan vxlan_interface_name
[Command] interface vxlan vxlan_interface_name
[Purpose] Configure VXLAN interface.
[Parameters]
Parameter | Description |
|---|---|
vxlan_interface_name | VXLAN 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 0mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id vxlan vni vni-id peer peer-ip
[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]
Parameter | Description |
|---|---|
HH:HH:HH:HH:HH:HH | MAC address. |
vlan-id | VLAN ID, the range is [1,4094]. |
vni-id | VXLAN Network Identifier, VNI. |
peer-ip | Remote 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.2source ip-address
[Command] source ip-address
[Purpose] Set local VTEP IP of VXLAN.
[Parameters]
Parameter | Description |
|---|---|
ip-address | Local 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.1vni vni-id [vxlan vxlan_interface_name]
[Command] vni vni-id [vxlan vxlan_interface_name]
[Purpose] Add VXLAN mapping.
[Parameters]
Parameter | Description |
|---|---|
vni-id | VXLAN Network Identifier, VNI. |
vxlan_interface_name | VXLAN 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 1000ip route A.B.C.D/M A.B.C.D vxlan-vni vni-id
[Command] ip route A.B.C.D/M A.B.C.D vxlan-vni vni-id
[Purpose] Configure static routes for VXLAN.
[Parameters]
Parameter | Description |
|---|---|
A.B.C.D/M | Specify the destination network segment for routing. |
A.B.C.D | Specify the IP address of next hop of the route. |
vni-id | VXLAN 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 200address-family l2vpn evpn
[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 evpnneighbor A.B.C.D activate
[Command] neighbor A.B.C.D activate
[Purpose] Enable EVPN of BGP neighbors.
[Parameters]
Parameter | Description |
|---|---|
A.B.C.D | BGP 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 activateadvertise-all-vni
[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-vniadvertise ipv4 unicast
[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 unicasttable-map map_name
[Command] table-map map_name
[Purpose] Add a route leak policy.
[Parameters]
Parameter | Description |
|---|---|
map_name | Route 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_2000import vrf vrf_name
[Command] import vrf vrf_name
[Purpose] Specify the VRF of route leak.
[Parameters]
Parameter | Description |
|---|---|
vrf_name | Specify 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 200vxlan statistics peer peer-ip vni vni-id enable
[Command] vxlan statistics peer peer-ip vni vni-id enable
[Purpose] Configure EVPN Layer 3 tunnel traffic statistics.
[Parameters]
Parameter | Description |
|---|---|
peer-ip | Remote VTEP IP. |
vni-id | VXLAN 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 enablevxlan mode centralized
[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 centralizedvxlan udp-port port-number
[Command] vxlan udp-port port-number
[Purpose] Specify the UDP destination port number used for VXLAN encapsulation.
[Parameters]
Parameter | Description |
|---|---|
port-number | Range 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 7788rd rd-num
[Command] rd rd-num
[Purpose] Configure the RD for Layer 2 VNI.
[Parameters]
Parameter | Description |
|---|---|
rd-num | The 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:22route-target {both|import|export} rt-num
[Command] route-target {both|import|export} rt-num
[Purpose] Configure the RT for Layer 2 VNI.
[Parameters]
Parameter | Description |
|---|---|
both|import|export | Decide the direction in which RT takes effect. |
rt-num | The 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:66rd rd-num
[Command] rd rd-num
[Purpose] Configure the RD for Layer 3 VNI.
[Parameters]
Parameter | Description |
|---|---|
rd-num | The 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:120route-target {both|import|export} rt-num
[Command] route-target {both|import|export} rt-num
[Purpose] Configure the RT for Layer 3 VNI.
[Parameters]
Parameter | Description |
|---|---|
both|import|export | Decide the direction in which RT takes effect. |
rt-num | The 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