Proxmox Homelab
Purpose of This Lab
This lab is focused on understanding network segmentation using VLANs and subnets. The objective was achieved on Linux Containers and virtualization with the use of Proxmox running on an Optiplex 3050. Additionally, a dhcp-server was setup to assign IP addresses to VLAN 10 and VLAN 20 using dnsmasq. The lab is quite the learning experience as it features the realtime complete client-server communication during DORA procedure.

The lab starts off by creating a virtual linux bridge vmbr1, which would act as our virtual switch. The bridge vmbr1 is VLAN-aware, giving us two VLANs, vmbr1.10 and vmbr1.20. These two will be handling the networks 10.0.10.0/24 and 10.0.20.0/24 respectively. The commented interfaces can be seen in the following image:

The proxmox host itself is connected to both of these networks at 10.0.x.1 addresses for both subnets acting as the gateway.
Next, an alpine LXC was created to act as the dhcp-server. Both vmbr1.10 and vmbr1.20 were connected to this LXC as eth1 and eth2. We can see it running with an VMID of 100 with the required network configuration.

dnsmasq was then installed to this alpine LXC. dns was disabled using port=0 and both interfaces were initialized. After running syntax checks and configuring the required dhcp options, the server was ran in the --no-daemon mode to observe the logs. Two alpine LXCs, client1 and guest1 were created and connected to VLAN 10 and 20 respectively. IP addresses were assigned by the dhcp-server as expected.

The guest1 LXC was then tested for internet connectivity by pinging the dhcp-server, gateway, and dns servers. The required results were achieved.

The dhcp-server was then configured to assign a static IP address to a server on VLAN10, based on its MAC address with the following configuration:

A server LXC was then created with IPv4 set to DHCP. As expected, a static IP address with no expiry was assigned by the dhcp-server.
Server on its first boot:

dhcp-server LXC assigning static IP:

The required behaviour was confirmed by /var/lib/misc/dnsmasq.leases. The dhcp-server was then configured to have its log-facility as a file for better journaling and auditing purposes.
