Monday, June 13, 2022
HomeNetworkingCombining VLANs with VRFs « ipSpace.internet weblog

Combining VLANs with VRFs « ipSpace.internet weblog


Final two weeks we centered on entry VLANs and VLAN trunk implementation in netsim-tools. Can we mix them with VRFs? After all.

The trick may be very easy: attributes inside a VLAN definition turn into attributes of VLAN interfaces. Add vrf attribute to a VLAN and also you get all VLAN interfaces created for that VLAN within the corresponding VRF. Can’t get any simpler, can it?

How about extending our VLAN trunk lab topology with VRFs? We’ll put pink VLAN in pink VRF and blue VLAN in blue VRF.

Combining VLANs with VRFs

We’ll take the prevailing VLAN trunk lab topology and modify it a bit. First, we now have to allow VRF help on the switches – we’ll add vrf module to the checklist of modules utilized by S1 and S2.

Add VRF module to the switches group

teams:
  switches:
    members: [ s1, s2 ]
    module: [ vlan,vrf ]
    system: eos

Subsequent, we now have to outline the VRFs.

VRF definitions in lab topology

vrfs:
  pink:
  blue:

netsim-tools mechanically allocate route distinguishers and route targets to VRFs. Clearly you might override these values in case you like specific RD/RT values or in case you’re constructing complicated topologies.

Lastly, a little bit of magic mud: add vrf attribute to VLAN definitions:

VLAN definitions in lab topology

vlans:
  pink:
    vrf: pink
  blue:
    vrf: blue

That’s it. Execute netlab up (after downloading the last topology file) and also you’ll have a multi-VRF lab utilizing a VLAN trunk.

Listed here are the related components of Arista cEOS configuration in case you’re questioning what we achieved with the few additional strains in lab topology file:

VRF+VLAN configuration on Arista cEOS

spanning-tree mode mstp
!
vlan 1000
   title pink
!
vlan 1001
   title blue
!
vrf occasion blue
   rd 65000:2
!
vrf occasion pink
   rd 65000:1
!
interface Ethernet1
   mac-address 52:dc:ca:fe:05:01
   switchport entry vlan 1000
!
interface Ethernet2
   mac-address 52:dc:ca:fe:05:02
   switchport entry vlan 1001
!
interface Ethernet3
   description s1 -> s2
   mac-address 52:dc:ca:fe:05:03
   switchport trunk allowed vlan 1000-1001
   switchport mode trunk
!
interface Vlan1000
   description VLAN pink (1000) -> [h1,s2,h2]
   vrf pink
   ip handle 172.16.0.5/24
!
interface Vlan1001
   description VLAN blue (1001) -> [h3,s2,h4]
   vrf blue
   ip handle 172.16.1.5/24
!
ip routing
ip routing vrf blue
ip routing vrf pink

Need to run this lab by yourself, or attempt it out with completely different units? No drawback:

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments