---
title: "DHCP Configuration in NSX"
description: "Learn how to add a DHCP server to a segment"
url: https://docs.ovhcloud.com/en/guides/hosted-private-cloud/powered-by-vmware/nsx-configure-dhcp-onsegment
lang: en
lastUpdated: 2023-02-27
---
# DHCP Configuration in NSX

## Objective

**Learn how to configure a DHCP server in a segment**

:::warning
OVHcloud provides services for which you are responsible, with regard to their configuration and management. It is therefore your responsibility to ensure that they work properly.

This guide is designed to assist you as much as possible with common tasks. However, we recommend contacting a [specialist provider](https://partner.ovhcloud.com/en-gb/directory/) if you experience any difficulties or doubts when it comes to managing, using or setting up a service on a server.

:::

## Requirements

- Being an administrative contact of your [Hosted Private Cloud infrastructure](https://www.ovhcloud.com/en-gb/enterprise/products/hosted-private-cloud/) to receive login credentials
- A user account with access to the <ManagerLink to="/">OVHcloud Control Panel</ManagerLink>
- Having **NSX** deployed with two overlay and VLAN segments configured in your NSX configuration. Use our guide on [segment management in NSX](/en/guides/hosted-private-cloud/powered-by-vmware/nsx-segment-management.md) for more information.

## Instructions

We will configure DHCP for :

- An overlay segment behind the gateway **ovh-T1-gw**
- A segment on a VLAN connected to the gateway **ovh-T1-gw**.

### Common DHCP configuration for all overlay segments

First we will create a DCHP server common to all segments in Overlay.

Through the NSX interface, go to the `Networking
` tab and click on `Networking Profiles
` on the left in the **Settings**
 section. Then go to the `DHCP
` tab and click `ADD DHCP PROFILE
`.
![01 Common DHCP configuration 01](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/01-common-dhcp-configuration01.png)
Type `Name
` in **Name**
 and click `SAVE
`.
![01 Common DHCP configuration 02](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/01-common-dhcp-configuration02.png)
The DCHP server is active, it uses a network in 100.96.0.1/30, do not use this network in one of your segments.

![01 Common DHCP configuration 03](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/01-common-dhcp-configuration03.png)
### DHCP assignment to the ovh-T1-gw gateway

In the `Networking
` tab, click on `Tier-1-Gateways
` on the left in the **Connectivity**
 section.
![02 Attach DHCP to OVHT1 GATEWAY 01](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway01.png)
Click the `three vertical dots
` and choose `Edit
` from the menu.
![02 Attach DHCP to OVHT1 GATEWAY 02](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway02.png)
Click `Set DHCP Configuration
`.
![02 Attach DHCP to OVHT1 GATEWAY 03](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway03.png)
Choose `DHCP Server
` from **Type**
 and your `DHCP profile
` from **DHCP Server Profile**
. Then click `SAVE
`.
![02 Attach DHCP to OVHT1 GATEWAY 04](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway04.png)
Click `SAVE
`.
![02 Attach DHCP to OVHT1 GATEWAY 05](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway05.png)
Click `CLOSE EDITING
`.
![02 Attach DHCP to OVHT1 GATEWAY 06](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/02-attach-dhcp-to-ovht1-gateway06.png)
### Setting up DHCP on an Overlay segment

From the NSX interface, go to the `Networking
` tab and click on `Segments
` on the left in the **Connectivity**
 section.
Go to the `Segments
` section, click on the configuration icon indicated with `three vertical dots
` to the left of your segment and choose `Edit
`.
![03 add DHCP ON Segment 01](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/03-configure-dhcp-overlay-segment01.png)
Click `Set DHCP CONFIG
`.
![03 add DHCP ON Segment 02](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/03-configure-dhcp-overlay-segment02.png)
Fill in this information :

- **DHCP Type** : Leave <code className="action">DHCP Server Gateway</code>.
- **DHCP Ranges** : Enter your range <code className="action">192.168.1.10-192.168.1.200</code>.
- **DNS Servers** : Add OVHcloud DNS server <code className="action">213.186.33.99</code>.

Click on `APPLY
`.
![03 add DHCP ON Segment 03](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/03-configure-dhcp-overlay-segment03.png)
Click `SAVE
`.
![03 add DHCP ON Segment 04](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/03-configure-dhcp-overlay-segment04.png)
Click `CLOSE EDITING
`.
![03 add DHCP ON Segment 05](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/03-configure-dhcp-overlay-segment05.png)
Virtual machines in this segment can now be configured with DHCP.

### Setting up DCHP on a VLAN segment

On a VLAN segment it is not possible to use the profile created for Overlay segments.

In order to have a DHCP server on this segment, we will create a DHCP configuration with a new profile directly attached to the segment.

If you do not have a VLAN type segment, use the [Segment Management in NSX](/en/guides/hosted-private-cloud/powered-by-vmware/nsx-segment-management.md) guide to create it with these settings :

- **VLAN Subnet**: 192.168.100.0/24.
- **Gateway and interface IP address** : 192.168.100.254/24.

Go to the `Networking
` tab, click on `Segments
` on the left in the **Connectivity**
 section, then click on the `three vertical dots
` on the left of your VLAN segment and choose `Edit
` from the menu.
![04 Configure DHCP fo VLAN SEGMENT 01](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-01.png)
Click `SET DHCP CONFIG
`.
![04 Configure DHCP fo VLAN SEGMENT 02](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-02.png)
Leave `Local DHCP Server
` in **DHCP Type**
, click the `three vertical dots
` to the right of **DHCP Profile**
 and choose `Create New
` from the menu.
![04 Configure DHCP fo VLAN SEGMENT 03](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-03.png)
Enter this information :

- **Name**: Leave `DHCP-VLAN100`.
- **Server IP Address** : IP address of DHCP server `192.168.100.253/24`.

Then select your `Edge Cluster
` and click `SAVE
`.
![04 Configure DHCP fo VLAN SEGMENT 04](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-04.png)
Verify in **DHCP Profile** that the profile is present and enter this information :

- **DHCP Server** : DHCP server address `192.168.100.253/24`.
- **DHCP Ranges** : DHCP Server range `192.168.100.10-192.168.100.200`.
- **DNS Servers** : OVHcloud DNS server IP address `213.186.33.99`.

Then click `APPLY
`.
![04 Configure DHCP fo VLAN SEGMENT 05](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-05.png)
Click `SAVE
`.
![04 Configure DHCP fo VLAN SEGMENT 06](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-06.png)
Click `CLOSE EDITING
`.
![04 Configure DHCP fo VLAN SEGMENT 07](/images/hosted-private-cloud/powered-by-vmware/nsx-03-configure-dhcp-onsegment/04-configure-dhcp-for-vlan-segment-07.png)
The DHCP server is active on this VLAN segment.

## Go further [](#)
[Getting started with NSX](/en/guides/hosted-private-cloud/powered-by-vmware/nsx-first-steps.md)

[Segment management in NSX](/en/guides/hosted-private-cloud/powered-by-vmware/nsx-segment-management.md)

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://www.ovhcloud.com/en-gb/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.

Join our community of users on [https://community.ovh.com/en/](https://community.ovh.com/en/).
