If you're using more than a single subnet then a proper network design is essential. GeekLab v1 was a single network segment and 4 hosts. The current version has separate segments, multiple subnets and simple VLANs to separate out GeekLab experiments from primary workloads which was a good learning experience to create but knowing a lot more of the design principals up front would have been nice. You're welcome.
The very first housenet I built was based on some borrowed 3C509 network cards and some discarded 10BASE2 thinwire ethernet that snaked it's way around 4 rooms of a shared house. We had a very understanding landlord who let us drill a couple of rather large holes in two walls too. There was no server and it was only really used for games - Civilisation 2 being one of the favourites. This was in the days before broadband where if you were really lucky (or the CEO) you might have an ISDN-2 connection but there wasn't a huge amount to connect to, and at 28 kbps download that was probably a good thing.

My first GeekLab network was a single Ethernet segment with a USB DSL modem that was shared using Windows itself. Although wireless networks were available they were slow, expensive and on a practical point were banned for work use by my then employer so I had a lot of fun installing Cat5e Ethernet cables under the floor to provide sockets in the required rooms.
Geeklab v2 initially started out on the same approach of a single network with a simple Ethernet hub but the USB DSL modem was soon replaced with an ADSL router. Then I decided I really should do a proper design. Full disclosure: Several evolutions over as many years are condensed here for your convenience. As a reality check, if I had to start again from scratch this is the approach I would take.
Networking Requirements
The first step in deciding on how to build the network is to decide on the requirements.
- Must support IPv4, IPv6 useful.
- Must support both static and dynamic address allocation. All hosts should be in DNS.
- Multiple networks for separation of different workloads e.g: live, dev, test, work and public systems with internal firewalls between
- Networks should be as self-contained as possible. There should be a minimum of changes to other configuration if creating or stop/start a new one.
- Any networks defined within ESXi should also be able to be available to external hosts
- All networks should be able to reach internet if needed
- The Public network (DMZ) should be the only network with hosts reachable from internet.
- All hosts should be reachable from administration machines e.g. SSH, RDP
- All VMs must be able to reach a central apcupsd service for controlled shutdown if the UPS signals low battery
- Wifi also needs to support separation of networks.
- Internal networks should be able to function if internet router fails
Since a lot of what I want to do with the GeekLab, at least to start with, involves DNS, DHCP and Active Directory / LDAP I need to be able completely separate my test and development areas from live services.
Networks may well change, and when not in use machines will be shut down so from a purely administrative standpoint if I need to create a new network there should be minimal changes required to other networks or devices to allow hosts to communicate.
Security is also an issue, and if I need to allow selected applications to be accessible from the internet it gets a little more complex as a complete ban on incoming connections is not possible. While I don't have to worry too much about limiting outbound communication I may need to introduce web filtering at some point too.
I also need to ensure that my work laptop is never disrupted by anything that goes on with the Geek Lab (at least not during working hours) and that any interaction between them is strictly controlled and the absolute bare minimum neccessary - to protect all parties concerned.
Constraints
There are also a few limitations we need to take account of
- Current ISP provides a single public IPv4 address
- Current ISP does not support IPv6 although methods alternatives exist.
- Commodity home/small office hardware to be used
- ESXi features limited to free license
- Cabled network is Cat 5e
- Internet access is a VDSL FTTC - copper connection to the premises, with no date for full fibre available
- GeekLab server has 2 built-in network ports
The constraints are pretty standard for a typical home or small office. And while it's mildly annoying that every telephone exchange around us has been upgraded for full fibre and there's still no date for us, the existing service is sufficient for my needs at the moment.
Network Solution
A single network for all hosts and VMs is obviously not going to work in this situation. Even using multiple IP subnets isn't going to work because that won't affect addressing protocols like DHCP or IPv6's RA. What I really need is multiple separate networks.
| Network | VM | Wifi | Comment |
| House | Yes | Yes | PCs, devices and VMs on the live "house" network |
| Work | Yes | Yes | Work laptop and dev VMs, direct internet access via router |
| Guest WiFi | Yes | Wifi guests to internet | |
| Public | Yes | No | For any internet facing servers. |
| Test | Yes | Maybe | Test servers. |
| Sandpit | Yes | Maybe | Sandpit servers. |
I also need to enable some degree of communication between the different networks. I could sit a central router in the middle of all of them but that would become incredibly complex to manage and also becomes one central point of failure.
A better approach is to add a backbone network that all the others will connect to. This means I can have a separate independent router for each network that just connects to the backbone. Not only is there no central point of failure, I can also try out routing and firewall config on the Test network before moving it to House network.

While this is a simple concept, implementing this would require additional network ports and cabling. I would need separate routers, which if implemented in VMware would require at least four network ports on the server:
- Backbone connection to DSL router
- House connection for PCs and devices
- Work connection for work laptop and phone
- Guest wifi connection
And this assumes I'd never want to connect physical devices to the Test, Sandpit or Public networks, otherwise I'd need additional ports for them too. So clearly this is not a suitable approach.
Virtual Local Area Networks
Handily there is a well-established technology for solving this exact problem that I used to regard as something only lazy datacenter operators who couldn't be bothered to run cables as needed had to muck about with with: Virtual Local Area Networks or VLANs. And specifically the 802.1Q variety.
There's 1000's of web pages dedicated to the topic of IP networking and I'm not going to go too deeply into theory, just in case I get some of it wrong / since I only need to focus on what I need and what is supported with the equipment I have.
One of the fundamental concepts behind Internet Protocol (IP) networking is the subnet. Hosts within a subnet can directly communicate with each other. To reach hosts in another subnet requires a router that knows how to direct the traffic so it can reach the destination which could be directly connected or several subnets away. The original network design assumed that all hosts were physically attached to the same wire were somehow related and administered together so things like DHCP servers could either allocate addresses on demand, or would be configured to allocate specific addresses to known hosts so you could still have multiple IP subnets on the same cable and hosts on one subnet would (hopefully) not be aware of hosts on other subnets.
But in a virtual environment we don't have cables, and while we could have multiple "virtual wires" defined within VMware that would not help if we wanted to allow virtual machines to communicate with external hosts on the same wire. You could have a vSwitch (a virtual Ethernet switch) for each subnet connecting to a different network port on the VMware server and using using real cables to connect to the external hosts and that would actually be a port-based virtual network, but it doesn't scale well, especially if your server only has two network ports.
There is another approach, based on an extension to Ethernet called 802.11Q VLAN tags, the simple version of which is now widely implemented in consumer-grade networking kit and both Linux and Windows support it too, as of course does VMware.
To understand this it helps to have a little refresher on the OSI network model and layers 2 and 3 in particular. https://OSI-model.com has a good explanation of this and nicely extends the model to include Layer 8 which is really where so many problems are really found.
| Layer | Name | Ethernet Examples |
| 8+ | Users and real life | What happens if I disconnect this cable? |
| 7 | Application Layer | Network applications eg HTTP, SSH & RDP, NFS & SMB, Mail etc |
| 6 | Presentation Layer | Encoding, converting and encrypting data been applications and sessions |
| 5 | Session Layer | Managing communication sessions between applications |
| 4 | Transport Layer | TCP & UDP, transferring data |
| 3 | Network Layer | Internet Protocol; packet routing and forwarding between networks |
| 2 | Data Link Layer | Ethernet frames, MAC addresses |
| 1 | Physical Layer | Cabling and transmitters, electrical / laser / radio signalling |
Internet Protocol operates at OSI Layer 3, the Network Layer, and is responsible for routing IP packets between hosts and across networks and we have a lot of control over this as we set the addresses, network identifiers and determine the routing rules.
Ethernet (and wifi) operates at OSI Layer 2, the Data Link Layer, and is responsible for transferring frames between Ethernet devices on the same local network. The Ethernet MAC address is officially hard-coded into each device which limits how we can manage it. On an Ethernet network, an Internet Protocol (IP) packet is carried as the payload in an Ethernet frame.
The 802.1Q extension to Ethernet adds an extra header into the Ethernet frame format which allows us to define a VLAN tag as a number between 0 and 4095 that can be applied to a frame. Ethernet devices can then make decisions about frame filtering and forwarding based on this tag value, independently of whatever IP address is in the IP packet held in the frame payload. There's a good Wikipedia article that will tell you more than you ever needed to know on the theory of this.
| Destination MAC | Source MAC | VLAN Tag | [Other Headers] | Source Address | Destination Address |
| Internet Protocol Packet | |||||
| Ethernet Frame | |||||
Since the VLAN tag is processed by the Ethernet layer, if the device receives a frame with a tag value it's not configured to accept that frame will not be accepted, regardless of whatever would happen in the IP layer. A VLAN-aware switch would only forward the frame to ports configured for that particular VLAN and would not consider any IP addresses. So effectively our VLAN tags create numbered virtual networks between Ethernet devices sharing the same wire but otherwise independent of each other.
Of course, if the physical network segment carrying the VLANS is only rated for 1 Gbps then then the VLANs will be sharing that 1Gbps between them, even if they think each think they're a 1 Gbps network themselves. VLANs are a management technique, hence my thoughts about lazy data center managers.
This also adds another layer of complexity and management (and fun?) as to enable communication we now need to make sure the VLAN configuration is correct as well as IP addressing. And of course each device will have it's own capabilities and configuration details.
If you're going to use VLANs on your network, then ideally all devices with more capability than a simple repeater on those sections should be VLAN-aware. While you can mix tagged VLANs and untagged native Ethernet on the same segment it can cause complications. A simple approach to start with is to keep a mapping between VLAN and IP subnets. In a GeekLab you're unlikely to use all 4093 usable VLAN ID's and another practical limitation in a lot consumer / small business Ethernet switches and routers is they can only support a limited number of concurrent VLANs anyway.
So now I can add the Hall network and VLAN information to the list of networks, together with the devices that need to connect to each VLAN. You can use any method you like to allocate VLAN numbers. VLAN 0 and 4095 are reserved and 1 is best avoided as it's often uses as a default or management VLAN - check the documentation for all the devices you're considering enabling VLANs for to see it they also have default or reserved VLAN numbers. For VLANs starting on the router I chose to use 100-199, for those starting from VMware I decided on 200-299. And yes, start point is pretty arbitrary.
| Name | VLAN | VM | Wifi | Router | IPv4 | IPv6 | Comment |
| House | 0 | Yes | Yes | Y | Disabled | PCs, devices and VMs on main house network connected to server NIC1, no VLAN. | |
| Hall | 110 | Yes | Yes | Y | Backbone network all the other may connect to; internet egress | ||
| Work | 140 | Yes | Yes | Yes | Y | Work laptop and dev VMs, direct internet access via router | |
| Guest WiFi | 150 | Yes | Yes | Y | Disabled | Wifi guests to internet | |
| Public | 180 | Yes | Yes | Y | Not used | For any internet facing servers. Routed direct. | |
| Test | 220 | Yes | Y | Not used | Test servers. | ||
| Sandpit | 240 | Yes | Y | Not used | Sandpit servers. |

I have four devices that are VLAN-aware (excluding PCs):
- A DSL router - 5 ports
- The VMware ESXi server, 2 ports
- A WiFi bridge, 1 port
- An Ethernet switch, 8 ports
I can now map which VLAN need to be present on each device which will then give me part of the device config plus the forwarding rules for the main VLAN switch, which we can see is the key component in the network design.
Main VLAN Switch
This is responsible for forwarding Ethernet frames between devices based on the VLAN ID:
- Connect the House network to the House Wifi, adding/removing the VLAN tag as needed. Note: The House network does not connect directly to the DSL router.
- Connect the Guest Wifi VLAN to the Wifi bridge and DSL router
- Connect the Work VLAN to the VMware Server, Wifi bridge and DSL router
- Connect the Hall and Public VLANs to the VMware server and DSL router.
- Allow Test and Sandpit VLANs to connect to Wifi or other devices if needed in future.
We now have all the information required to configure the switch.
VMware Server
The VMware server has two physical network ports and each is allocated to a vSwitch:
- vSwitch0 : No VLAN tagging, connected to a simple Ethernet switch to allow PCs and devices to have direct access to House VMs. A router VM allows access to other networks and the internet to allow web filtering to be implemented in the future.
- vSwitch1 : A Port Group is defined for each VLAN with the appropriate VLAN ID set. VMs are connected to the Port Group and so don't have to be individually configured for VLANs.
We also have all the information required to create and configure the vSwitches
DSL Router
The DSL Router is configured with the VLANs for Hall, Public, Guest Wifi and Work.
- All allow outbound internet access
- Inter-VLAN routing is permitted, but the default is to block
- Access to specific addresses and services is permitted, e.g. a printer, backup server and UPS monitor
We don't yet have all the information required to configure the router. While we know the VLAN IDs we don't yet have the IP subnets defined and these must be enabled first.
While this solution could be implemented without the core VLAN switch, I wouldn't have any spare ports left for future expansion and separating the Wifi networks would have been problematic - I couldn't get the DSL router to do VLAN termination on my first few attempts (got it working eventually) and I don't want the house network connecting directly to the router. And the constant reboots trying to get it working just annoyed users.
I also found that DSL routers do not like it when lightning strikes nearby. A typical lightning flash is about 300 million volts and 30,000 amps (source NOAA). Obviously if this strikes cables directly things are going to go badly wrong with anything they connect to (ask Microsoft Azure about what happened to US South Central a few years ago). But even with a ground strike some distance away this charge spreads out from the point of impact according to local geology and will induce very high voltage spikes in any buried cables it encounters as it dissipates, which telecoms equipment generally doesn't like. As this is a well-known risk the standard BT phone socket included a surge arrester to protect your telephone. But this interferes with DSL broadband so BT quietly removed it. You're happy with faster broadband speeds and if you're unlucky and lightning does strike it's not BT that's going to be paying the bill for a new router.
On a more practical note, if you need to change the router configuration or update the firmware, having a separate VLAN switch means internal services should not be impacted while you're working on it.
Internal Routing
External routing is easy - the router and ISP does it. The router sets the ISP connection as the default route and I have nothing to worry about, unless I ever need to start getting clever with VPN connections to cloud labs and the like. Internal routing is a different story - that is my problem.
Routing is protocol dependent though, and while IPv4 is a must this is also a good opportunity to get to play with IPv6. But first I need to allocate the addresses.
Address Allocation
The first choice, which is fundamental, is the size I need for each subnet. I am using a single subnet inside each VLAN too, so that's 7 subnets to allocate as well.
For IPv6 the recommended subnet size is /64 which will allow billions of possible addresses - more than the current IPv4 internet and while not mandatory changing this breaks things. It's also recommended (by IETF I believe) that ISPs should offer subscribers at least a /56 block which will give you 16 subnets or preferably a /48 block which will give you 65536 subnets. Address exhaustion is not going to be an issue. While there are options for private addresses, such as the Unique Local Address block at fd00::/8 which may be worth playing with in a GeekLab, address translation while possible looks horrible and I've not felt the urge to explore. For the purposes of these articles I'm using the 2001:db8::/32 documentation block.
IPv4 is different though. All of the available IPv4 addresses were allocated some years ago and nobody these days is getting large address allocations without a fight and definitely not for home use. Most ISP will allocate a single IPv4 address, a few like Andrews & Arnold will offer 4. Some are using CG-NAT and not giving you a "real" address atall. We have to use NAT on the router and RFC 1918 private address space internally. There is a huge number of pages given over to this so I'm not going to go into teh full details. Suffice to say, given this is a GeekLab using the 192.168.0.0/16 range with a /24 subnet size(or Class C in old-speak) which allows upto 254 addresses within each subnet should be sufficient, and I can have 256 subnets of this size if I stick to the standard sizing.
There are also two other ranges I can legally use - 10.0.0.0/8 and 172.16.0.0/12 - plus a few others while officially reserved for other purposes are probably OK to use. This still translates into millions of addresses, although given the 10.0.0.0/8 subnet is a common one within corporates using the same on your home network may cause issues if you need to connect to the office via a VPN.
One issue to watch out for is if you're using larger subnets sizes that any DHCP server you intend to use can cope. For subnets which connect to the DSL router, the DHCP server for LAN1-3 supports upto 1021 addresses and LAN4-8 support upto 253 addresses. So picking a IPv4 subnet size larger than /22 or /24 respectively may be pointless or I'll need to implement a separate DHCP solution for them.
The issue with using private address space is if you ever want to experiment with WAN links to another friendly neighbourhood GeekLab you need to make sure you're not using the same private address ranges. While most home/small business networking defaults to 192.168.0.0/24 it's a good idea to pick a different subnet to reduce the risk of having to renumber in future. The IPv6 ULA explicitly recommends a pseudo-random way of picking subnets to avoid this very issue.
This means I can now update my networking spec with the addresses.
| Name | VLAN | VM | Wifi | Router | IPv4 | IPv6 | Comment |
| House | 0 | Yes | Yes | 192.168.200.0/24 | 2001:db8:1:0::/64 | PCs, devices and VMs on main house network connected to server NIC1, no VLAN. | |
| Hall | 110 | Yes | Yes | 192.168.204.0/24 | 2001:db8:2:0::/64 | Backbone network all the other may connect to; internet egress | |
| Work | 140 | Yes | Yes | Yes | 192.168.208.0/24 | 2001:db8:3:0::/64 | Work laptop and dev VMs, direct internet access via router |
| Guest WiFi | 150 | Yes | Yes | 192.168.212.0/24 | 2001:db8:4:0::/64 | Wifi guests to internet | |
| Public | 180 | Yes | Yes | 192.168.216.0/24 | Not used | For any internet facing servers. Routed direct. | |
| Test | 220 | Yes | 192.168.220.0/24 | 2001:db8:6:0::/64 | Test servers. | ||
| Sandpit | 240 | Yes | 192.168.224.0/24 | 2001:db8:7:0::/64 | Sandpit servers. |
For the IPv4 addresses, given the abundance of addresses I've spaced out my subnets to allow future resizing to a /23 or even a /22 if ever needed. In real life I chose some completely random numbers, but still with enough space to resize without affecting others.
Routing IPv4
External routing of IPv4, or standard Internet Protocol as most people are concerned about is handled by the DSL router and of course is based on NAT since I only get a single public IP address at the moment.
Internal routing is a little more interesting. For the House network and the internal VM networks Test and Sandpit a small Linux VM configured as a router, using the Quagga routing suite, provides the connection between them and the backbone network labelled Hall. Hall itself extends to the DSL router for internet egress. Each of these router VMs also run other services such as firewall, a DNS cache and maybe at some point a web proxy too.
The Work and Guest WiFi networks also extend to the router for internet egress and so it makes sense to use the router to also allow them access to the Hall for restricted access to the other networks. This means they have no dependency on the VMware server should something get broken there and also they're not putting any load on it either.
The Public network is also accessible via the DSL router for inbound (NAT and port forwarding) and outbound traffic, and via Hall on the router itself for administration of public hosts.
The Hall network itself doesn't have any hosts on it (apart from the routers and the public proxy), it's purely about transit. Configuring all of these routers with all of the known routes would be a bit of pain though, but of course that problem has been solved long ago with routing protocols. The DSL router supports the use of RIPv2, the Routing Information Prototocol, on LAN1, and Quagga also has a RIP daemon as well.
This means whenever I add a new network or subnet, or start or stop one, the other routers will know about it (or forget about it) within a minute or two and it should be possible to reach the hosts via their IP addresses within a minute or two, subject to firewall rules of course.
Routing IPv6
This will be a separate article, not least because right now it's mostly disabled due to disputes between major hosting providers and Hurricane Electric who I was using as a workaround for my ISP's total indifference to IPv6 despite their parent company supporting it for their direct customers.
But it's similar principles to IPv4 in terms of structure with a /48 address allocation from Hurricane Electric subnetted into a /64 for each network going through the same firewall router VMs as I'm using for IPv4. And for a long time it worked quite nicely too.
RIPng is also supported by the DSL router and the internal firewall/router VMs via the Quagga RIPng daemon.
Routing IPX/SPX
Just kidding. I haven't touched IPX for the best part of 20 years now and I doubt I'll ever see it again.
Internal DNS
"it's always the bl**dy DNS..." is a common curse whenever things stop talking on networks.
When I installed my first House Server following the advice from Microsoft the internal network was set up as house.local, which was a common approach back then as the .local domain didn't really exist anywhere. Then Apple decided to adopt .local for their Bonjour auto-configuration protocol and things basically got messy. In the end I had to do a domain rename (which years later caused some issues with Samba) using a subdomain of a registered DNS name I own which is now the recommended best practice.
For the sake of convention I will refer to the internal DNS using the officially reserved domain for documentation example.com as the top level, just as address ranges have all been normalised a least within this article.
The House, Test and Sandpit networks all have their own DNS domain, which are house.example.com, test.example.com and sandpit.example.com as this keeps it simple. They're all used as Samba domain names with the Samba servers providing the DNS service and they're not resolvable outside of my house network.
Having to manually configure DNS forwarding for all this internal domains on every DNS server every time something changes would not be fun so I'm using two techniques to do this semi-automatically.
The first is to install DNSmasq on the gateway VM with 4 configurations:
- Accept DNS queries from any internal host
- Cache all responses - this speeds up name resolution and reduces network traffic on the DSL link
- Forward any requests for its own sub-domain to the Samba servers for resolution
- Forward all requests for any other domain to the DSL router
This second is to use the conditional DNS forwarding capability of my DSL router so when creating an internal subdomain I just need to add the IP address of the gateway VM to the list to make it resolvable from any other internal host.
This means a request to connect mail.test.example.com host will be made to the configured DNS server e.g. samba.house.example.com in the first instance. It is configured to forward all requests for other domains to the gateway VM which may respond with a cached result. If not, the gateway VM will request the address from the DSL router which is configured to forward it to the gateway VM for test.example.com. The test gateway may then reply from its own cache, or forwrd the request to the Test DNS server(s).
This does have a couple of drawbacks:
- If a host changes its IP address then it may be a while before cached queries in the gateway VMs expire. This can be tuned by setting the an appropriate TTL value on DNS.
- If I query a host while it's offline DNSmasq will cache the unknown host response by default which cause problems when the host comes back online. The negative caching can be disabled if this is a problem.
Requests for internet sites follow a similar path as far as the the DSL Router, which then not finding any forwarding configuration will then send it on to the configured DNS servers for the internet - whatever your ISP provides unless you've overridden to something like cloudflare DNS instead.
DNS Aliases for External Access
This creates a bit of an issue for mobile devices that need to connect to internally-hosted services such as mail and calendar both when I'm at home and when I'm traveling however. Unless your applications can be configured to use different hostnames depending on the location, the solution to this is to use DNS aliases for those services.

For external access, create a record for calendar.example.com on the public DNS server and give it the external IP address of the DSL router, 42.451.5.1011 in this example. The traveling laptop will then connect to port 443 on the DSL router which forwards to the to the internal address of the Nextcloud server.
For internal access, the DSL router has a "LAN DNS" capability so requests for any configured domain name will be resolved to the specified internal address. So I can configure calendar.example.com to resolve to 192.168.200.19 for internal users
The internal DNS for house.example.com will forward the request to the DSL router (I've omitted the internal firewall / DNS caches mentioned above for clarity) which will return 192.168.200.19 and the calendar will connect.
This approach relies on the Public DNS having the public IP of the DSL router - ideally this will be a static address otherwise it will need a dynamic DNS configuration to update the public DNS server every time the routers public IP refreshes. It also relies on the housecloud server having the alias hostname in the SAN list of its TLS certificate.
I can do this for any service I wish to have access to from outside, with the caveat that is must be secure, and preferably connected via a proxy which can do some additional checks and block access attempts from suspicious hosts. This will be the subject of a future article.
This also has the advantage that if I ever need to replace the host for the service all I need to do do is reconfigure the internal LAN DNS and forwarding rule to point to the new host to enable people to connect.
Update
I originally had all the house servers and PCs etc on a single subnet. With the deployment of the new mail and Nextcloud servers I created a separate applications subnet (and a corresponding test applications subnet) but these are entirely contained within the ESXi server on their own vSwitch and port group so there's no impact on the VLAN design. Access to those servers is via one of the router VMs which is connected to the backup VLAN.)
Bootnote
1The public IPv4 addresses are not real or even legal. I could have used a TESTNET address but this is more interesting. Each part of the address has a literary reference if you fancy a little puzzle.