You configure your edge gateways to provide Dynamic Host Configuration Protocol (DHCP) services to VMs connected to the associated organization virtual data center (VDC) networks in VMware Cloud Director.

As described in the NSX documentation, an NSX edge gateway capabilities include IP address pooling, one-to-one static IP address allocation, and external DNS server configuration. Static IP address binding is based on the managed object ID and interface ID of the requesting client virtual machine.

The DHCP service for an NSX edge gateway:
  • Listens on the internal interface of the edge gateway for DHCP discovery.
  • Uses the IP address of the internal interface of the edge gateway as the default gateway address for all clients.
  • Uses the broadcast and subnet mask values of the internal interface for the container network.
In the following situations, you need to restart the DHCP service on the client virtual machines that have the DHCP-assigned IP addresses:
  • You changed or deleted a DHCP pool, default gateway, or DNS server.
  • You changed the internal IP address of the edge gateway instance.
Note: If the DNS settings on a edge gateway which has DHCP activated are changed, the edge gateway might stop providing DHCP services. If this situation occurs, use the DHCP Service Status toggle on the DHCP Pools screen to deactivate and then reactivate DHCP on that edge gateway. See Add a DHCP IP Pool on an NSX Data Center for vSphere Edge Gateway in the VMware Cloud Director Tenant Portal.

Add a DHCP IP Pool on an NSX Data Center for vSphere Edge Gateway in the VMware Cloud Director Tenant Portal

You can configure the IP pools needed for a DHCP service of an NSX Data Center for vSphere edge gateway. DHCP automates IP address assignment to virtual machines connected to organization virtual data center networks.

As described in the NSX Administration documentation, the DHCP service requires a pool of IP addresses. An IP pool is a sequential range of IP addresses within the network. Virtual machines protected by the edge gateway that do not have an address binding are allocated an IP address from this pool. IP pool ranges cannot intersect one another, thus one IP address can belong to only one IP pool.

Note: At least one DHCP IP pool must be configured to have the DHCP service status turned on.

Procedure

  1. Open Edge Gateway Services.
    1. From the primary left navigation panel, select Networking and from the page top navigation bar, select Edge Gateways.
    2. Select the edge gateway that you want to edit, and click Services.
  2. Navigate to DHCP > Pools .
  3. If DHCP service is not currently enabled, turn on the DHCP Service Status toggle.
    Note: Add at least one DHCP IP pool before saving changes after turning on the DHCP Service Status toggle. If no DHCP IP pools are listed on the screen and you turn on the DHCP Service Status toggle and save the changes, the screen displays with the toggle turned off.
  4. Under DHCP Pools, click the Create (Add button) button, specify the details for the DHCP pool, and click Keep.
    Option Description
    IP Range Type in a range of IP addresses.
    Domain Name Domain name of the DNS server.
    Auto Configure DNS Turn on this toggle to use the DNS service configuration for this IP pool DNS binding.

    If enabled, the Primary Name Server and Secondary Name Server are set to Auto.

    Primary Name Server When you do not enable Auto Configure DNS, type your primary DNS server IP address of your primary DNS server.

    This IP address is used for hostname-to-IP address resolution.

    Secondary Name Server When you do not enable Auto Configure DNS, type your secondary DNS server IP address.

    This IP address is used for hostname-to-IP address resolution.

    Default Gateway Type the default gateway address.

    When you do not specify the default gateway IP address, the internal interface of the edge gateway instance is taken as the default gateway.

    Subnet Mask Type the subnet mask of the edge gateway interface.
    Lease Never Expires Enable this toggle to keep the IP addresses that are assigned out of this pool bound to their assigned virtual machines forever.

    When you select this option, Lease Time is set to infinite.

    Lease Time (Seconds) Length of time (in seconds) that the DHCP-assigned IP addresses are leased to the clients.

    The default lease time is one day (86400 seconds).

    Note: You cannot specify a lease time when you select Lease never expires.
  5. Click Save changes.

Results

VMware Cloud Director updates the edge gateway to provide DHCP services.

Add DHCP Bindings To an NSX Data Center for vSphere Edge Gateway in the VMware Cloud Director Tenant Portal

If you have services running on a virtual machine and do not want the IP address to be changed, you can bind the virtual machine MAC address to the IP address. The IP address you bind must not overlap a DHCP IP pool.

Prerequisites

You have the MAC addresses for the virtual machines for which you want to set up bindings.

Procedure

  1. Open Edge Gateway Services.
    1. From the primary left navigation panel, select Networking and from the page top navigation bar, select Edge Gateways.
    2. Select the edge gateway that you want to edit, and click Services.
  2. On the DHCP > Bindings tab, click the Create (Add button) button, specify the details for the binding, and click Keep.
    Option Description
    MAC Address Type the MAC address of the virtual machine that you want bound to the IP address.
    Host Name Type the host name you want set for that virtual machine when the virtual machine requests a DHCP lease.
    IP Address Type the IP address you want bound to the MAC address.
    Subnet Mask Type the subnet mask of the edge gateway interface.
    Domain Name Type the domain name of the DNS server.
    Auto Configure DNS Enable this toggle to use the DNS service configuration for this DNS binding.

    If enabled, the Primary Name Server and Secondary Name Server are set to Auto.

    Primary Name Server When you do not select Auto Configure DNS, type your primary DNS server IP address of your primary DNS server.

    This IP address is used for hostname-to-IP address resolution.

    Secondary Name Server When you do not select Auto Configure DNS, type your secondary DNS server IP address.

    This IP address is used for hostname-to-IP address resolution.

    Default Gateway Type the default gateway address.

    When you do not specify the default gateway IP address, the internal interface of the edge gateway instance is taken as the default gateway.

    Lease Never Expires Enable this toggle to keep the IP address bound to that MAC address forever.

    When you select this option, Lease Time is set to infinite.

    Lease Time (Seconds) Length of time (in seconds) that the DHCP-assigned IP addresses are leased to the clients.

    The default lease time is one day (86400 seconds).

    Note: You cannot specify a lease time when you select Lease never expires.
  3. Click Save changes.

Configuring DHCP Relay for NSX Data Center for vSphere Edge Gateways in the VMware Cloud Director Tenant Portal

You can use the DHCP relay capability that NSX provides in your VMware Cloud Director environment to leverage your existing DHCP infrastructure from within your VMware Cloud Director environment without any interruption to the IP address management in your existing DHCP infrastructure.

DHCP messages are relayed from virtual machines to the designated DHCP servers in your physical DHCP infrastructure, which allows IP addresses controlled by the NSX software to continue to be synchronized with IP addresses in the rest of your DHCP-controlled environments.

The DHCP relay configuration of an edge gateway can list several DHCP servers. Requests are sent to all listed servers. While relaying the DHCP request from the VMs, the edge gateway adds a gateway IP address to the request. The external DHCP server uses this gateway address to match a pool and allocate an IP address for the request. The gateway address must belong to a subnet of the edge gateway interface.

You can specify a different DHCP server for each edge gateway and can configure multiple DHCP servers on each edge gateway to provide support for multiple IP domains.

Note:
  • DHCP relay does not support overlapping IP address spaces.
  • DHCP relay and DHCP service cannot run on the same vNIC at the same time. If a relay agent is configured on a vNIC, a DHCP pool cannot be configured on the subnets of that vNIC. See the NSX Administration Guide for details.

Specify a DHCP Relay Configuration for an NSX Data Center for vSphere Edge Gateway in the VMware Cloud Director Tenant Portal

The NSX software in your VMware Cloud Director environment provides the capability for the edge gateway to relay DHCP messages to DHCP servers external to your VMware Cloud Director organization virtual data center. You can configure the DHCP relay capability of the edge gateway.

As described in the NSX Administration documentation, the DHCP servers can be specified using an existing IP set, IP address block, domain, or a combination of all of these. DHCP messages are relayed to every specified DHCP server.

You must also configure at least one DHCP relay agent. A DHCP relay agent is an interface on the edge gateway from which the DHCP requests are relayed to the external DHCP servers.

Prerequisites

If you want to use an IP set to specify a DHCP server, verify that an IP set exists as a grouping object available to the edge gateway. See Create an IP Set for Use in Firewall Rules and DHCP Relay Configuration by Using Your VMware Cloud Director Tenant Portal.

Procedure

  1. Open Edge Gateway Services.
    1. From the primary left navigation panel, select Networking and from the page top navigation bar, select Edge Gateways.
    2. Select the edge gateway that you want to edit, and click Services.
  2. Navigate to DHCP > Relay.
  3. Use the on-screen fields to specify the DHCP servers by IP addresses, domain names, or IP sets.
    You select from existing IP sets using Add ( Add button) button to browse the available IP sets.
  4. Configure a DHCP relay agent and add its configuration to the on-screen table by clicking the Add (Add button) button, selecting a vNIC and its gateway IP address, and then clicking Keep.
    By default, the Gateway IP Address matches the primary address of the selected vNIC. You can keep the default or select an alternate address if one is available on that vNIC.
  5. Click Save changes.