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

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

23-ARP命令

本章节下载 23-ARP命令  (116.55 KB)

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

23-ARP命令


1 ARP配置

1.1  ARP配置命令

1.1.1  arp check enable

【命令】

arp check enable

undo arp check enable

【视图】

系统视图

【参数】

【描述】

arp check enable命令用来开启ARP表项的检查功能。undo arp check enable命令用来关闭ARP表项的检查功能。

开启ARP表项检查功能后,若设备接收到的ARP报文中的源MAC地址为组播MAC,则不进行动态ARP表项的学习;且设备上不能配置MAC地址为组播MAC的静态ARP表项,否则会有错误提示。

关闭ARP表项检查功能后,可以对源MAC地址为组播MAC的ARP表项进行学习,且可以配置MAC地址为组播MAC的静态ARP表项。

缺省情况下,开启ARP表项的检查功能。

【举例】

# 关闭ARP表项的检查功能。

<device> system-view

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

[device] undo arp check enable

1.1.2  arp detection enable

【命令】

arp detection enable

undo arp detection enable

【视图】

VLAN视图

【参数】

【描述】

arp detection enable命令用来开启指定VLAN内所有端口的ARP入侵检测功能,即对该VLAN内端口收到的ARP报文的源IP地址、源MAC地址、接收ARP报文的端口编号以及端口所在VLAN的对应关系进行检测。如果端口接收的ARP报文的源IP地址、源MAC地址的对应关系不在DHCP Snooping表项或IP静态绑定表项中,或者接收ARP报文的端口编号以及端口所在VLAN与DHCP Snooping表项或IP静态绑定表项不匹配,则ARP报文将被丢弃。undo arp detection enable命令用来关闭指定VLAN内所有端口的ARP入侵检测功能。

缺省情况下,设备的ARP入侵检测功能处于关闭状态。

【举例】

# 开启VLAN 1内所有端口的ARP入侵检测功能。

<device> system-view

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

[device] vlan 1

[device-vlan1] arp detection enable

1.1.3  arp detection trust

【命令】

arp detection trust

undo arp detection trust

【视图】

以太网端口视图

【参数】

【描述】

arp detection trust命令用来设置当前端口为ARP信任端口,即对于此端口接收的ARP报文将不进行ARP入侵检测,默认其为合法ARP报文。undo arp detection trust命令用来设置当前端口为非ARP信任端口。

缺省情况下,端口为非ARP信任端口。

【举例】

# 设置端口GigabitEthernet1/0/11为ARP信任端口。

<device> system-view

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

[device] interface GigabitEthernet 1/0/11

[device-GigabitEthernet1/0/11] arp detection trust

1.1.4  arp restricted-forwarding enable

【命令】

arp restricted-forwarding enable

undo arp restricted-forwarding enable

【视图】

VLAN视图

【参数】

【描述】

arp restricted-forwarding enable命令用来开启ARP严格转发功能,即从指定VLAN接收的,合法ARP请求报文只能通过已配置的信任端口进行转发;而合法ARP应答报文,首先按照报文中的目的MAC地址进行转发,若目的MAC地址不在MAC地址表中,则将此ARP应答报文通过信任端口进行转发。undo arp restricted-forwarding enable命令用来关闭ARP严格转发功能。

缺省情况下,ARP严格转发功能关闭,设备可以通过所有端口转发合法ARP报文。

相关配置可参考命令arp detection enablearp detection trust

【举例】

# 在VLAN 1中开启ARP严格转发功能。

<device> system-view

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

[device] vlan 1

[device-vlan1] arp restricted-forwarding enable

1.1.5  arp static

【命令】

arp static ip-address mac-address [ vlan-id interface-type interface-number ]

arp static ip-address mac-address vlan-id(以太网端口视图)

undo arp ip-address

【视图】

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

【参数】

ip-address:ARP表项的IP地址部分。

mac-address:ARP表项的MAC地址部分,格式为H-H-H。

vlan-id:静态ARP表项所属的VLAN,取值范围为1~4094。

interface-type:静态ARP表项所属端口的端口类型。

interface-number:静态ARP表项所属端口的端口编号。

【描述】

arp static命令用来配置ARP映射表中的静态ARP表项。undo arp命令用来删除ARP表项。

缺省情况下,系统ARP映射表为空,地址映射由ARP协议动态获取。

需要注意的是:

l              静态ARP表项在设备正常工作时间内一直有效,但如果执行删除VLAN或把端口从VLAN中删除等使ARP表项不再合法的操作,则相应的静态ARP表项将被自动删除。

l              参数vlan-id必须是已经存在的VLAN ID,且vlan-id参数后面指定的以太网端口必须属于这个VLAN。

l              目前,不支持在汇聚组中的端口上配置静态ARP表项。

相关配置可参考命令reset arpdisplay arp

【举例】

# 配置IP地址202.38.10.2对应的MAC地址为000f-e20f-0000,属于VLAN1的以太网端口GigabitEthernet1/0/1。

<device> system-view

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

[device] arp static 202.38.10.2 000f-e20f-0000 1 GigabitEthernet 1/0/1

1.1.6  arp timer aging

【命令】

arp timer aging aging-time

undo arp timer aging

【视图】

系统视图

【参数】

aging-time:动态ARP表项的老化时间。取值范围为1~1440,单位为分钟。

【描述】

arp timer aging命令用来配置动态ARP表项的老化时间。undo arp timer aging命令用来恢复动态ARP表项的老化时间为缺省值。

缺省情况下,动态ARP表项的老化时间为20分钟。

相关配置可参考命令display arp timer aging

【举例】

# 配置动态ARP表项的老化时间为10分钟。

<device> system-view

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

[device] arp timer aging 10

1.1.7  display arp

【命令】

display arp [ dynamic | static | ip-address ]

【视图】

任意视图

【参数】

dynamic:显示动态ARP表项。

static:显示静态ARP表项。

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

【描述】

display arp命令用来显示ARP映射表。

当不带任何可选参数的时候,将显示所有ARP表项。

相关配置可参考命令arp staticreset arp

【举例】

# 显示所有ARP表项。

<device> display arp

            Type: S-Static   D-Dynamic

IP Address      MAC Address     VLAN ID Port Name / AL ID      Aging Type

10.2.72.162     000a-000a-0aaa  N/A     N/A                    N/A   S

192.168.0.77    0000-e8f5-6a4a  1       GigabitEthernet1/0/2   13    D

192.168.0.2     000d-88f8-4e88  1       GigabitEthernet1/0/2   14    D

192.168.0.200   0014-222c-9d6a  1       GigabitEthernet1/0/2   14    D

192.168.0.45    000d-88f6-44c1  1       GigabitEthernet1/0/2   15    D

192.168.0.110   0011-4301-991e  1       GigabitEthernet1/0/2   15    D

192.168.0.32    0000-e8f5-73ee  1       GigabitEthernet1/0/2   16    D

192.168.0.3     0014-222c-aa69  1       GigabitEthernet1/0/2   16    D

192.168.0.17    000d-88f6-379c  1       GigabitEthernet1/0/2   17    D

192.168.0.115   000d-88f7-9f7d  1       GigabitEthernet1/0/2   18    D

192.168.0.43    000c-760a-172d  1       GigabitEthernet1/0/2   18    D

192.168.0.33    000d-88f6-44ba  1       GigabitEthernet1/0/2   20    D

192.168.0.35    000f-e20f-2181  1       GigabitEthernet1/0/2   20    D

192.168.0.5     000f-e280-2b38  1       GigabitEthernet1/0/2   20    D

 

---   14 entries found   ---

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

字段

描述

IP Address

ARP表项的IP地址

MAC Address

ARP表项的MAC地址

VLAN ID

ARP表项对应的VLAN ID

Port Name / AL ID

ARP表项对应的端口名

Aging

动态ARP表项的有效时间,单位为分钟

Type

ARP表项的类型

 

1.1.8  display arp

【命令】

display arp [ dynamic | static] | { begin | exclude | include } text

【视图】

任意视图

【参数】

dynamic:显示动态ARP表项。

static:显示静态ARP表项。

|:用正则表达式来指定要显示的ARP表项。

begin:从第一个包含指定字符串text的ARP表项开始显示。

exclude:只显示那些不包含指定字符串text的ARP表项。

include:只显示那些包含指定字符串text的ARP表项。

text:ARP表项中包含的文本。

【描述】

display arp | 命令用来显示包含指定内容的ARP表项。

相关配置可参考命令arp staticreset arp

【举例】

# 显示包含指定字符串77的ARP表项。

<device> display arp | include 77

            Type: S-Static   D-Dynamic

IP Address       MAC Address     VLAN ID  Port Name / AL ID      Aging Type

192.168.0.77     0000-e8f5-6a4a  1        GigabitEthernet1/0/2   12    D

 

---   1 entry found   ---

# 显示不包含指定字符串68的ARP表项。

<device> display arp | exclude 68

            Type: S-Static   D-Dynamic

IP Address       MAC Address     VLAN ID  Port Name / AL ID      Aging Type

10.2.72.162      000a-000a-0aaa  N/A      N/A                    N/A   S

 

---   1 entry found   ---

显示信息中各字段的解释,请参见表1-1

1.1.9  display arp count

【命令】

display arp count [ [ dynamic | static ] [ | { begin | exclude | include } text ] | ip-address ]

【视图】

任意视图

【参数】

dynamic:动态ARP表项。

static:静态ARP表项。

|:用正则表达式来指定要统计的ARP表项。

begin:从第一个包含指定字符串text的ARP表项开始统计。

exclude:只显示那些不包含指定字符串text的ARP表项的数目。

include:只显示那些包含指定字符串text的ARP表项的数目。

text:ARP表项中包含的文本。

ip-address:显示指定IP地址的ARP表项的数目。

【描述】

display arp count命令用来显示指定类型的ARP表项的数目;当不带任何可选参数时,用来显示所有ARP表项的数目。

相关配置可参考命令arp staticreset arp

【举例】

# 显示所有ARP表项的数目。

<device> display arp count

 14 entries found

1.1.10  display arp detection statistics interface

【命令】

display arp detection statistics interface interface-type interface-number

【视图】

任意视图

【参数】

interface-type interface-number:端口类型和端口编号。

【描述】

display arp detection statistics interface命令用来显示指定端口被丢弃掉的不可信任的ARP报文的数量。

【举例】

# 显示设备GigabitEthernet1/0/10端口下被丢弃的不可信任的ARP报文的数量。

<device> system-view

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

[device] display arp detection statistics interface GigabitEthernet1/0/10

 ARP DETECTION : ENABLE

 ARP PORT TRUST : DISABLE

 INVALID ARP PACKETS  : 31

表1-2 display arp detection statistics interface命令显示信息描述表

字段

描述

ARP DETECTION

ARP入侵检测功能的状态:ENABLE表示开启,DISABLE表示关闭

ARP PORT TRUST

ARP端口信任功能:ENABLE表示开启,DISABLE表示关闭

INVALID ARP PACKETS

不可信任的报文数量

 

1.1.11  display arp timer aging

【命令】

display arp timer aging

【视图】

任意视图

【参数】

【描述】

display arp timer aging命令用来显示动态ARP表项的老化时间。

相关配置可参考命令arp timer aging

【举例】

# 显示动态ARP表项的老化时间。

<device> display arp timer aging

Current ARP aging time is 20 minute(s)(default)

以上显示信息表示动态ARP表项的老化时间为20分钟。

1.1.12  gratuitous-arp-learning enable

【命令】

gratuitous-arp-learning enable

undo gratuitous-arp-learning enable

【视图】

系统视图

【参数】

【描述】

gratuitous-arp-learning enable命令用来开启免费ARP报文的学习功能。undo gratuitous-arp-learning enable命令用来关闭免费ARP报文的学习功能。

缺省情况下,设备上的免费ARP报文学习功能处于开启状态。

【举例】

# 在设备上开启免费ARP报文学习功能。

<device> system-view

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

[device] gratuitous-arp-learning enable

1.1.13  reset arp

【命令】

reset arp [ dynamic | static | interface interface-type interface-number ]

【视图】

用户视图

【参数】

dynamic:清除动态ARP表项。

static:清除静态ARP表项。

interface-type:端口类型。

interface-number:端口编号。

【描述】

reset arp命令用来清除符合条件的ARP表项。

相关配置可参考命令arp staticdisplay arp

【举例】

# 清除静态ARP表项。

<device> reset arp static

 

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

新华三官网
联系我们