Configuring DHCP

This chapter describes how to configure the Dynamic Host Configuration Protocol (DHCP) on a Cisco NX-OS device.

This chapter includes the following sections:

About DHCP Client

The DHCP client feature enables the configuration of an IPv4 address on the management port.

Guidelines and Limitations for DHCP

DHCP has the following configuration guidelines and limitations:

  • Only DHCP client is supported.

  • No support for DHCPv6 (or IPv6).

  • PowerOn Auto Provisioning (POAP) can be used for the DHCP client. Restrictions for POAP:

    • POAP is supported only on the management port.

    • No support for IPv6.

    For more details about POAP, see the Fundamentals Guide.

Enabling DHCP Client

You can use the DHCP client feature to enable the configuration of an IPv4 address on an interface.


Note


DHCP client is independent of the DHCP relay processes, so it does not require that the feature dhcp command be enabled.


Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

interface mgmt 0

Example:

switch(config)# interface mgmt 0
switch(config-if)#
  • Enters interface configuration mode and specifies the management interface as the interface for which you want to enable the DHCP client feature.

Step 3

[no] {ip } address dhcp

Example:

switch(config-if)# ip address dhcp

Assigns an IPv4 address to the interface.

The no form of this command releases the IP address.

Step 4

(Optional) Run the show running-config interface mgmt 0 command.

(Optional)

Displays the IPv4 address assigned to the interface in the running configuration.

Step 5

(Optional) copy running-config startup-config

Example:

switch(config-if)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Only the {ip} address dhcp command is saved. The assigned IP address is not saved even though it shows in the running configuration.

Configuration Examples for DHCP Client

The following example shows how to use the DHCP client feature:

switch# configure terminal
switch(config)# interface mgmt 0
switch(config-if)# no shutdown
switch(config-if)# ip address dhcp
switch(config-if)# show running-config interface vlan 7