Networking

Stretch layer 2 with OTV

Let's take a look at how to stretch layer 2 with OTV or overlay transport virtualization, the configuration required to get this setup in Cisco VIRL

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.

otv01

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.

otv02
otv03

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.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.