Configure Virtual DHCP Server on ESXi 7.0 using PfSense Physical Switch
In this article, we will discuss how to configure a virtual DHCP server on ESXi 7.0 using PfSense physical switch. This setup is useful when you want to extend the DHCP service provided by PfSense to physical devices outside the virtual environment, such as laptops and PCs connected to the same network.
Prerequisites
Before we begin, make sure you have the following:
- ESXi 7.0 hypervisor installed and running
- PfSense router/firewall installed and configured
- Physical switch connected to PfSense and ESXi
- Virtual machine configured on ESXi with at least one network interface card (NIC) connected to the physical switch
Configure PfSense DHCP Server
The first step is to configure the DHCP server on PfSense. Here are the steps:
- Log in to the PfSense web interface.
- Navigate to Services > DHCP Server.
- Click on the + button to add a new DHCP server.
- Select the interface that is connected to the physical switch.
- Enter the starting and ending IP addresses for the DHCP range.
- Enter the DNS server IP address(es).
- Click Save and then Apply Changes.
Configure Virtual DHCP Server on ESXi
Next, we need to configure the virtual DHCP server on ESXi. Here are the steps:
- Log in to the vSphere Client and connect to the ESXi host.
- Navigate to the virtual machine that you want to configure as the virtual DHCP server.
- Edit the virtual machine settings and add a new network interface card (NIC).
- Connect the new NIC to the virtual switch that is connected to the physical switch.
- Install a virtual appliance or operating system that supports DHCP server functionality, such as Ubuntu Server or Windows Server.
- Configure the DHCP server on the virtual appliance or operating system. Make sure to use a different IP address range than the one used by the PfSense DHCP server.
- Test the virtual DHCP server by connecting a physical device to the network and verifying that it receives an IP address from the virtual DHCP server.
Troubleshooting
If you encounter issues with the virtual DHCP server, here are some troubleshooting steps:
- Check the virtual switch configuration to ensure that it is connected to the correct physical switch.
- Check the DHCP server configuration on both PfSense and the virtual appliance or operating system to ensure that they are using different IP address ranges.
- Check the physical switch configuration to ensure that it is passing traffic between the PfSense router/firewall and the virtual appliance or operating system.
- Check the logs on both PfSense and the virtual appliance or operating system for any error messages or warnings.