Introduction

Most of the labs I build are for learning purposes and I find that I burn a lot of time doing boilerplate tasks and not actually working on the feature(s) im trying to test.

I wanted to build a lab where I could chop and change device types from the same vendor ie: Juniper vSRX and vMX and/or devices from different vendors ie: Juniper and Arista without having to spend any time updating the lab diagram with the changes in interface numbering and device icons.

The lab should also be suitable for a hand full of devices but also able to scale out to a large topolgy (for a lab).

Finally I wanted to have an easy to grok IP addressing and VLAN scheme with the base configs built and applied with code.

This post is a record of my effort making a generic base lab dream a reality.

Goals

  • 100% virtualized and managed with Vagrant.
  • Vendor neutral icons.
  • Vendor neutral interface numbering.
  • Base IP addressing and VLANs pre-configured with code.
  • Base configuration applied with automation.
  • All code version controlled with git.

Pods

The lab can scale up to four pods with each pod contains the following devices.

  • 8 routers
  • 1 switch

This configuration allows me to build a lab with 4x Switches and 32x Routers.

Interface Numbering

Interface numbering is not consistent across vendors and even between device models from the same vendor. Below is an example of the first data interface from a sample of devices.

Device Type Interface Numbering
Juniper vSRX/vMX ge-0/0/0
Juniper vQFX xe-0/0/0
Cisco IOSv gig0/1
Cisco IOSXRv gig0/0/0/0
Arista vEOS eth1
Cumulus VX swp1

Since my labs are managed with Vagrant the first interface of a VM will be reserved for Vagrant communication purposes. Some devices have a dedicated management port, some such as the IOSv image do not and burn the first data port for management.

To meet the requirement of not having to update the interfaces on the diagram this means I cannot use interface 0. Therefore the lab skips any interface starting with 0 and start the connections at interface 1.

In the lab the topology the interface port numbers align to the various interface naming conventions for each vendor/device type, for example: Interface 1 on a Juniper vMX would be ge-0/0/1 and on an Arista vEOS it would be eth1.

Topology

Routers

Routers are connected in a full mesh. On each router the port number of an interface is connected to the router of the same number. For example interface 1 on each router connects to R1, interface 2 connects to R2.

lab-1

Switches

Each router also has a link to the pods switch on interface 9. This link is a trunk and connectivity to any router in any pod can be achieved by creating sub-interfaces and trunking VLANs.

lab-2

Inter-pod switches are also connected in a full mesh. Links between the pod switches are configured as trunks with all VLANs allowed. As with the routers On each switch the port number of an interface is connected to the switch of the same number.

lab-3

Subnets

The subnets should be easy to grock without having to keep looking at the diagram to see what network is assigned between hosts and what ip is assigned to each interface.

IPv4 addresses with be allocated from the RFC1918 10.0.0.0/8 range. IPv6 addresses with be allocated from the RFC4193 FC00::/7 range.

Intra-pod Subnet

IPv4 10.<pod-number>.<low-dev><high-dev>.<dev-number>/24
IPv6 fd00:0:<pod-number>:<low-dev><high-dev>::<dev-number>/64

Example Subnet Allocation

Below is an example subnet and IP address allocation between P1R1 and P1R7.

IPv4 IPv6
Network 10.1.17.0/24 fd00:0:1:17::/64
P1R1 10.1.17.1/24 fd00:0:1:17::1/64
P1R7 10.1.17.7/24 fd00:0:1:17::7/64

Inter-pod Subnet

IPv4 10.<low-pod><high-pod>.<low-dev><high-dev>.<dev-number>/24
IPv6 fd00:0:<low-pod><high-pod>:<low-dev><high-dev>::<dev-number>/64

Below is an example subnet and IP address allocation between P1R1 and P3R5.

IPv4 IPv6
Network 10.13.15.0/24 fd00:0:13:15::/64
P1R1 10.13.15.1/24 fd00:0:13:15::1/64
P3R5 10.13.15.5/24 fd00:0:13:15::5/64

VLANs

VLANs follow a similar pattern to the IP addressing schema. Below is an example of VLANs for point-to-point connections over the trunk links

Intra-pod <pod-number><low-dev><high-dev>
Inter-pod <low-pod><high-pod><low-dev><high-dev>

Intra-pod Example

Pod Num Low Dev High Dev VLAN
1 P1R1 P1R7 117

Inter-pod Example

Low Pod High Pod Low Dev High Dev VLAN
1 3 P1R1 P3R5 1315

VLAN Subinterface Networks

Subinterface networks follow the same schema as point to point links except the device to device octet is prefixed with a 1.

Intra-pod Subnet

IPv4 10.<pod-number>.1<low-dev><high-dev>.<dev-number>/24
IPv6 fd00:0:<pod-number>:1<low-dev><high-dev>::<dev-number>/64

Inter-pod Subnet

IPv4 10.<low-pod><high-pod>.1<low-dev><high-dev>.<dev-number>/24
IPv6 fd00:0:<low-pod><high-pod>:1<low-dev><high-dev>::<dev-number>/64

Non-P2P links

Networks and VLANs with more than 2 hosts for example a DMVPN overlay network will be assigned on a case by case basis and documented within that particular lab.

Code

This code for this lab is hosted on github and can be found here.

Summary

Labs are a great learning tool, I have been using this base topology for a couple of weeks tweaking it here and there and it's in a state that is working quite well for me. This is a half documentation half sharing post so feel free to use the lab if you think it will be useful.























Published: 2019-01-09