---
title: VXLAN Configuration
slug: enterprise-v5p2/p9aX-vxlan-configuration
description: vxlan configuration
createdAt: 2025-11-14T03:58:41.251Z
---

### <font color="#1d50a2">show vxlan tunnel</font>

**\[Command]**
**show vxlan tunnel**

**\[Purpose]**
View VxLAN tunnel status

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show vxlan tunnel
+----------------------------+-------+
| tunnel                     | vni   |
+============================+=======+
| VTTNL30.11.0.83_30.11.0.85 | 500   |
+----------------------------+-------+
```

### <font color="#1d50a2">show vxlan vtep-status</font>

**\[Command]**
**show vxlan vtep-status**

**\[Purpose]**
View Vxlan tunnel configuration

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show vxlan status
running configuration:
local_vtep_ip : 120.1.1.122
mode : distributed

temp configuration(Need to restart to take effect):
local_vtep_ip : 120.1.1.122
mode : distributed
```

### <font color="#1d50a2">show vxlan map</font>

**\[Command]**
**show vxlan map**

**\[Purpose]**
View the binding relationship between VLAN and VNI, as well as the status of xconnect on the VLAN.

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show vxlan map
+----------+--------+-------+----------+------------+
|      vni |   vlan | vrf   | bridge   | xconnect   |
+==========+========+=======+==========+============+
|        2 |      2 |       |          | true       |
+----------+--------+-------+----------+------------+
|        3 |      3 |       |          | false      |
+----------+--------+-------+----------+------------+
```

### <font color="#1d50a2">show vrf vni</font>

**\[Command]**
**show vrf vni**

**\[Purpose]**
View the binding relationship between VRF and VNI

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show vrf vni
VRF     VNI    VxLAN IF      L3-SVI         State  Rmac
user-A  1      Vxlan1        Brvxlan1       Up     00:11:24:1a:1b:61
userB   2000   Vxlan2000     Brvxlan2000    Up     00:11:24:1a:1b:61
```

### <font color="#1d50a2">show vrf brief</font>

**\[Command]**
**show vrf brief**

**\[Purpose]**
View the information of VRF

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show vrf brief
+------------+-------+-----------+
| vrf name   | vni   | src_mac   |
+============+=======+===========+
| 100        |       |           |
+------------+-------+-----------+
| 200        | 2000  |           |
+------------+-------+-----------+
```

### <font color="#1d50a2">show counters tunnel</font>

**\[Command]**
**show counters tunnel**
**clear counters tunnel**

**\[Purpose]**
View VXLAN tunnel statistics

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show counters tunnel
                      IFACE    RX_OK    RX_PPS      TX_OK    TX_PPS
----------------------------  -------  --------  ---------  --------
VTTNL120.1.1.122_120.1.1.216        0    0.00/s   16782288    0.00/s
VTTNL120.1.1.122_120.1.1.224        0    0.00/s   16782236    0.00/s
```

### <font color="#1d50a2">interface vxlan 0</font>

**\[Command]**
**interface vxlan 0**&#x20;
**no interface vxlan 0**

**\[Purpose]**
Create a VxLAN tunnel

**\[View]**
System configuration view

**\[Usage Scenario]**
To fully leverage the advantages of device virtualization and meet the requirements of multi-tenant access, deploying VxLAN is essential. As the relevant information for VxLAN tunnels needs to be configured on VxLAN interfaces, this command is executed to create VxLAN interfaces.

**\[Use Cases]**

```plaintext
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)#
```

### <font color="#1d50a2">source</font>

**\[Command]**
**source** *A.B.C.D*
**no source** *A.B.C.D*

**\[Purpose]**
Specifies the IP address of a local VTEP

| **Parameter** | **Description**          |
| ------------- | ------------------------ |
| *A.B.C.D*     | IP address of local VTEP |

**\[View]**
VxLAN view

**\[Usage Scenario]**
VTEP, as the tunnel endpoint for VxLAN, is responsible for encapsulating and decapsulating VxLAN packets. This command is used to configure the IP address for the local VTEP, which serves as the source IP address for VxLAN packets.
This IP address can be assigned to a physical interface or preferably to the Loopback interface.

**\[Use Cases]**

```plaintext
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# source 30.11.0.80
```

### <font color="#1d50a2">source centralized</font>

**\[Command]**
**source** *A.B.C.D* **centralized**
**no source** *A.B.C.D* **centralized**

**\[Purpose]**
Configure the local VTEP IP address and specify the current VTEP as the centralized gateway

| **Parameter** | **Description**          |
| ------------- | ------------------------ |
| *A.B.C.D*     | IP address of local VTEP |

**\[View]**
VxLAN view

**\[Usage Scenario]**
In a centralized VxLAN gateway scenario, use the **centralized** parameter to specify that the current device is the device where the centralized gateway is located.

**\[Use Cases]**

```plaintext
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# source 30.11.0.80 centralized
```

### <font color="#1d50a2">vni</font>

**\[Command]**
**vni** *VNI\_ID*
**no vni** *VNI\_ID*

**\[Purpose]**
Associated a specified VNI with a VLAN

| **Parameter** | **Description**             |
| ------------- | --------------------------- |
| *VNI\_ID*     | VNI\_ID,range (1..16777215) |

**\[View]**
VLAN view

**\[Usage Scenario]**
In VxLAN networks, VNI (Virtual Network Identifier) functions similarly to VLAN ID and can be used to identify tenants. The device determines the corresponding VNI based on the VLAN information carried in the received packets.
When a source VTEP corresponds to multiple remote VTEPs, the device replicates the received BUM (Broadcast, Unknown unicast, Multicast) packets and sends them to all remote VTEPs belonging to the same VNI. Similarly, when receiving VxLAN packets, the device removes the VxLAN header and broadcasts the content within the corresponding VLAN broadcast domain based on the VNI information.

**\[Use Cases]**

```plaintext
sonic(config)# vlan 500
sonic(config-vlan-10)# vni 500
```

### <font color="#1d50a2">xconnect</font>

**\[Command]**
**xconnect**
**no xconnect**

**\[Purpose]**
Configure VLAN to enable xconnect functionality.

**\[View]**
VLAN view

**\[Usage Scenario]**
In VxLAN networks, when the xconnect is enabled on a VLAN, the VLAN does not dynamically learn MAC addresses, and all data received by this VLAN will be forwarded through the multicast VxLAN tunnel corresponding to the VLAN. If no multicast VxLAN tunnel is configured, it will be forwarded to all remote VTEPs via head-end replication over the unicast tunnel.

**\[Use Cases]**

```plaintext
sonic(config)# vlan 500
sonic(config-vlan-10)# xconnect
```

### <font color="#1d50a2">vni peer</font>

**\[Command]**
**vni** *VNI\_ID* **peer** *A.B.C.D* **\[rmac** *nn\:nn\:nn\:nn\:nn*:nn **]**
**no vni peer**

**\[Purpose]**
Configure an ingress replication list that contains the IP addresses of those remote VTEPs for a VxLAN network identifier

**\[Parameter]**

| **Parameter**           | **Description**             |
| ----------------------- | --------------------------- |
| *VNI\_ID*               | VNI\_ID,range (1..16777215) |
| *A.B.C.D*               | IP address of remote VTEP   |
| *nn\:nn\:nn\:nn\:nn*:nn | Mac address of remote VTEP  |

**\[View]**
VxLAN view

**\[User Scenario]**
Static specification of the remote VTEP address and VNI information. The device supports the establishment of VxLAN tunnels through static configuration and interaction with the BGP EVPN protocol.

**\[Notes]**
In scenarios where VxLAN distributed gateways are deployed, on devices serving as distributed gateways, the same VTEP MAC needs to be configured to ensure seamless migration of terminals in the VxLAN network. By default, this MAC address is the system MAC address.

**\[Use Cases]**

```plaintext
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# vni 500 peer 30.11.0.100
```

### <font color="#1d50a2">vni mcast-group</font>

**\[Command]**
**vni** *VNI\_ID* **mcast-group** *A.B.C.D*&#x20;
**no vni** *VNI\_ID* **mcast-group** *A.B.C.D*

**\[Purpose]**
Configure the mapping relationship between VNI and multicast tunnel

**\[Parameter]**

| **Parameter** | **Description**             |
| ------------- | --------------------------- |
| *VNI\_ID*     | VNI\_ID,range (1..16777215) |
| *A.B.C.D*     | Multicast tunnel IP address |

**\[View]**
VxLAN view

**\[User Scenario]**
In VxLAN networks, VNI (Virtual Network Identifier) functions similarly to VLAN ID and can be used to identify tenants. The device determines the corresponding VNI based on the VLAN information carried in the received packets.

When a multicast tunnel is configured for a VNI, the BUM traffic received by the local VTEP will no longer be replicated to all VTEPs through head-end replication. Instead, it will be encapsulated into multicast VXLAN packets for forwarding.

Similarly, when receiving VxLAN packets, the device removes the VxLAN header and broadcasts the content within the corresponding VLAN broadcast domain based on the VNI information.

**\[Notes]**
When configuring the multicast VxLAN mapping relationship for a VNI, it is necessary to ensure that local PIM entries are available for multicast VxLAN service forwarding.

Typically, static PIM entries are configured on the Loopback0 of the local VTEP to guide the forwarding of encapsulated multicast VxLAN packets.

**\[Use Cases]**

```plaintext
sonic(config)# interface vxlan 0
sonic(config-vxlanif-0)# vni 500 mcast-group 224.1.1.1
```

### <font color="#1d50a2">address family l2vpn evpn</font>

**\[Command]**
**address-family l2vpn evpn**

**\[Purpose]**
Enter EVPN address group view

**\[View]**
BGP view

**\[Usage Scenario]**
When dynamically establishing VxLAN tunnels using the BGP protocol, execute this command in the BGP view. Enter the EVPN address family configuration view to establish BGP EVPN peers.

**\[Use Cases]**

```plaintext
sonic(config)# router bgp 65100
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)#
```

### <font color="#1d50a2">neighbor activate</font>

**\[Command]**
**neighbor \{** *A.B.C.D* **|** *X\:X\::X*:X **|** *String* **} activate**

**\[Purpose]**
Enables the exchange of relevant routing information with a specified peer/peer group

**\[Parameter]**

| **Parameter** | **Description**                      |
| ------------- | ------------------------------------ |
| *A.B.C.D*     | *X\:X\::X*:X                         |
| *String*      | Specifies the name of the peer group |

**\[View]**
EVPN address family view

**\[Notes]**
User need to establish a BGP peer relationship with the IP address first

**\[Use Cases]**

```plaintext
sonic(config)# router bgp 65100
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# neighbor 1.1.1.1 activate
```

### <font color="#1d50a2">advertise-all-vni</font>

**\[Command]**
**advertise-all-vni**
**no advertise-all-vni**

**\[Purpose]**
Configure all local VNIs to be published to peers

**\[View]**
EVPN address family view

**\[Use Cases]**

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

