updated: 18th of February 2019
published: 9th of January 2019
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.
The lab can scale up to four pods with each pod contains the following devices.
This configuration allows me to build a lab with 4x Switches and 32x Routers.
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|
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.
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.
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.
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.
Devices are named according to the following standard.
For example router 1 in pod 1 is named P1R1 the switch in pod1 is named P1SW1
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.
Point-to-Point interface subnets will be allocated a /24 for IPv4 addresses and a /64 for IPv6 addresses.
Point-to-point Interfaces 1-8 directly connect to each router within a pod.
Below is an example subnet and IP address allocation between P1R1 and P1R7.
Interface 9 connects to a switch within a pod and sub-interfaces are used to create logical point-to-point connections between devices.
VLAN numbering follows a similar pattern to the IP addressing schema.
Below is an example subnet and IP address and VLAN allocation between P1R1 and P1R7.
Below is an example subnet and IP address and VLAN allocation between P1R1 and P3R5.
Each router will have an IPv4 and IPv6 loopback assigned.
Below is an example IP address allocation for P1R1.
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.
Pod level iBGP AS
Below is an example iBGP AS allocation for Pod 1.
Router level eBGP AS
Below is an example eBGP AS allocation for P1R1.
This code for this lab is hosted on github and can be found here.
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.