...
The configuration for Router 1 is shown below. The first part of the configuration deals with physical interfaces and assigning VLANs to these interfaces. Router 1 has three physical interfaces configured, two interfaces connecting server 1 and server 3.
Next we setup the layer 3 VLAN interfaces and configure IP addresses for these interfaces. The MTU value of layer 3 interfaces is set to 1450 to ensure there is enough space for the overlay VXLAN header. The switch will complain and refuse to commit the configuration if MTU size is not set to 1450.
Then we setup VXLAN VNIs, enable VLAN to VNI mapping and map VNIs to VLAN IDs.
Finally we enable IP routing on the device and configure BGP related parameters such as router ID, BGP neighbor and enabling advertising all VNIs.
Code Block |
---|
admin@router1# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 100 admin@router1# set interface gigabit-ethernet te-1/1/10 family ethernet-switching native-vlan-id 1111 admin@router1# set interface gigabit-ethernet te-1/1/10 family ethernet-switching port-mode "trunk" admin@router1# set interface gigabit-ethernet te-1/1/10 family ethernet-switching vlan members 2221 admin@router1# set interface gigabit-ethernet te-1/1/11 family ethernet-switching native-vlan-id 2222 admin@router1# set l3-interface loopback address 201.201.201.201 prefix-length 32 admin@router1# set l3-interface loopback address 201.201.201.88 prefix-length 32 admin@router1# set l3-interface loopback address 201::201 prefix-length 128 admin@router1# set l3-interface vlan-interface vlan100 mtu 1450 admin@router1# set l3-interface vlan-interface vlan100 address 100.1.1.201 prefix-length 24 admin@router1# set l3-interface vlan-interface vlan100 address 100::201 prefix-length 64 admin@router1# set l3-interface vlan-interface vlan2221 vrf "vrf1" admin@router1# set l3-interface vlan-interface vlan2221 mtu 1450 admin@router1# set l3-interface vlan-interface vlan2221 address 21.1.1.201 prefix-length 24 admin@router1# set l3-interface vlan-interface vlan2222 vrf "vrf1" admin@router1# set l3-interface vlan-interface vlan2222 mtu 1450 admin@router1# set l3-interface vlan-interface vlan2222 address 22.1.1.201 prefix-length 24 admin@router1# set l3-interface vlan-interface vlan1111 vrf "vrf1" admin@router1# set l3-interface vlan-interface vlan1111 mtu 1450 admin@router1# set vlans vlan-id 100 l3-interface "vlan100" admin@router1# set vlans vlan-id 1111 l3-interface "vlan1111" admin@router1# set vlans vlan-id 2221 l3-interface "vlan2221" admin@router1# set vlans vlan-id 2222 l3-interface "vlan2222" admin@router1# set vxlans source-interface lo address 201.201.201.201 admin@router1# set vxlans vni-map-vlan true admin@router1# set vxlans vni 9999 vlan 1111 admin@router1# set vxlans vni 22221 vlan 2221 admin@router1# set vxlans vni 22222 vlan 2222 admin@router1# set protocols bgp local-as 201 admin@router1# set protocols bgp router-id 201.201.201.201 admin@router1# set protocols bgp peer-group fabric remote-as "external" admin@router1# set protocols bgp neighbor 100.1.1.134 peer-group "fabric" admin@router1# set protocols bgp ipv4-unicast network 201.201.201.201/32 admin@router1# set protocols bgp ipv4-unicast network 201.201.201.88/32 admin@router1# set protocols bgp evpn advertise-all-vni admin@router1# set protocols bgp evpn advertise ipv4-unicast admin@router1# set protocols bgp evpn peer-group fabric activate admin@router1# set protocols bgp vrf vrf1 local-as 201 admin@router1# set protocols bgp vrf vrf1 router-id 201.201.201.201 admin@router1# set protocols bgp vrf vrf1 ipv4-unicast network 22.1.1.0/24 admin@router1# set protocols bgp vrf vrf1 evpn advertise ipv4-unicast admin@router1# set ip vrf vrf1 admin@router1# set ip vrf vrf2 admin@router1# set evpn vrf vrf1 vni 9999 admin@router1# set ip routing enable true |
...
Upon receiving the EVPN Type-2 route from R1, R2 learns the MAC address of Host 1. To accept this route, R2 needs to determine if the Import Route Target (IRT) configured on R2 matches the Export Route Target (ERT). RT is sent as the BGP Extended Community attribute. In this case the IRT and ERT match hence the route is accepted and the MAC address of Host 1 is learned.
Figure 2. MAC Learning and Packet Forwarding
...
Code Block |
---|
admin@router2# run show vxlan tunnel Total number of tunnels: 3 VNI 9999, Encap:service-vlan-delete, Decap:service-vlan-add-replace src addr:134.134.134.134, dst addr:201.201.201.201, state:UP traffic type:unicast nexthops:100.1.1.201 output ports:ge-1/1/1 VNI 22221, Encap:service-vlan-delete, Decap:service-vlan-add-replace src addr:134.134.134.134, dst addr:201.201.201.201, state:UP traffic type:unicast nexthops:100.1.1.201 output ports:ge-1/1/1 VNI 22222, Encap:service-vlan-delete, Decap:service-vlan-add-replace src addr:134.134.134.134, dst addr:201.201.201.201, state:UP traffic type:unicast nexthops:100.1.1.201 output ports:ge-1/1/1 |
Code Block |
Run the command run show vxlan evpn rmac to display the Router-MAC (rmac) and other VXLAN parameters. Note that to configure rmac for a layer 3 VLAN interface, run the command set l3-interface vlan-interface <interface-name>router-mac <router-mac>
Code Block |
---|
admin@router2# run show vxlan evpn rmac L3 VNI Interface SVI-Interface VTEP RMAC Flags -------- ------------- ------------- ---------- ----------------- ----- 9999 vxlan9999 vlan1111 201.201.201.201 c4:39:3a:fb:be:d9 0x16 |
To display the VXLAN EVPN routes, run the command run show vxlan evpn route.
Code Block |
---|
admin@router2# run show vxlan evpn route
VRF-ID ROUTE NextHop VNI Interface
-------- ---------------- ------------- ---------- -----------------
1 22.1.1.0/24 201.201.201.201 9999 vlan100
|
To check the routing table of a device, run the command run show route vrf vrf1. We can see that there is a BGP route for subnet 22.1.1.0/24 via 201.201.201.201 to reach server 3.
Code Block |
---|
admin@router2# run show route vrf vrf1
show ip route vrf vrf1
=======================
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
VRF vrf1:
K>* 0.0.0.0/0 [255/8192] unreachable (ICMP unreachable), 00:32:26
C>* 21.1.1.0/24 is directly connected, vlan2221, 00:31:37
B>* 22.1.1.0/24 [20/0] via 201.201.201.201, vlan1111 onlink, weight 1, 00:31:24 <------------ Route for server3
C>* 33.1.1.0/24 is directly connected, vlan3333, 00:31:37
|