The vxlan vni command binds a VXLAN network identifier (VNI) to a virtual private network (VPN) instance.
The undo vxlan vni command unbinds a VNI from a VPN instance.
By default, a VNI is not bound to any VPN instance.
Usage Scenario
To isolate tenants at Layer 3, VPN is generally used. In a distributed VXLAN gateway scenario, to implement Layer 3 communication through a Layer 3 gateway, the Layer 3 gateway must be bound to a VPN instance.
The Layer 3 gateway assigns a Layer 2 VNI to each tenants and a Layer 3 VNI to each tenant identified by a VPN instance. To bind a VNI to a VPN instance, run the vxlan vni command. During Layer 3 communication through the Layer 3 gateway, the VNI ID bound to the VPN instance is transmitted to the remote Layer 3 gateway through the VXLAN tunnel. The remote Layer 3 gateway identifies VPNs based on tenants' VNI IDs to determine whether tenants belong to the same VPN for communication or isolation purposes.Precautions
A VNI can be bound only to one VPN instance.
The VNI bound to a VPN instance cannot be bound to a BD.