Stretch layer 2 with OTV
Lately, in looking at different ways to stretch layer 2 with various technologies, I have been proof of concepting various ways to do this in router labs. ย In aย recent post Stretch VLANs across routers L2TPv3, weย see how to utilize L2TPv3 to have common VLAN connectivity across (3) routers. ย Now onto perhaps a more powerful mechanism to do so in the Cisco world – OTV or Overlay Transport Virtualization. ย Let’s look at how to stretch layer 2 with OTV.
Stretch layer 2 with OTV
The one real caveat to OTV is that you have to have a high level router to be able to have access to the OTV features, such as a Nexus 7k or CSRv router. ย To test drive OTV functionality, I employed Cisco’s VIRL to be able to spin up a lab to play around with OTV. ย I might add that it worked really well to be able to play around with the commands and the features.
As you can see above, I created a simple (2) router and (2) switch topology to simulate having a router/switch at SiteA and router/switch at SiteB. ย The switch was able to simulate traffic coming from a VLAN as I simply apply an IP configuration at the SVI level to ping across the links in the same VLAN. ย I chose VLAN 1 as is many environments, albeit not best practice for security reasons, many still are utilizing VLAN 1 as the data VLAN. ย I wanted to simulate stretching VLAN 1 traffic across as many technologies can stretch additional VLANs fine, except VLAN 1 or so I have seen others mention issues doing that.
Configuration
csr1000v-1
hostname CSRV1 router ospf 1 router-id 192.168.1.1 network 192.168.1.1 0.0.0.0 area 0 ! ! otv site bridge-domain 150 ! otv site-identifier 0001.0001.0001 ! interface Overlay1 no ip address otv control-group 239.20.20.20 otv data-group 232.20.20.0/24 otv join-interface GigabitEthernet2 service instance 100 ethernet encapsulation dot1q 1 bridge-domain 1 ! interface GigabitEthernet2 ip address 192.168.1.1 255.255.255.0 ip pim passive ip igmp version 3 negotiation auto ! interface GigabitEthernet3 no ip address negotiation auto service instance 100 ethernet encapsulation untagged rewrite ingress tag push dot1q 1 symmetric bridge-domain 1 ! service instance 150 ethernet encapsulation dot1q 150 bridge-domain 150 ! !
csr1000v-2
hostname CSRV1 router ospf 1 router-id 192.168.1.1 network 192.168.1.1 0.0.0.0 area 0 ! ! otv site bridge-domain 150 ! otv site-identifier 0001.0001.0001 ! interface Overlay1 no ip address otv control-group 239.20.20.20 otv data-group 232.20.20.0/24 otv join-interface GigabitEthernet2 service instance 100 ethernet encapsulation dot1q 1 bridge-domain 1 ! interface GigabitEthernet2 ip address 192.168.1.1 255.255.255.0 ip pim passive ip igmp version 3 negotiation auto ! interface GigabitEthernet3 no ip address negotiation auto service instance 100 ethernet encapsulation untagged rewrite ingress tag push dot1q 1 symmetric bridge-domain 1 ! service instance 150 ethernet encapsulation dot1q 150 bridge-domain 150 ! !
Testing
To test the stretch layer 2 with OTV, as mentioned above, I assigned an IP address to VLAN1 on both sides. ย Then, simply pinged from one switch across to another switch.
Belowย SW2ย is on the “east” side, andย SW1 is on the “west” side. ย As you can see below, we can ping from one switch over to the other with the same IP subnet range, across routers.
Final Thoughts
OTV was fairly easy to get setup and operational in this simple lab setup above in Cisco VIRL. ย It is yet another way to stretch your layer 2 network across routers. ย Let me know in the comments if you have feedback on using this in a production environment.