4.3. DHCP Relay Commands

4.3.1. dhcp relay

Command Purpose

To enable the DHCP relay service, use the dhcp relay command in global configuration mode.

To disable this 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

dhcp relay

no dhcp relay

Command Mode

Global Config

Default

DHCP relay is disabled.

Usage

The DHCP service must be enabled with the dhcp service command before DHCP relay service can be used.

Examples

The following example shows how to enable DHCP relay agent:

Switch# configure terminal
Switch(config)# dhcp relay

4.3.2. dhcp-server (global)

Command Purpose

To create a DHCP server group, use the dhcp-server command in global configuration mode.

To remove a DHCP server group, 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-server NUMBER SERVER-LIST

no dhcp-server NUMBER ( SERVER-LIST | )

Parameter

Parameter Description

Parameter Value

NUMBER

Number of the DHCP server group.

1-16

SERVER-LIST

The IP address list of the DHCP server.

1-16

Command Mode

Global Config

Default

No DHCP server group is defined.

Usage

This command is used to specify the remote DHCP server.

Examples

The following example shows how to configure dhcp-server group globally:

Switch# configure terminal
Switch(config)# dhcp-server 1 1.1.1.1 2.2.2.2 3.3.3.3

Related Commands

service dhcp

dhcp-server (interface)

4.3.3. dhcp-server (interface)

Command Purpose

To add an interface into a DHCP server group, use the dhcp-server command in interface configuration mode.

To remove this interface from the DHCP server group, 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-server NUMBER

no dhcp-server

Parameter

Parameter Description

Parameter Value

NUMBER

Number of the DHCP server group.

1-16

Command Mode

Interface Configuration

Default

No DHCP server group is configured for the interface.

Usage

This command is used to specify DHCP server group which is configured by the command dhcp-server in global mode.

Examples

The following example shows how to configure dhcp-server group for interface:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp-server 1

Related Commands

service dhcp

4.3.4. dhcp relay information check

Command Purpose

To enable validation of relay agent information option in forwarded reply messages, use the dhcp relay information check command in global configuration mode.

To disable an information check, 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 relay information check

no dhcp relay information check

Command Mode

Global Config

Default

The validation of relay agent information is enabled. Invalid messages are dropped.

Usage

None

Examples

The following example shows how to enable validation of relay agent information:

Switch# configure terminal
Switch(config)# dhcp relay information check

Related Commands

dhcp relay information option

4.3.5. dhcp relay information option

Command Purpose

To enable the system to insert a DHCP relay agent information option in forwarded request messages to a DHCP server, use the dhcp relay information option command in Global Config mode. To disable inserting relay information, 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 relay information option

no dhcp relay information option

Command Mode

Global Config

Default

No relay agent information is inserted.

Usage

The dhcp relay information option command automatically adds the circuit identifier suboption and the remote ID suboption to the DHCP relay agent information option (also called option 82).

Examples

The following example shows how to enable inserting of dhcp relay information option:

Switch# configure terminal
Switch(config)# dhcp relay information option

Related Commands

dhcp relay information check

dhcp relay information policy

4.3.6. dhcp relay information policy

Command Purpose

To configure the information re-forwarding policy for a DHCP relay agent (what a relay agent should do if a message already contains relay information), use the dhcp relay information policy command in global configuration.

To restore the default relay information policy, 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 relay information policy ( drop | keep | replace )

no dhcp relay information policy

Parameter

Parameter Description

Parameter Value

drop

Directs the DHCP relay agent to discard messages with existing relay information if the relay information option is already present

-

keep

Indicates that existing information is left unchanged on the DHCP relay agent

-

replace

Indicates that existing information is overwritten on the DHCP relay agent

-

Command Mode

Global Config

Default

The DHCP relay won’t change existing relay information.

Usage

A DHCP relay agent may receive a message from another DHCP relay agent that already contains relay information. By default, this message will be forwarded with the relay information from the previous relay agent untouched.

Examples

The following example shows how to configure policy of dhcp relay information :

Switch# configure terminal
Switch(config)# dhcp relay information policy drop

Related Commands

dhcp relay information option

dhcp relay information policy

4.3.7. dhcp relay information policy (interface)

Command Purpose

If Option 82 policy is configured on interface, the content of option 82 in packet will be processed according to the interface policy, ohterwise it will be processed according to global policy.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp relay information policy ( drop | keep | replace )

no dhcp relay information policy

Parameter

Parameter Description

Parameter Value

drop

Directs the DHCP relay agent to discard messages with existing relay information if the relay information option is already present

-

keep

Indicates that existing information is left unchanged on the DHCP relay agent

-

replace

Indicates that existing information is overwritten on the DHCP relay agent

-

Command Mode

Interface Configuration

Default

No Option 82 policy is configured on inteface.

Usage

A DHCP relay agent may receive a message from another DHCP relay agent that already contains relay information. By default, this message will be forwarded with the relay information from the previous relay agent untouched.

Examples

The following example shows how to configure policy of dhcp relay information :

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp relay information policy drop

Related Commands

dhcp relay information option

4.3.8. dhcp relay information trust-all

Command Purpose

To configure all interfaces as trusted sources of the DHCP relay agent information option, use the dhcp relay information trust-all command in Global Config mode. To restore these interfaces to their default behavior, 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 relay information trust-all

no dhcp relay information trust-all

Command Mode

Global Config

Default

All interfaces on the switch are considered entrusted.

Usage

By default, if the gateway address is set to all zeros in the DHCP packet and the relay information option is already present in the packet, the DHCP relay agent will discard the packet. If the dhcp relay information trust-all command is configured globally, the DHCP relay agent will not discard the packet even if the gateway address is set to all zeros. Instead, the received DHCPDISCOVER or DHCPREQUEST messages will be forwarded to the addresses configured by the dhcp-server command as in normal DHCP relay operation.

Examples

The following example shows how to configure dhcp relay information trust globally:

Switch# configure terminal
Switch(config)# dhcp relay information trust-all

Related Commands

dhcp relay information trusted

4.3.9. dhcp relay information trusted

Command Purpose

To configure an interface as a trusted source of DHCP relay agent information option, use the dhcp relay information trusted command in interface configuration mode. To restore the interface to the default behavior, use the no form of the command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp relay information trusted

no dhcp relay information trusted

Command Mode

Interface Configuration

Default

All interfaces on the router are considered entrusted.

Usage

By default, if the gateway address is set to all zeros in the DHCP packet and the relay information option is already present in the packet, the DHCP relay agent will discard the packet. If the dhcp relay information trusted command is configured globally, the DHCP relay agent will not discard the packet even if the gateway address is set to all zeros. Instead, the received DHCPDISCOVER or DHCPREQUEST messages will be forwarded to the addresses configured by the dhcp-server command as in normal DHCP relay operation.

Examples

The following example shows how to configure an interface as trusted source of dhcp relay information:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp relay information trusted

Related Commands

dhcp relay information trust-all

4.3.10. dhcp relay gateway

Command Purpose

To configure the DHCP relay agent address of DHCP packets, use this command in interface configuration mode.

To restore the interface to the default behavior, use the no form of the command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp relay gateway A.B.C.D

no dhcp relay gateway

Command Mode

Interface Configuration

Default

Default relay agent address is used in DHCP packet.

Usage

None

Examples

The following example shows how to configure DHCP relay agent address of DHCP packets:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# dhcp relay gateway 10.10.10.1

Related Commands

dhcp-server (interface)

4.3.11. dhcp relay address cycle

Command Purpose

Use “dhcp relay address cycle” command to enable DHCP relay cycle feature.

Use “no dhcp relay address cycle” to disable the feature.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dhcp relay address cycle

no dhcp relay address cycle

Command Mode

Global Config

Default

DHCP relay cycle is disabled by default.

Usage

This command is used for DHCP relay. When more than one DHCP servers are configured on a DHCP relay device, relay device should send DHCP DISCOVER packets to all servers by default. In this way, the servers should deal with too much packet and might be overload. To resolve this problem use this command to enable DHCP relay cycle. After configure this command, DHCP relay device send to only one server when it receive the DHCP DISCOVER packet, and it will change a server to send packet every time after it sent one. Use this method to make all servers to achieve load balance.

Examples

Enable DHCP relay cycle feature :

Switch# configure terminal
Switch(config)# dhcp relay address cycle

Related Commands

None

4.3.12. service dhcp

Command Purpose

To enable the Dynamic Host Configuration Protocol (DHCP) snooping and relay agent features on your router, use the service dhcp command in Global Config mode.

To disable the DHCP snooping and relay agent features, 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

service dhcp enable

service dhcp disable

Command Mode

Global Config

Default

DHCP service is disabled globally.

Usage

Only the main DHCP service is enabled by the service dhcp command, can other DHCP services be used, such as dhcp relay or dhcp snooping.

Examples

The following example shows how to enable DHCP service globally:

Switch# configure terminal
Switch(config)# service dhcp enable

The following example shows how to disable DHCP service globally:

Switch# configure terminal
Switch(config)# service dhcp disable

Related Commands

dhcp relay

dhcp snooping

4.3.13. debug dhcp relay

Command Purpose

Use this command to turn on the debug switches of dhcp relay 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 relay ( events | error | dump | packet | all )

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

Parameter

Parameter Description

Parameter Value

events

Relay 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 relay debug switches:

Switch# debug dhcp relay all

Related Commands

terminal monitor

show logging buffer

4.3.14. show dhcp-server

Command Purpose

To display the DHCP server groups, use the show dhcp-server 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-server

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to display all the DHCP server groups configured with command dhcp-server in global mode.

Examples

The following example shows how to display dhcp-server group information:

Switch# show dhcp-server

DHCP server group information:
============================================================
group 1 ip address list:
[1] 1.1.1.1
[2] 2.2.2.2
[3] 3.3.3.3
[4] 4.4.4.4
[5] 5.5.5.5
[6] 6.6.6.6
[7] 7.7.7.7
[8] 8.8.8.8

Related Commands

dhcp-server (global)

4.3.15. show dhcp relay interfaces

Command Purpose

To display to which dhcp-server group the interface belongs, use the show dhcp relay interfaces 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 relay interfaces

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to display the interface which is confined DHCP relay.

Examples

The following example shows how to display dhcp relay interfaces information:

Switch# show dhcp relay interfaces

List of DHCP relay enabled interface(s):
DHCP relay service status: enabled
Interface Name DHCP server group
============================================================
eth-0-1 1

Related Commands

show dhcp-server

4.3.16. show dhcp relay information config

Command Purpose

To display the DHCP relay information configurations, use the show dhcp relay information config 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 relay information config

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to display the configuration of DHCP relay.

Examples

The following example shows how to display dhcp relay configuration:

Switch# show dhcp relay information config

DHCP relay agent information configuration:
============================================================
no dhcp relay information option
dhcp relay information check
dhcp relay information policy keep

Related Commands

dhcp relay information option

4.3.17. show dhcp relay information trusted-sources

Command Purpose

To display all interfaces configured to be a trusted source for the DHCP relay information option, use the show dhcp relay information trusted-sources 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 relay information trusted-sources

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to display all interfaces configured to be a trusted source for DHCP relay.

Examples

The following example shows how to display dhcp relay information trusted-sources:

Switch# show dhcp relay information trusted-sources

List of trusted sources of relay agent information option:
============================================================
All interfaces are trusted source of relay agent information option

Related Commands

dhcp relay information trusted

4.3.18. show dhcp relay statistics

Command Purpose

To display the statistics of DHCP packets relayed by the switch, use the show dhcp relay 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 relay statistics

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to display detail DHCP statistics which dealt by the switch.

Examples

The following example shows how to display dhcp relay statistics:

Switch# show dhcp relay statistics

DHCP relay packet statistics:
============================================================
Client relayed packets: 101
Server relayed packets: 88
Client error packets: 0
Server error packets: 0
Bogus GIADDR drops: 15
Bad circuit ID packets: 0
Corrupted agent options: 0
Missing agent options: 0
Missing circuit IDs: 0

Related Commands

clear dhcp relay statistics

4.3.19. clear dhcp relay statistics

Command Purpose

To clear the statistics of DHCP packets relayed by the switch, use the clear dhcp relay 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 relay statistics

Command Mode

Privileged EXEC

Default

None

Usage

This command is used to clear detail DHCP statistics which dealt by the switch.

Examples

The following example shows how to clear dhcp relay statistics:

Switch# clear dhcp relay statistics

Related Commands

show dhcp relay statistics