• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C WX3000系列有线无线一体化交换机交换引擎 命令手册-6PW103

19-DHCP命令

本章节下载 19-DHCP命令  (211.38 KB)

docurl=/cn/Service/Document_Software/Document_Center/Wlan/WX/H3C_WX3000/Command/Command_Manual/H3C_WX3000_CM-6PW103/200907/643022_30005_0.htm

19-DHCP命令


1 DHCP中继配置命令

1.1  DHCP中继配置命令

1.1.1  address-check

【命令】

address-check enable

address-check disable

【视图】

VLAN接口视图

【参数】

【描述】

address-check enable命令用来开启DHCP中继的地址匹配检查功能。VLAN接口上开启该功能后,将与ARP模块配合,检查用户IP地址与MAC地址的对应关系是否与DHCP中继的用户地址表匹配。如果不匹配,则不允许该用户访问外部网络。

address-check disable命令用来关闭DHCP中继的地址匹配检查功能。

缺省情况下,DHCP中继的地址匹配检查功能处于关闭状态。

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 进入Vlan-interface1接口视图。

[Sysname] interface vlan-interface 1

# 在Vlan-interface1接口上开启DHCP中继的地址匹配检查功能。

[Sysname-Vlan-interface1] address-check enable

1.1.2  dhcp relay hand

【命令】

dhcp relay hand enable

dhcp relay hand disable

【视图】

系统视图

【参数】

【描述】

dhcp relay hand enable命令用来开启DHCP中继的握手功能。开启该功能后,DHCP中继将根据用户地址表项中记录的IP地址和自己的MAC地址,每隔指定时间向DHCP服务器端发送握手报文,确认是否对用户地址项进行刷新。dhcp relay hand disable命令用来取消DHCP中继的握手功能。

缺省情况下, DHCP中继握手功能处于开启状态。

【举例】

# 关闭DHCP中继握手功能。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] dhcp relay hand disable

1.1.3  dhcp relay information enable

【命令】

dhcp relay information enable

undo dhcp relay information enable

【视图】

系统视图

【参数】

【描述】

dhcp relay information enable命令用来开启DHCP中继支持Option 82功能。undo dhcp relay information enable命令用来关闭DHCP中继支持Option 82功能。

缺省情况下,DHCP中继支持Option 82功能关闭。

缺省情况下,开启DHCP中继支持Option 82功能后,设备对包含Option 82的请求报文将采用replace策略进行处理。但如果之前配置了其他处理策略,则开启DHCP中继支持Option 82功能的操作不会改变已经配置的处理策略。

 

相关配置可参考命令dhcp relay information strategy

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 开启DHCP中继支持Option 82功能。

[Sysname] dhcp relay information enable

1.1.4  dhcp relay information strategy

【命令】

dhcp relay information strategy { drop | keep | replace }

undo dhcp relay information strategy

【视图】

系统视图

【参数】

drop:如果报文中带有Option 82选项,则丢弃该报文。

keep:如果报文中带有Option 82选项,则保持该报文中的Option 82选项不变并进行转发。

replace:如果报文中带有Option 82选项,则按照配置的填充内容填充Option 82选项,并替换报文中原有的Option 82选项进行转发。

【描述】

dhcp relay information strategy命令用来配置DHCP中继对DHCP客户端发送的携带了Option 82的请求报文的处理措施。undo dhcp relay information strategy命令用来恢复缺省情况下的处理方式。

缺省情况下,DHCP中继对DHCP客户端发送的携带Option 82选项的请求报文的处理策略为replace策略。

相关配置可参考命令dhcp relay information enable

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 配置DHCP中继丢弃DHCP客户端发送的携带了Option 82的请求报文。

[Sysname] dhcp relay information strategy drop

1.1.5  dhcp-security static

【命令】

dhcp-security static ip-address mac-address

undo dhcp-security { ip-address | all | dynamic | static }

【视图】

系统视图

【参数】

ip-address:用户IP地址。

mac-address:用户MAC地址。

all:删除所有的用户地址表项。

dynamic:删除动态用户地址表项。

static:删除静态用户地址表项。

【描述】

dhcp-security static命令用来配置DHCP静态用户地址表项。undo dhcp-security命令用来删除DHCP用户地址表项。

相关配置可参考命令display dhcp-security

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z

# 配置DHCP静态用户地址表项,用户IP地址为1.1.1.1,MAC地址为0005-5D02-F2B3。

[Sysname] dhcp-security static 1.1.1.1 0005-5D02-F2B3

1.1.6  dhcp-security tracker

【命令】

dhcp-security tracker { interval | auto }

undo dhcp-security tracker [ interval ]

【视图】

系统视图

【参数】

interval:DHCP中继动态用户地址表项的刷新时间间隔,取值范围为1~120秒。

auto:根据表项的数目自动计算DHCP中继动态用户地址表项的刷新时间间隔。

【描述】

dhcp-security tracker命令用来配置DHCP中继动态用户地址表项的刷新时间间隔。undo dhcp-security tracker命令用来恢复DHCP中继动态用户地址表项的刷新时间间隔为缺省情况。

缺省情况下,根据DHCP中继动态用户地址表项的数目自动计算刷新时间间隔。

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 配置DHCP中继动态用户地址表项的刷新时间间隔为60秒。

[Sysname] dhcp-security tracker 60

1.1.7  dhcp-server

【命令】

dhcp-server groupNo

undo dhcp-server

【视图】

VLAN接口视图

【参数】

groupNo:DHCP服务器组号,取值范围为0~19。

【描述】

dhcp-server命令用来指定VLAN接口具体归属到哪一个DHCP服务器组。undo dhcp-server命令用来取消这种归属关系。

需要注意的是:

l              每个DHCP服务器组可以对应多个接口。但每个接口只能对应一个DHCP服务器组。

l              如果多次执行此命令,新的配置会覆盖已有配置。

l              此命令中所指定的DHCP服务器组的组号,需事先通过dhcp-server groupNo ip ip-address&<1-8>命令进行配置。

相关配置可参考命令dhcp-server ipdisplay dhcp-serverdisplay dhcp-server interface vlan-interface

设备交换引擎为防止恶意用户对未使用SOCKET的攻击,提高设备的安全性,提供了如下功能:

l    在启动DHCP功能时,才打开DHCP使用的UDP 67和UDP 68端口。

l    在关闭DHCP功能时,同时关闭UDP 67和UDP 68端口。

具体的实现是:

l    执行dhcp-server命令配置VLAN接口与DHCP服务器组的归属关系后,DHCP中继功能开启,同时打开DHCP使用的UDP 67和UDP 68端口。

l    执行undo dhcp-server命令删除VLAN接口与DHCP服务器组的归属关系,并关闭其它DHCP服务,即同时关闭DHCP使用的UDP 67和UDP 68端口。

 

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 进入Vlan-interface1的接口视图。

[Sysname] interface vlan-interface 1

# 指定Vlan-interface1接口归属到DHCP服务器组1。

[Sysname-Vlan-interface1] dhcp-server 1

1.1.8  dhcp-server detect

【命令】

dhcp-server detect

undo dhcp-server detect

【视图】

系统视图

【参数】

【描述】

dhcp-server detect命令用来开启作为DHCP中继的设备对伪DHCP服务器的检测功能。undo dhcp-server detect命令用来关闭伪DHCP 服务器检测功能。

缺省情况下,禁止伪DHCP服务器检测功能。

相关配置可参考命令dhcp-serverdisplay dhcp-server

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 开启DHCP中继上的伪DHCP服务器检测功能。

[Sysname] dhcp-server detect

1.1.9  dhcp-server ip

【命令】

dhcp-server groupNo ip ip-address&<1-8>

undo dhcp-server groupNo

【视图】

系统视图

【参数】

groupNo:DHCP服务器组号,取值范围为0~19。

ip-address&<1-8>:DHCP服务器的IP地址。&<1-8>表示最多可以输入8个IP地址,每个IP地址之间用空格分隔。

【描述】

dhcp-server ip命令用来指定DHCP服务器组所采用的DHCP服务器的IP地址。undo dhcp-server命令用来删除一个DHCP服务器组的全部DHCP服务器的IP地址。

相关配置可参考命令dhcp-serverdisplay dhcp-server

【举例】

# 进入系统视图。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

# 指定DHCP服务器组1中有3个DHCP服务器,DHCP Server1的IP地址为1.1.1.1、DHCP Server2的IP地址为2.2.2.2、DHCP Server3的IP地址为3.3.3.3。

[Sysname] dhcp-server 1 ip 1.1.1.1 2.2.2.2 3.3.3.3

1.1.10  display dhcp-security

【命令】

display dhcp-security [ ip-address | dynamic | static | tracker ]

【视图】

任意视图

【参数】

ip-address:显示指定IP地址的用户地址表项。

dynamic:显示动态用户地址表项。

static:显示静态用户地址表项。

tracker:显示DHCP用户地址表项的更新时间间隔。

【描述】

display dhcp-security命令用来显示DHCP中继记录的用户地址表项信息。

【举例】

# 显示DHCP中继记录的用户地址表项信息。

<Sysname> display dhcp-security

 IP Address      MAC Address     IP Address Type

 10.1.1.1        0001-0001-0001  Static

 192.168.10.2    000d-88f7-b090  Dynamic_ack

---   2 dhcp-security item(s)  found   ---

表1-1 display dhcp-security命令显示信息描述表

字段

描述

IP Address

DHCP客户端的IP地址

MAC Address

DHCP客户端的MAC地址

IP Address Type

用户地址表项的类型,可以为动态地址表项或者静态地址表项

 

1.1.11  display dhcp-server

【命令】

display dhcp-server groupNo

【视图】

任意视图

【参数】

groupNo:DHCP服务器组号,取值范围为0~19。

【描述】

display dhcp-server命令用来显示DHCP服务器组的相关信息。

相关配置可参考命令dhcp-server ipdhcp-serverdisplay dhcp-server interface vlan-interface

【举例】

# 查看DHCP Server组0的相关信息。

<Sysname> display dhcp-server 0

 IP address of DHCP server group 0:         1.1.1.1

 IP address of DHCP server group 0:         2.2.2.2

 IP address of DHCP server group 0:         3.3.3.3

 IP address of DHCP server group 0:         4.4.4.4

 IP address of DHCP server group 0:         5.5.5.5

 IP address of DHCP server group 0:         6.6.6.6

 IP address of DHCP server group 0:         7.7.7.7

 IP address of DHCP server group 0:         8.8.8.8

 Messages from this server group: 0

 Messages to this server group: 0

 Messages from clients to this server group: 0

 Messages from this server group to clients: 0

 DHCP_OFFER messages: 0

 DHCP_ACK messages: 0

 DHCP_NAK messages: 0

DHCP_DECLINE messages: 0

 DHCP_DISCOVER messages: 0

 DHCP_REQUEST messages: 0

 DHCP_INFORM messages: 0

 DHCP_RELEASE messages: 0

 BOOTP_REQUEST messages: 0

 BOOTP_REPLY messages: 0

表1-2 display dhcp-server命令显示信息描述表

字段

描述

IP address of DHCP server group 0:

DHCP服务器组0的服务器IP地址

Messages from this server group

DHCP relay收到的此server组发来的报文数

Messages to this server group

DHCP relay发送到此server组的报文数

Messages from clients to this server group

DHCP relay收到的client发过来的报文数

Messages from this server group to clients

DHCP relay发送到client的报文数

DHCP_OFFER messages

DHCP relay收到的OFFER报文数

DHCP_ACK messages

DHCP relay收到的ACK报文数

DHCP_NAK messages

DHCP relay收到的NAK报文数

DHCP_DECLINE messages

DHCP relay收到的DECLINE报文数

DHCP_DISCOVER messages

DHCP relay收到的DISCOVER报文数

DHCP_REQUEST messages

DHCP relay收到的REQUEST报文数

DHCP_INFORM messages

DHCP relay收到的INFORM报文数

DHCP_RELEASE messages

DHCP relay收到的RELEASE报文数

BOOTP_REQUEST messages

BOOTP请求报文数

BOOTP_REPLY messages

BOOTP响应报文数

 

1.1.12  display dhcp-server interface

【命令】

display dhcp-server interface Vlan-interface vlan-id

【视图】

任意视图

【参数】

vlan-id:VLAN接口号。

【描述】

display dhcp-server interface命令用来显示VLAN接口对应的DHCP服务器组的相关信息。

相关配置可参考命令dhcp-serverdisplay dhcp-server

【举例】

# 查看Vlan-interface2所对应的DHCP服务器组的相关信息。

<Sysname> display dhcp-server interface vlan-interface 2

 Dhcp-group 0 is configured on this interface

以上信息表明Vlan-interface2上配置的是标识号为0的DHCP服务器组。

1.1.13  reset dhcp-server

【命令】

reset dhcp-server groupNo

【视图】

用户视图

【参数】

groupNo:DHCP服务器组号,取值范围为0~19。

【描述】

reset dhcp-server命令用来清除指定DHCP服务器组的统计信息。

相关配置可参考命令dhcp-serverdisplay dhcp-server

【举例】

# 清除DHCP服务器组2的统计信息。

<Sysname> reset dhcp-server 2

 


2 DHCP Snooping配置命令

2.1  DHCP Snooping配置命令

2.1.1  dhcp-snooping

【命令】

dhcp-snooping

undo dhcp-snooping

【视图】

系统视图

【参数】

【描述】

dhcp-snooping命令用来开启设备DHCP Snooping功能。undo dhcp-snooping命令用来关闭DHCP Snooping功能。

缺省情况下,设备的DHCP Snooping功能处于关闭状态。

相关配置可参考命令display dhcp-snooping

【举例】

# 进入系统视图。

<device> system-view

System View: return to User View with Ctrl+Z.

# 开启DHCP Snooping功能。

[device] dhcp-snooping

2.1.2  dhcp-snooping information enable

【命令】

dhcp-snooping information enable

undo dhcp-snooping information enable

【视图】

系统视图

【参数】

【描述】

dhcp-snooping information enable命令用来开启DHCP Snooping支持Option 82功能。undo dhcp-snooping information enable命令用来关闭DHCP Snooping支持Option 82功能。

缺省情况下,DHCP Snooping支持Option 82功能处于关闭状态。

只有支持DHCP Snooping的设备配置了DHCP Snooping功能后,才支持此项配置。

 

【举例】

# 开启DHCP Snooping支持Option 82的功能。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] dhcp-snooping information enable

2.1.3  dhcp-snooping information format

【命令】

dhcp-snooping information format { hex | ascii }

【视图】

系统视图

【参数】

hex:指定Option 82存储格式是HEX,即十六进制数串格式。

ascii:指定Option 82存储格式是ASCII(美国信息交换标准码)格式。

【描述】

dhcp-snooping information format命令用来配置DHCP Snooping支持Option 82的存储格式为HEX或ASCII格式。

缺省情况下,DHCP Snooping支持Option 82的存储格式为HEX。

dhcp-snooping information format命令只对设备默认填加的Option 82内容生效。如果用户通过命令配置了Circuit ID或Remote ID的内容,则相应子选项的填充格式为ASCII格式,不再受dhcp-snooping information format命令配置的约束。

 

【举例】

# 配置Option 82的存储格式为ASCII格式。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] dhcp-snooping information format ascii

2.1.4  dhcp-snooping information packet-format

【命令】

dhcp-snooping information packet-format { extended | standard }

【视图】

系统视图

【参数】

extended:配置Option 82字段的填充格式为扩展格式。

standard:配置Option 82字段的填充格式为标准格式。

【描述】

dhcp-snooping information packet-format命令用来配置Option 82字段的填充格式为标准格式或扩展格式。

缺省情况下,Option 82字段的填充格式为扩展格式。

【举例】

# 配置Option 82字段的填充格式为标准格式。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] dhcp-snooping information packet-format standard

2.1.5  dhcp-snooping information remote-id

【命令】

dhcp-snooping information remote-id { sysname | string string }

undo dhcp-snooping information remote-id

【视图】

系统视图

【参数】

sysname:用DHCP Snooping设备的系统名填充Option 82的Remote ID字段内容。

string:用户自定义配置的Remote ID子选项的内容,格式为ASCII字符串,取值范围为1~63个字符。

【描述】

dhcp-snooping information circuit-id命令用来配置Option 82的Remote ID内容。undo dhcp-snooping information circuit-id命令用来恢复Option 82的Remote ID内容的缺省值。

缺省情况下,Option 82中Remote ID内容为接收到DHCP客户端请求报文的DHCP Snooping设备的MAC地址。

【举例】

# 配置Option 82中Remote ID的内容为DHCP Snooping设备的系统名称。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] dhcp-snooping information remote-id sysname

2.1.6  dhcp-snooping information strategy

【命令】

dhcp-snooping information strategy { drop | keep | replace }

undo dhcp-snooping information strategy

【视图】

系统视图、以太网端口视图

【参数】

drop:如果报文中带有Option 82选项,则DHCP Snooping丢弃该报文。

keep:如果报文中带有Option 82选项,则DHCP Snooping保持该报文中的Option 82选项不变并进行转发。

replace:如果报文中带有Option 82选项,DHCP Snooping按照配置的填充内容填充Option 82选项,并替换报文中原有的Option 82选项进行转发。

【描述】

在系统视图下执行dhcp-snooping information strategy命令用来对所有端口接收的包含Option 82选项请求报文配置处理策略。undo dhcp-snooping information strategy命令用来恢复缺省的处理策略。

在以太网端口视图下执行dhcp-snooping information strategy命令用来对指定端口接收的包含Option 82选项请求报文配置处理策略。undo dhcp-snooping information strategy命令用来恢复缺省的处理策略。

缺省情况下,DHCP Snooping设备对DHCP客户端发送的带有Option 82选项的请求报文的处理策略为replace

l    只有支持DHCP Snooping的设备开启DHCP Snooping功能以及支持Option 82功能后,才支持此项配置。

l    当同时配置了全局处理策略和指定端口的端口处理策略时,在该端口上优先使用端口处理策略进行处理,其它端口使用全局处理策略进行处理。

 

【举例】

# 配置DHCP Snooping设备对DHCP客户端发送的带有Option 82选项的请求报文使用keep策略。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] dhcp-snooping information strategy keep

2.1.7  dhcp-snooping information vlan circuit-id

【命令】

dhcp-snooping information [ vlan vlan-id ] circuit-id string string

undo dhcp-snooping information { [ vlan vlan-id ] circuit-id | circuit-id all }

【视图】

以太网端口视图

【参数】

vlan vlan-id :指定需要配置自定义Circuit ID内容的VLAN编号。

string:用户自定义配置的Circuit ID子选项的内容,格式为ASCII码字符串,取值范围为3~63个字符。

【描述】

dhcp-snooping information vlan circuit-id命令用来配置Option 82 的Circuit ID内容。undo dhcp-snooping information circuit-id命令用来恢复Option 82 的Circuit ID内容为缺省值。

如果选择参数vlan vlan-id,则对指定VLAN内的DHCP报文进行用户自定义Circuit ID子选项内容的配置;如果没有指定参数vlan vlan-id,则对所有经过当前端口的DHCP报文进行用户自定义Circuit ID子选项内容的配置。

undo dhcp-snooping information vlan vlan-id circuit-id命令用来恢复指定VLAN的DHCP报文中Circuit ID的值为缺省情况。

undo dhcp-snooping information circuit-id用来恢复指定VLAN以外的所有DHCP报文中Circuit ID的值为缺省情况。

undo dhcp-snooping information circuit-id all命令用来恢复所有DHCP报文中Circuit ID的值为缺省情况。

缺省情况下,Option 82的Circuit ID内容为接收到DHCP客户端请求报文的端口所属VLAN的编号以及端口索引。

【举例】

# 配置Option 82的Circuit ID字段的内容为abc。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet1/0/1

[device-GigabitEthernet1/0/1] dhcp-snooping information circuit-id string abc

2.1.8  dhcp-snooping information vlan remote-id

【命令】

dhcp-snooping information [ vlan vlan-id ] remote-id string string

undo dhcp-snooping information { [ vlan vlan-id ] remote-id | remote-id all }

【视图】

以太网端口视图

【参数】

vlan vlan-id:指定需要配置Remote ID子选项的VLAN 编号。

string:用户自定义配置的Remote ID子选项的内容,格式为ASCII字符串,取值范围为363个字符。

【描述】

dhcp-snooping information vlan remote-id命令用来配置Option 82Remote ID内容。undo dhcp-snooping information remote-id命令用来恢复Option 82 Remote ID内容为缺省值。

如果选择参数vlan vlan-id,则对指定VLAN内的DHCP报文进行用户自定义Remote ID子选项内容的配置;如果没有指定参数vlan vlan-id,则对所有经过当前端口的DHCP报文进行用户自定义Remote ID子选项内容的配置。

undo dhcp-snooping information vlan vlan-id remote-id命令用来恢复指定VLAN的DHCP报文中Remote ID的值为缺省情况。

undo dhcp-snooping information remote-id用来恢复指定VLAN以外的所有DHCP报文中Remote ID的值为缺省情况。

undo dhcp-snooping information remote-id all命令用来恢复所有DHCP报文中Remote ID的值为缺省情况。

缺省情况下,Option 82的Remote ID内容为接收到DHCP客户端请求报文的DHCP Snooping设备的MAC地址。

【举例】

# 配置通过端口GigabitEthernet1/0/1的DHCP报文的Option 82字段中Remote ID的内容为abc。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet1/0/1

[device-GigabitEthernet1/0/1] dhcp-snooping information remote-id string abc

2.1.9  dhcp-snooping trust

【命令】

dhcp-snooping trust

undo dhcp-snooping trust

【视图】

以太网端口视图

【参数】

【描述】

dhcp-snooping trust命令用来配置端口为DHCP Snooping信任端口。undo dhcp-snooping trust命令用来恢复端口为DHCP Snooping不信任端口。

缺省情况下,开启DHCP Snooping功能后,设备的所有端口均为DHCP Snooping不信任端口。

相关配置可参考命令display dhcp-snooping trust

【举例】

# 进入系统视图。

<device> system-view

System View: return to User View with Ctrl+Z.

# 配置端口GigabitEthernet1/0/1为信任端口。

[device-GigabitEthernet1/0/1] dhcp-snooping trust

2.1.10  display dhcp-snooping

【命令】

display dhcp-snooping [ unit unit-id ]

【视图】

任意视图

【参数】

unit unit-id:设备的Unit编号,取值为1。

【描述】

display dhcp-snooping命令用来显示通过DHCP Snooping记录的用户IP地址和MAC地址的对应关系。

相关配置可参考命令dhcp-snooping

【举例】

# 显示通过DHCP Snooping记录的用户IP地址和MAC地址信息。

<device> display dhcp-snooping

DHCP-Snooping is enabled.

The client binding table for all untrusted ports.     

 Type : D--Dynamic , S--Static

 Unit ID : 1

 Type IP Address      MAC Address     Lease     VLAN Interface

 ==== =============== =============== ========= ==== =================

 D    10.1.1.1        000f-e200-0006   200      1    GigabitEthernet1/0/1

---   1 dhcp-snooping item(s) of unit 1 found   ---

2.1.11  display dhcp-snooping trust

【命令】

display dhcp-snooping trust

【视图】

任意视图

【参数】

【描述】

display dhcp-snooping trust命令用来显示DHCP Snooping开启状态及信任端口信息。

相关配置可参考命令dhcp-snooping trust

【举例】

# 显示DHCP Snooping开启状态及信任端口信息。

<device> display dhcp-snooping trust

DHCP-Snooping is enabled.

 DHCP-Snooping trust become effective.

 Interface                 Trusted

 ===================== =================

 GigabitEthernet1/0/10  Trusted 

以上显示信息表示DHCP Snooping处于开启状态,DHCP Snooping信任功能生效,信任端口为GigabitEthernet 1/0/10。

2.1.12  display ip source static binding

【命令】

display ip source static binding [ vlan vlan-id | interface interface-type interface-number ]

【视图】

任意视图

【参数】

vlan-id:需要显示的VLAN编号。

interface-type interface-number:需要显示的端口,其中interface-type 为端口类型,interface-number为端口编号。

【描述】

display ip source static binding命令用来显示用户配置的IP静态绑定表。当命令中指定vlan参数时,将显示指定VLAN的所有IP静态绑定表项;当命令中指定interface参数时,将显示指定端口的所有IP静态绑定表项。

【举例】

# 显示用户配置的所有IP静态绑定表项。

<device> display ip source static binding

 Type IP Address      MAC Address     Remaining  VLAN Interface

                                      lease

 ==== =============== =============== =========  ==== =================

 S    192.168.0.25    0015-e20f-0101  infinit    1    GigabitEthernet1/0/2

 S    192.168.0.58    0001-e201-4f01  infinit    1    GigabitEthernet1/0/3

 S    192.168.0.101   000f-0101-0204  infinit    1    GigabitEthernet1/0/2

 S    192.168.0.122   000f-e20f-21a3  infinit    1    GigabitEthernet1/0/3

 S    192.168.0.144   0015-e943-712f  infinit    1    GigabitEthernet1/0/2

---   5 static binding item(s) found   ---

2.1.13  ip check source ip-address

【命令】

ip check source ip-address [ mac-address ]

undo ip check source ip-address [ mac-address ]

【视图】

以太网端口视图

【参数】

【描述】

ip check source ip-address命令用来开启根据端口接收的IP报文的源IP地址对报文进行过滤的功能。undo ip check source ip-address命令用来关闭根据端口接收的IP报文的源IP地址对报文进行过滤功能。

ip check source ip-address mac-address命令用来开启根据端口接收的IP报文的源IP地址和源MAC地址对报文进行过滤的功能。undo ip check source ip-address mac-address命令用来关闭根据端口接收的IP报文的源IP地址和源MAC地址对报文进行过滤功能。

缺省情况下,对端口接收的IP报文的源IP地址或源IP地址和源MAC地址进行过滤的功能处于关闭状态。

【举例】

# 开启根据端口GigabitEthernet 1/0/11接收的IP报文的源IP地址对报文进行过滤的功能。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet 1/0/11

[device-GigabitEthernet1/0/11] ip check source ip-address

2.1.14  ip source static binding

【命令】

ip source static binding ip-address ip-address [ mac-address mac-address ]

undo ip source static binding ip-address ip-address

【视图】

以太网端口视图

【参数】

ip-address:要静态绑定的IP地址。

mac-address:要静态绑定的MAC地址。

【描述】

ip source static binding ip-address命令用来配置IP报文的源IP地址、源MAC地址与端口之间的静态绑定关系,形成静态绑定表项。undo ip source static binding ip-address命令用来取消设置的IP报文的源IP地址、源MAC地址与端口之间的静态绑定表项。

缺省情况下,没有设置IP报文的源IP地址、源MAC地址与端口之间的静态绑定关系。

【举例】

# 设置源IP地址、源MAC地址与以太网端口GigabitEthernet 1/0/3之间的静态绑定关系。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet 1/0/3

[device-GigabitEthernet1/0/3] ip source static binding ip-address 1.1.1.1 mac-address 0015-e20f-0101

 


3 DHCP/BOOTP客户端配置

3.1  DHCP客户端配置命令

3.1.1  display dhcp client

【命令】

display dhcp client [ verbose ]

【视图】

任意视图

【参数】

verbose:显示DHCP客户端的地址分配的详细信息。

【描述】

display dhcp client命令用来显示DHCP客户端的地址分配信息。

需要注意的是:目前设备作为DHCP客户端,可以支持的最大租约时间为24天。

【举例】

# 显示DHCP客户端的地址分配信息。

<device> display dhcp client verbose

DHCP client statistic infomation:

Vlan-interface1:

Current machine state: BOUND

Allocated IP: 192.168.0.2 255.255.255.0

Allocated lease: 86400 seconds, T1: 43200 seconds, T2: 75600 seconds

Lease from 2002.09.20 01:05:03   to   2002.09.21 01:05:03

Server IP: 192.168.0.1

Transaction ID = 0x3d8a7431

Default router: 192.168.0.1

Next timeout will happen after 0 days 11 hours 56 minutes 1 seconds.

表3-1 display dhcp client 命令显示信息描述表

字段

描述

Vlan-interface1

客户端动态获取IP地址的接口

Current machine state

客户状态机状态

Allocated IP

客户分配到的IP地址

lease

租约时长

T1

Renewal定时器时长

T2

Rebinding定时器时长

Lease from….to….

租约起止时间

Server IP

选择的DHCP服务器地址

Transaction ID

事务标识

Default router

网关地址

Next timeout will happen after 0 days 11 hours 56 minutes 1 seconds.

下一次定时器超时将出现在11小时56分1秒后

 

3.1.2  ip address dhcp-alloc

【命令】

ip address dhcp-alloc

undo ip address dhcp-alloc

【视图】

VLAN接口视图

【参数】

【描述】

ip address dhcp-alloc命令用来配置VLAN接口通过DHCP方式获取IP地址。undo ip address dhcp-alloc命令用来取消VLAN接口通过DHCP方式获取IP地址。

缺省情况下,VLAN接口不通过DHCP方式获取IP地址。

【举例】

# 配置Vlan-interface1通过DHCP方式获取IP地址。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface Vlan-interface 1

[device-Vlan-interface1] ip address dhcp-alloc

3.2  BOOTP客户端配置命令

3.2.1  display bootp client

【命令】

display bootp client [ interface Vlan-interface vlan-id ]

【视图】

任意视图

【参数】

vlan-id:VLAN接口编号。

【描述】

display bootp client命令用来显示BOOTP客户端的相关信息,包括BOOTP客户端的MAC地址和申请到的IP地址等信息。

【举例】

# 显示Vlan-interface1上BOOTP客户端的相关信息。

<device> display bootp client interface Vlan-interface 1

Vlan-interface1:

Allocated IP: 192.168.0.2 255.255.255.0

Transaction ID = 0x3d8a7431

Mac Address  000f-e20a-c3ef

表3-2 display bootp client命令显示信息描述表

字段

描述

Vlan-interface1

Vlan-interface1配置为通过BOOTP方式获取IP地址

Allocated IP

所分配到的IP地址

Transaction ID

BOOTP报文中XID字段值

Mac Address

BOOTP客户端的MAC地址

 

3.2.2  ip address bootp-alloc

【命令】

ip address bootp-alloc

undo ip address bootp-alloc

【视图】

VLAN接口视图

【参数】

【描述】

ip address bootp-alloc命令用来配置VLAN接口通过BOOTP协议获取IP地址。undo ip address bootp-alloc命令用来取消VLAN接口通过BOOTP协议获取IP地址。

缺省情况下,VLAN接口不通过BOOTP协议获取IP地址。

相关配置可参考命令display bootp client

【举例】

# 配置Vlan-interface1通过BOOTP协议获取IP地址。

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface Vlan-interface 1

[device-Vlan-interface1] ip address bootp-alloc

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们