Introduction
This is the second post covering deploying a Proxmox node for a cyber security home lab. With our first node configured and our firewall/router operational, we’ll move onto the next two nodes. There’s an important caveat here. I initially only had a Raspberry Pi for the quorum device. Please revisit the first article as I added a cheap GMKtec node that could actually run some workloads as well, and changed the VLAN20 cluster network setup. These instructions are left here for anyone who may just be using a third device for quorum only but are now no longe required.
This was also done the hard way, with a jump host into the quorum device to prevent us from needing to access the cluster traffic VLAN.
- Set up the second node to mirror the first.
- Set up a Raspberry Pi quorum device.
- Create the Proxmox cluster on node one.
Proxmox Node Two & Node Three
- Follow the same steps from the first article to install Proxmox and execute the storage plan. Both my nodes are identical in respect of hardware between node one and two, so with the exception of a different hostname and IP address, the remaining tasks were identical to the first node.
- Configure the networking as per the first article. Noting an increment to the IP for the
enp4s0f1interface for the cluster network:- Node 2:
192.168.20.3 - Node 3:
192.168.20.4
- Node 2:
The GMKTec
- This host only has one storage drive which is shared with Proxmox OS. I did not set up the ZFS pools.
- Networking was also different. This is a transitional workaround due to limited switch ports. The ideal configuration would have
enp3s0on its own switch port carrying192.168.20.4/24directly, matching the Lenovo node configuration.
[!NOTE] Proxmox’s network GUI does not support adding secondary IP addresses to an existing interface. We edit
/etc/network/interfacesdirectly for this reason.
-
Open a shell.
-
vi /etc/network/interfaces(ornanoinstead ofviif you prefer). -
Note the
post-upandpre-downcommands that I have added to the configuration:iface vmbr0 inet static address 192.168.0.22/24 gateway 192.168.0.1 bridge-ports enp1s0 bridge-stp off bridge-fd 0 bridge-vlan-aware yes bridge-vids 2-4094 post-up ip addr add 192.168.20.4/24 dev vmbr0 pre-down ip addr del 192.168.20.4/24 dev vmbr0 -
:wqto save and exit. -
systemctl restart networkingto apply our changes. -
ip addr show vmbr0to verify we see the IP:ip addr show vmbr0 : vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether e0:51:d8:19:30:14 brd ff:ff:ff:ff:ff:ff inet 192.168.0.22/24 scope global vmbr0 valid_lft forever preferred_lft forever inet 192.168.20.4/24 scope global vmbr0 valid_lft forever preferred_lft forever inet6 fe80::e251:d8ff:fe19:3014/64 scope link proto kernel_ll valid_lft forever preferred_lft forever
VLAN 20 Cluster Network
[!UPDATE] As per some updates in the first article, I moved away from VLAN 20 for cluster and replication traffic. I now configure the second interface directly into a private subnet. The majority of this article is no longer relevant as I also don’t use the Pi.
We have some decisions to make here from a networking and access perspective.
VLAN 20 is designed for cluster traffic, so there is no need for us to be able to access hosts on the 192.168.20.0/24 network. This means:
- We don’t need to put a route in to access the 192.168.20.0/24 network from our workstation.
- We don’t need to configure firewall rules from the workstation to this VLAN via the WAN.
- We possibly wouldn’t even need a gateway in the Pi, but we want it to be able to do OS updates.
This isolation will come at a cost of accessing and managing the quorum device, as we will need a jump host to manage the Pi. We can later set up a jump host for other parts of the network too, but let’s prep a minimal Alpine Linux container to jump from.
[!TIP]
For this to work, I had to configure the switch port as an access port for VLAN20 in my switch and set it to untagged. I also had to ensure that the trunk VLAN ports were both tagged for VLAN20.
This configuration will be highly dependent on your switch model.
Jump Host
- Datacenter > [node name] > iso-linux > CT Templates
- Click on Templates
- Select the latest alpine image.
- Click Download.
With the template downloaded…
- Click Create CT in the top right.
- Hostname:
jump, - Enter a complex password. Next,
- Select the Alpine template. Next,
- Select
bulk-pool-vmdata(configured from Part 1). Next, - Leave CPU and memory at defaults,
- VLAN Tag:
20, - IPv4:
192.168.20.10/24, - Gateway:
192.168.20.1. Next, - DNS domain: Your internal lab FQDN,
- DNS servers:
192.168.20.1. Next. - Start after created: Check. Finish.
Upon boot, login as root with the password you set.
apk updateapk upgradeapk add openssh-clientssh-keygen- I save mine with the default name but add _pi to the end. Copy the contents of the public key
id_ed25519_pi.pubto use with the Pi.
Prep the Raspberry Pi
I’ll be using a Raspberry Pi 4 for my qdevice. I prepared this on Windows:
-
Download the Raspberry Pi imager.
-
Run the Raspberry Pi imager:
- Raspberry Pi Device: Raspberry Pi 4
- Operating System: Raspberry Pi OS (64-bit)
- Select your SD card storage.
-
Customise the settings:
- Enter a hostname, username, password and locale settings. Move to services.
- Enable SSH,
- Select Allow public-key authentication only,
- Paste the public key in as an authorized_key from the keypair you just generated (ends with
.pub) as the authorized host, - Move to Options. Do not select eject media when finished.
- Save, and write your image with the custom settings.
-
I connect my pi via Ethernet to my network switch. Boot the pi and find it on your network from your router’s DHCP list.
-
SSH into the pi with the key and we will begin to configure:
ssh -i <raspberrypi_key_file> [email protected] # Replace with your Pi's DHCP address sudo apt update sudo apt upgrade sudo nmtui -
Edit a Connection > Wired Connection.
- Addresses:
192.168.20.5/24 - Gateway:
192.168.20.1 - DNS Servers
192.168.20.1 - Search Domains: Your lab FQDN.
- Addresses:
-
Select OK.
-
Back and Exit.
-
Restart the Pi.
We should then be able to login to the Pi from the jump host:
ssh [email protected] -i id_ed25519_pi
Configure the Pi
We need to allow root login and password authentication for the cluster:
sudo passwd root. Set strong password.sudo vi /etc/ssh/sshd_config.- Swap
PermitRootLogin prohibit-passwordforPermitRootLogin yes. - Add
PasswordAuthentication yes. :wqto save and quit.sudo systemctl restart sshto restart the SSH service.- Exit back to the container and try and login as root with the password you just set:
ssh [email protected].- If we have verified the root account is working then we will go ahead and install the
corosync-qnetdpackage: apt install corosync-qnetd
Configure the Cluster and QDevice
As a reference we are using the Proxmox Cluster Manager instructions from here…
- Let’s add the network for the cluster.
- Node > Network > Create > Linux VLAN.
- Name:
bond0.20 - No IPV4.
- Vlan raw device:
bond0our bonded Linux bridge. OK. - Create > Linux Bridge.
- Name:
vmbr20 - IPV4:
192.168.20.2/24. - VLAN aware: Check.
- Bridge Ports:
bond0.20 - VLAN IDs:
20 - Comment:
Cluster Network. OK. - Apply Configuration.
Repeat this on the second node, but increment the IPv4 to 192.168.20.3/24.
- Add the corosync-qdevice package on all cluster nodes. In a shell on each node run
apt install corosync-qdevice. - On the primary node:
- Datacenter > Cluster > Create Cluster.
- Cluster Name:
Tiny Clusteror your domain name or whatever you like. - Cluster Network: Select the
192.168.20.2vmbr20interface.
Replacing the Pi with a Third Node
I managed to grab a good deal on a GMKtec G2 mini at just over $100. It was substantially less than the ThinkStation nodes (with substantially less storage, RAM and networking). It is a slightly better quorum device as I can actually run Proxmox and some light workloads even with its modest specs.
Because it only has one drive in it, disregard a lot of the storage configuration and run with defaults. There are also only two 2.5GbE NICs so much of the networking configuration is ignored also.
To configure the network to be able to use the cluster replication network:
- Configure the Linux Bridge
vmbr0to be VLAN aware. - Create a Linux VLAN
vmbr0.20with a CIDR of192.168.20.4/24and no gateway. - You may need to amend your switch port configuration.
Once this node has successfully joined the cluster, we can remove the quorum device:
pvecm qdevice remove.
What’s Next?
In the next article we’ll create the cluster and join the second and third node to it.