One of the services that the NSX Edge (ESG) provides is IP address pooling and one-to-one static IP address allocation and external DNS services. NSX Edge listens to the internal interface for DHCP requests and uses the internal interface IP as the default gateway for clients. In this post, I’ll show you how to configure DCHP on the NSX Edge to provide IP addresses to clients on a logical switch.
First, navigate to Networking & Security > NSX Edges and select you ESG. Then navigate to Manage > DHCP > Pools. Under Pools, click the green “+”.
Enter in the IP address range that will be used by VMs making DHCP requests. Also enter in the DNS, Default Gateway, and Subnet Mask. The default gateway in this instance is the internal IP of my distributed logical router. Click Ok.
Click Publish Changes when it appears at the top of the screen so that our changes will be applied to the ESG.
Now we want to navigate to our DLR to setup the DHCP relay. A DHCP relay specifies the external DHCP server. It can be a IP set or a number of IP addresses or both. Select your DLR under Networking & Security > NSX Edges and under Manage > DHCP Relay, click Edit.
In the IP Addresses: section, we want to enter in the IP address for the internal interface of our ESG. Click Ok.
Now, we need to configure the DHCP Relay Agent. The DHCP Relay agent tells which interface to forward all DHCP requests to for the external DHCP servers. Under DHCP Relay Agents, click the green “+”.
Select the interface that connects to the logical switch that your VMs are on that will need IP addresses via DHCP. Click OK.
Publish the Changes on the DLR
Now we should be able to console into our VM and see that it has grabbed a IP address from our DHCP pool. You may need to restart DHCP services on the VM in some cases or in a command prompt enter ipconfig /renew.
The NSX edge is a very versatile appliance that can provide a number of services and DHCP is one of those.