Protect The Esxi Virtual Machines With Openbsd
Protect The Esxi Virtual Machines With Openbsd
TuM'Fatig
I.T. experiment's results made public
I own a server at Online.net which now runs VMware ESXi free edition. The thing is VMs
have to access the Wild Wild Web and provide public services while still being protected. So
let’s configure OpenBSD to do so.
1 of 6 18/4/2020, 2:07 pm
Protect the ESXi virtual machines with OpenBSD - TuM'Fatig https://www.tumfatig.net/20191031/protect-the-esxi-virtual-machines-wi...
Purchase an extra IP
From the Online.net user interface, buy a fail-over IP. Affect this IP as a secondary IP for the
ESXi server. Add a virtual MAC address to the secondary IP.
Write down the IP and MAC. They’ll be used by the OpenBSD virtual machine.
First of all, I rename the default VM port group so I can identify it easily:
Finally, I sync the configuration with the persistent storage and have the vSphere Web
Client aware of that configuration.
2 of 6 18/4/2020, 2:07 pm
Protect the ESXi virtual machines with OpenBSD - TuM'Fatig https://www.tumfatig.net/20191031/protect-the-esxi-virtual-machines-wi...
In my testings, the vSphere Web Client wouldn’t show the vSwitch and Port Group
modifications if not reloaded. Furthermore, the ESXi lost the configuration on reboot if not
manually synced.
Selecting FreeBSD makes the ESXi happy with OS identification. One can use “Other” but
“Status” will end in “Warning” mode rather than “Normal”.
The virtual machine will have two virtual NICs. The first one is linked to the “Public Network”
and requires the virtual MAC from the previous step. The second one is simply linked to the
“Private Network”.
Network Adapter 1
Port Group = “Public Network”
Adapter Type = “VMXNET 3”
MAC Address = “Manual”
MAC Address value = <insert the virtual MAC you got from Online.net>
Network Adapter 2
Port Group = “Private Network”
Adapter Type = “VMXNET 3”
Upload the OpenBSD installation ISO to a datastore, attach it to the VM and boot to run the
3 of 6 18/4/2020, 2:07 pm
Protect the ESXi virtual machines with OpenBSD - TuM'Fatig https://www.tumfatig.net/20191031/protect-the-esxi-virtual-machines-wi...
installation program.
Installation specifics
The OpenBSD virtual machine will use the secondary IP address as its public IP. But the
default gateway has to be configured to be the primary IP address of the ESXi host. Both
not being part of the same network, there is a need to create a static network route.
<secondary_ip>
<primary_ip>
<primary_ip>
Apply that configuration to the installed VM. Either by modifying the files on the disk
before rebooting. Or by configuring the network from the virtual machine console on
reboot.
<secondary_ip>
<primary_ip>
<primary_ip>
<private_ip>
4 of 6 18/4/2020, 2:07 pm
Protect the ESXi virtual machines with OpenBSD - TuM'Fatig https://www.tumfatig.net/20191031/protect-the-esxi-virtual-machines-wi...
In my case, the virtual machine will host a dhcpd(8) so that the testing VMs easily get IPs, an
httpd(8) server to allow internal autoinstall for other OpenBSD VMs, an unbound(8) and
ntpd(8) for the whole LAN and a relayd(8) to publish services from the LAN to the Internet.
pf(4) limits what can come into the LAN and what can go out of it. Read the man pages to
configure each of those.
It would be possible to add extra vNIC and vSwitch to implement DMZ, staging networks
and “workstation” zones.
I have configured ESXi to autostart a bunch of VMs. But I also have configured the router
VM with an encrypted disk. Which means that on reboot, nothing shall go in or out of the
LAN until I enter the passphrase. Consider this pros/cons is up to you.
If you went that far, you have no excuse now to continue running pfSense on your ESXi
Share this:
Like this:
5 of 6 18/4/2020, 2:07 pm
Protect the ESXi virtual machines with OpenBSD - TuM'Fatig https://www.tumfatig.net/20191031/protect-the-esxi-virtual-machines-wi...
Joel Carnat Thu, 31 Oct 2019 14:39:52 +0100 Technology esxi, openbsd, pf, route, vmware, vswitch
This site uses Akismet to reduce spam. Learn how your comment data is processed.
TuM'Fatig
6 of 6 18/4/2020, 2:07 pm