Configuring VXLAN Layer 2 gateway

Follow these steps to configure a VXLAN Layer 2 gateway.

Procedure

  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enter the overlay-gateway command, specify the name of a gateway, and enter VXLAN overlay gateway configuration mode.
    device(config)# overlay-gateway GW1
    
  3. Enter the map vlan vni command and specify l2-extension.
    device(config-overlay-gw-GW1)# map vlan 5 vni 5000
    
  4. Enter the map bridge-domain command and specify a bridge domain and VNI.
    device(config-overlay-gw-GW1)# map bridge-domain 1 vni 2000
    
  5. Enter the ip interface command and specify a loopback ID.
    device(config-overlay-gw-GW1)# ip interface loopback 1
    
  6. Enter the activate command to activate the site.
    device(config-overlay-gw-GW1)# activate
    
  7. In global configuration mode, enable EVPN configuration mode and configure the EVPN instance.
    1. Enter default EVPN configuration mode.
      device(config)# evpn
      
      Default mode is the only available mode.
    2. Enable the auto-generation of the import and export route-target community attributes for the default EVPN instance.
      device(config-evpn-default)# route-target both auto
      
    3. Enable the auto-generation of a route distinguisher (RD) for the default EVPN instance.
      device(config-evpn-default)# rd auto
      
    4. Add the BDs to the default EVPN instance.
      device(config-evpn-default)# bridge-domain add 1-2
      
    5. Add the VLANs to the default EVPN instance.
      device(config-evpn-default)# vlan add 11-12
      
  8. Configure BGP routing with neighbor and address-family attributes.
    1. In global configuration mode, enable BGP routing and enter BGP router configuration mode.
      device(config)# router bgp
      
    2. Specify the autonomous system number (ASN) for the AS in which the remote neighbor resides.
      device(config-bgp-router)# neighbor 7.7.100.7 remote-as 100
      
    3. Configure the BGP device to communicate with a neighbor through a specified interface, in this case loopback 1.
      device(config-bgp-router)# neighbor 7.7.100.7 update-source loopback 1
      
    4. Repeat the above two substeps for the other peer address, as in the following example.
       neighbor 8.8.100.8 remote-as 100
       neighbor 8.8.100.8 update-source loopback 1
      
    5. Enable IPv4 and IPv6 unicast address-family.
      device(config-bgp-router)# address-family ipv4 unicast
      device(config-bgp-router)# address-family ipv6 unicast
      
  9. Enable the L2VPN address-family configuration mode to configure a variety of BGP EVPN options.
    1. Enable L2VPN address-family configuration mode and enter BGP EVPN configuration mode.
      device(config-bgp-router)# address-family l2vpn evpn
      
    2. Specify VXLAN encapsulation for the first peer.
      device(config-bgp-evpn)# neighbor 8.8.100.8 encapsulation vxlan 
      
    3. Enable the exchange of information with BGP neighbors and peer groups.
      device(config-bgp-evpn)# neighbor 8.8.100.8 activate
        
  10. In privileged EXEC mode, enter the show overlay-gateway command to confirm the gateway configuration.
    device# show overlay-gateway
    Overlay Gateway "GW1", ID 1,
    Admin state up
    IP address 3.3.3.3 (loopback 1), Vrfdefault-vrf
    Number of tunnels 1
    Packet count: RX 17909 TX 1247
    Byte count : RX (500125) TX 356626
    
  11. In privileged EXEC mode, enter the show tunnel command to confirm the tunnel configuration.
    device# show tunnel 61441
    Tunnel 61441, mode VXLAN
    Ifindex 0x7c00f001, Admin state up, Operstate up
    Source IP 3.3.3.3, Vrf: default-vrf
    Destination IP 1.1.1.1
    Active next hops on node 1:
    IP: 4.4.4.5, Vrf: default-vrf
    Egress L3 port: Ve45, Outer SMAC: 609c.9f5a.4415
    Outer DMAC: 609c.9f5a.0015, ctag: 0
    BUM forwarder: yes
    
  12. In privileged EXEC mode, enter the show vlan command to confirm the VLAN configuration.
    device# show vlan 5
    VLAN             Name            State                      Ports           Classification
    (R)-RSPAN                                                   (u)-Untagged
                                                                (t)-Tagged
    ================ =============== ========================== =============== ====================
    5                VLAN05          ACTIVE                     Eth 2/1(t)
                                                                Eth 2/5(t)
                                                                tu61441  vni5000
    
  13. In privileged EXEC mode, enter the show mac-address-table command to confirm the MAC configuration.
    device# show mac-address-table
    VlanId/BDId    Mac-address       Type      State      Ports/LIF/PW
    35 (V)         609c.9f5a.5b15    Dynamic   Active     Po 35
    45 (V)         609c.9f5a.4415    Dynamic   Active     Po 45
    5 (V)          0000.0400.0011    Dynamic   Active     tu61441
    5 (V)          0000.0500.0011    Dynamic   Active     Eth 0/5
    5 (V)          0000.0400.0011    Dynamic   Active     tu61441
    5 (V)          0000.0500.0011    Dynamic   Active     Eth 0/5
    Total MAC addresses : 6
    device#