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 |
---|---|
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.
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.
Device |
---|
P<local-pod><device-type><local-router>/24 |
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.
IPv4 | 10.<local-pod>.<low-router><high-router>.<local-router>/24 |
IPv6 | fd00:10:<local-pod>:<low-router><high-router>::<local-router>/64 |
Below is an example subnet and IP address allocation between P1R1 and P1R7.
IPv4 | IPv6 | Interface | |
---|---|---|---|
Network | 10.1.17.0/24 | fd00:10:1:17::/64 | |
P1R1 | 10.1.17.1/24 | fd00:10:1:17::1/64 | 7 |
P1R7 | 10.1.17.7/24 | fd00:10:1:17::7/64 | 1 |
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.
Interface 9.XXX
IPv4 | 10.<local-pod><local-pod>.<low-router><high-router>.<local-router>/24 |
IPv6 | fd00:10:<local-pod><local-pod>:<low-router><high-router>::<local-router>/64 |
VLAN | <pod-number><low-router><high-router> |
Below is an example subnet and IP address and VLAN allocation between P1R1 and P1R7.
IPv4 | IPv6 | |
---|---|---|
Network | 10.11.17.0/24 | fd00:10:11:17::/64 |
P1R1 | 10.11.17.1/24 | fd00:10:11:17::1/64 |
P1R7 | 10.11.17.7/24 | fd00:10:11:17::7/64 |
Interface | 9.117 | 9.117 |
VLAN | 117 | 117 |
Interface 9.XXXX
IPv4 | 10.<low-pod><high-pod>.<low-router><high-router>.<local-pod><local-router>/24 |
IPv6 | fd00:10:<low-pod><high-pod>:<low-router><high-router>::<local-pod><local-router>/64 |
VLAN | <low-pod><high-pod><low-router><high-router> |
Below is an example subnet and IP address and VLAN allocation between P1R1 and P3R5.
IPv4 | IPv6 | |
---|---|---|
Network | 10.13.15.0/24 | fd00:10:13:15::/64 |
P1R1 | 10.13.15.11/24 | fd00:10:13:15::11/64 |
P3R5 | 10.13.15.57/24 | fd00:10:13:15::57/64 |
Interface | 9.1315 | 9.1315 |
VLAN | 1315 | 1315 |
Each router will have an IPv4 and IPv6 loopback assigned.
IPv4 | 10.255.<local-pod>.<local-router>/24 |
IPv6 | fd00:10:255:<local-pod>::<local-router>/64 |
Below is an example IP address allocation for P1R1.
IPv4 | IPv6 | |
---|---|---|
P1R1 | 10.255.1.1/32 | fd00:10:255:1::1/128 |
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
Autonomous System | 65<local-pod>00 |
Below is an example iBGP AS allocation for Pod 1.
Pod 1 | 65100 |
Router level eBGP AS
Autonomous System | 65<local-pod>0<local-router> |
Below is an example eBGP AS allocation for P1R1.
P1R1 | 65101 |
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.