4.2. DHCP Client Commands

4.2.1. ip address dhcp

Command Purpose

To acquire an IP address from Dynamic Host Configuration Protocol(DHCP), use the ip address dhcp command in interface configuration mode.

To disable the function, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

ip address dhcp

no ip address dhcp

Command Mode

Interface Configuration

Default

DHCP Client is not enabled on interface.

Usage

Once this command was enabled on an UP interface, it will acquire IP address immediately, otherwise the DHCP function of the interface will be in SUSPEND status.

The no ip address dhcp command will send a DHCPRELEASE message to server and remove any IP address.

Examples

The following example shows how to enable dhcp client function:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no switchport
Switch(config-if)# ip address dhcp

The following example shows how to disable dhcp client function:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no ip address dhcp

4.2.2. management ip address dhcp

Command Purpose

To acquire an IP address for management interface from by DHCP, use the management IP address dhcp command in Global Config mode.

To disable the function, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

management ip address dhcp

no management ip address dhcp

Command Mode

Global Config

Default

DHCP Client is not enabled on management interface.

Usage

Use this command like IP address dhcp.

Examples

The following example shows how to enable dhcp client function on management interface:

Switch# configure terminal
Switch(config)# management ip address dhcp

The following example shows how to disable dhcp client function on management interface:

Switch# configure terminal
Switch(config)# no management ip address dhcp

Related Commands

show dhcp client

4.2.3. dhcp client request

Command Purpose

To request configuration parameters by DHCP, use the dhcp client request command in interface configuration mode. To cancel the request, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client request ( router | static-route | classless-static-route | classless-static-route-ms | tftp-server-address | dns-nameserver | domain-name | netbios-nameserver | vendor-specific )

no dhcp client request ( router | static-route | classless-static-route | classless-static-route-ms | tftp-server-address | dns-nameserver | domain-name | netbios-nameserver | vendor-specific )

Parameter

Parameter Description

Parameter Value

router

Default router option (3)

-

static-route

Static route option (33)

-

- c lassless-static-route

Classless static route option (121)

-

- clas sless-static-route-ms

Microsoft classless static route option (249)

-

tftp-server-address

TFTP server ip address option (150)

-

dns-nameserver

DNS name server option (6)

-

domain-name

Domain name option (15)

-

netbios-nameserver

NetBIOS name server option (44)

-

vendor-specific

Vendor specific option (43)

-

Command Mode

Interface Configuration

Default

static-route, classless-static-route, classless-static-route-ms, tftp-server-address and router is requested as default.

Usage

Use this command to request configuration form DHCP server. It can be typed many times with each option or one time with all options wanted. Note that when Option 249 coexist with option 121 then the option 121 should have high priority and option 249 should be ignored. when option 121 or option 249 coexist with option 33 then the option 33 should be ignored. This command should be issued before ip address dhcp command. If you issued ip address dhcp before, this command will take effect after next ip address dhcp command.

Examples

The following example shows how to request dhcp option static-route and tftp-server-address:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no management ip address dhcp

The following example shows how to request dhcp option router:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp client request router

The following example shows how to cancel request of dhcp option router:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no dhcp client request router

The following example shows how to request tftp server address:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no ip address dhcp
Switch(config-if)# dhcp client request static-route tftp-server-address

Related Commands

ip address dhcp

4.2.4. dhcp client client-id

Command Purpose

To specify a client-id used by DHCP server and client for identifying a client, use the dhcp client client-id command in interface configuration mode.

To remove this configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client client-id ( ascii WORD | hex HEX-STRING | IFVLAN | IFAGG | IFPHYSICAL )

no dhcp client client-id

Parameter

Parameter Description

Parameter Value

ascii

ASCII type

-

WORD

Client-ID as ascii string

String with up to 64 characters

hex

Hex type

-

HEX-STRING

Class-ID in hex string

String with up to 64 characters

IFVLAN

Vlan interface`s name

1-4094

IFAGG

Aggregation interface`s name

-

IFPHYSICAL

Physical interface`s name

-

Command Mode

Interface Configuration

Default

The default client-id, format of which is like “switch-HWADDR-IFNAME”, will be used.

Usage

This command should be issued before IP address dhcp command. If you issued IP address dhcp before, this command will take effect after next IP address dhcp command.

Examples

The following example shows how to specify a client-id for an interface:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp client client-id ascii switch-client

The following example shows how to delete client-id set before:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no dhcp client client-id

Related Commands

ip address dhcp

4.2.5. dhcp client class-id

Command Purpose

To specify a class-id for DHCP server and client, use the dhcp client class-id command in interface configuration mode. To remove this configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client class-id ( WORD | hex HEX-STRING )

no dhcp client class-id

Parameter

Parameter Description

Parameter Value

WORD

Client-ID as ascii string

-

hex

Hex type

-

HEX-STRING

Class-ID in hex string

-

Command Mode

Interface Configuration

Default

No class-id is set.

Usage

Class-id used by DHCP clients to optionally identify the type and configuration of a DHCP client. Vendors and sites may choose to define specific class identifiers to convey particular configuration or other identification information about a client. This command should be issued before ip address dhcp command. If you issued ip address dhcp before, this command will take effect after next ip address dhcp command.

Examples

The following example shows how to specify class-id for an interface:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp client class-id acsii switch

The following example shows how to delete class-id set before:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no dhcp client class-id

Related Commands

ip address dhcp

4.2.6. dhcp client lease

Command Purpose

To configure the duration of the lease for an IP address request by DHCP client, use the dhcp client lease command in interface configuration mode.

To remove the configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client lease DAYS ( HOURS ( MINUTES | ) | ) | infinite )

no dhcp client lease

Parameter

Parameter Description

Parameter Value

DAYS

The number of days in lease

0-365

HOURS

The number of hours in the lease.

0-23

MINUTES

The number of minutes in the lease

0-59

infinite

infinite lease

-

Command Mode

Interface Configuration

Default

No lease is requested by client.

Usage

Use this command to specify the lease wanted by client, DHCP server may accept this request or ignore it. This command should be issued before ip address dhcp command. If you issued ip address dhcp before, this command will take effect after next ip address dhcp command.

Examples

The following example shows how to specify lease 20 minutes for dhcp client:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp client lease 0 0 20

The following example shows how to remove the lease set before:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no dhcp client lease

Related Commands

ip address dhcp

4.2.7. dhcp client hostname

Command Purpose

To specify or modify the hostname sent in the DHCP message; use the dhcp client hostname command in interface configuration mode.

To remove the hostname, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client hostname WORD

no dhcp client hostname

Parameter

Parameter Description

Parameter Value

WORD

Host name

String with up to 256 characters

Command Mode

Interface Configuration

Default

The host name in system will be used.

Usage

This command should be issued before ip address dhcp command. If you issued IP address dhcp before, this command will take effect after next IP address dhcp command.

Examples

The following example shows how to specify name of the host:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp client hostname switch

The following example shows how to remove the last set:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no dhcp client hostname

Related Commands

ip address dhcp

4.2.8. dhcp client default-router distance

Command Purpose

To specify the default router distance for the routes leased from DHCP server, use the dhcp client default-router distance command in global configuration mode. To remove the configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client default-router distance METRIC

no dhcp client default-router distance

Parameter

Parameter Description

Parameter Value

METRIC

The default metric of routes

1-255

Command Mode

Global Config

Default

The default value for the default metric is 254.

Usage

None

Examples

The following example shows how to set dhcp client default route metric as 233:

Switch# configure terminal
Switch(config)# dhcp client default-router distance 233

The following example shows how to use the default value of default route metric:

Switch# configure terminal
Switch(config)# no dhcp client default-router distance

Related Commands

ip address dhcp

4.2.9. dhcp client broadcast-flag

Command Purpose

To specify the broadcast-flag in the DHCP message, use the dhcp client broadcast-flag command in Global Config mode.

To remove this configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp client broadcast-flag

no dhcp client broadcast-flag

Command Mode

Global Config

Default

Broadcast-flag will be set in DHCP message sent by client for request IP address.

Usage

This flag tell DHCP server that client can’t receive unicast IP datagrams until been configured with an IP address. Thus server or relay agent will broadcast any messages to the client on the client’s subnet.

Examples

The following example shows how to set broadcast-flag:

Switch# configure terminal
Switch(config)# dhcp client broadcast-flag

The following example shows how to delete broadcast-flag:

Switch# configure terminal
Switch(config)# no dhcp client broadcast-flag

Related Commands

ip address dhcp

4.2.10. debug dhcp client

Command Purpose

Use this command to turn on the debug switches of dhcp client module.

To restore the default, use the no form of this command

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

debug dhcp client ( events | error | dump | packet | all )

no debug dhcp client ( events | error | dump | packet | all )

Parameter

Parameter Description

Parameter Value

events

Client events

-

error

Error DHCP message

-

packet

DHCP message fields

-

dump

Dump message in hex format

-

all

Turn all debugging on

-

Command Mode

Privileged EXEC

Default

None

Usage

Use command “terminal monitor” to make debug messages print on the VTY immediately.

Use command “show logging buffer” to check the debug messages in the logging buffer.

Examples

The following is sample to open dhcp client debug switches:

Switch# debug dhcp client all

Related Commands

terminal monitor

show logging buffer

4.2.11. show dhcp client

Command Purpose

To show information of dhcp client on one or all interfaces, use the show dhcp client command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show dhcp client ( management | IFVLAN | IFAGG | IFPHYSICAL | ) ( verbose | )

Parameter

Parameter Description

Parameter Value

management

Management interface

-

IFVLAN

Vlan interface`s name

1-4094

IFAGG

Aggregation interface`s name

-

IFPHYSICAL

Physical interface`s name

-

verbose

DHCP client verbose information

-

Command Mode

Privileged EXEC

Default

None

Usage

To see more detail information, add verbose at the last of command

Examples

The following example shows how to display DHCP client information on all interfaces:

Switch# show dhcp client verbose

DHCP client informations:
============================================================
vlan1 DHCP client information:
Current state: SELECT
Transaction ID: 0x3ac1c1c7
============================================================
eth-0-1 DHCP client information:
Current state: SELECT
Transaction ID: 0x2fd3f55b

Related Commands

ip address dhcp

4.2.12. show dhcp client statistics

Command Purpose

To show statistics of DHCP client, use the show dhcp client statistics command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show dhcp client statistics

Command Mode

Privileged EXEC

Default

None

Usage

Use this command to show the status of DHCP client, like DHCP packets counter.

Examples

The following example shows how to display DHCP packets statistics:

Switch# show dhcp client statistics

DHCP client packet statistics:
============================================================
DHCP OFFERS received: 0
DHCP ACKs received: 0
DHCP NAKs received: 0
DHCP Others received: 0
DHCP DISCOVER sent: 0
DHCP DECLINE sent: 0
DHCP RELEASE sent: 0
DHCP REQUEST sent: 0
DHCP packet send failed: 0

Related Commands

ip address dhcp

4.2.13. clear dhcp client statistics

Command Purpose

To clear statistics of dhcp client, use the clear dhcp client statistics command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clear dhcp client statistics

Command Mode

Privileged EXEC

Default

None

Usage

This command will clear DHCP packet counter.

Examples

The following example shows how to clear statistics:

Switch# clear dhcp client statistics

Related Commands

ip address dhcp

show dhcp client statistics