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 an interface. Interfaces can include the management port and switch virtual interfaces (SVIs).

Guidelines and Limitations for DHCP

DHCP has the following configuration guidelines and limitations:

  • For secure POAP, make sure that DHCP snooping is enabled and firewall rules are set to block unintended or malicious DHCP servers.


    Note


    The firewall rules should be correctly setup for configuring secure POAP.



Note


For DHCP configuration limits, see the Cisco Nexus 3550-T Verified Scalability Guide.

Configuring DHCP

Enabling DHCP Client

You can use the DHCP client feature to enable the configuration of an IPv4 address on management 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

Choose:

  • 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) Do the following:

  • show running-config interface mgmt 0

Example:

switch(config-if)# show running-config interface mgmt. 0
(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 the DHCP client feature can be used to assign an IPv4 address to a VLAN interface:

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
interface Vlan7
no shutdown
ip address dhcp

Additional References for DHCP

Related Documents

Related Topic

Document Title

Layer 3 virtualization

Cisco Nexus 9000 Series NX-OS Unicast Routing Configuration Guide

Standards