- Table of Contents
-
- 04-Layer 3 Command Reference
- 00-Preface
- 01-Basic IP Routing Commands
- 02-Static Routing Commands
- 03-IPv6 Static Routing Commands
- 04-IP Addressing Commands
- 05-IPv6 Basics Commands
- 06-DHCP Commands
- 07-DHCPv6 Commands
- 08-DNS Commands
- 09-IPv6 DNS Commands
- 10-IP Performance Optimization Commands
- 11-ARP Commands
- 12-IP Forwarding Basics Commands
- 13-NAT Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
11-ARP Commands | 92.84 KB |
Gratuitous ARP configuration commands
gratuitous-arp-learning enable
ARP snooping configuration commands·
arp check enable
Use arp check enable to enable dynamic ARP entry check.
Use undo arp check enable to disable dynamic ARP entry check.
Syntax
arp check enable
undo arp check enable
Default
Dynamic ARP entry check is enabled.
Views
System view
Default command level
2: System level
Examples
# Enable dynamic ARP entry check.
<Sysname> system-view
[Sysname] arp check enable
arp max-learning-num
Use arp max-learning-num to configure the maximum number of dynamic ARP entries that an interface can learn.
Use undo arp max-learning-num to restore the default.
Syntax
arp max-learning-num number
undo arp max-learning-num
Default
A Layer 2 interface does not limit the number of dynamic ARP entries. A Layer 3 interface can learn a maximum of 256 dynamic ARP entries.
Views
Layer 2 Ethernet interface view, VLAN interface view, Layer 2 aggregate interface view
Default command level
2: System level
Parameters
number: Specifies the maximum number of dynamic ARP entries that an interface can learn. The value range is 0 to 256.
Usage guidelines
When the number argument is set to 0, the interface is disabled from learning dynamic ARP entries.
Examples
# Specify VLAN-interface 40 to learn a maximum of 50 dynamic ARP entries.
<Sysname> system-view
[Sysname] interface vlan-interface 40
[Sysname-Vlan-interface40] arp max-learning-num 50
# Specify Layer 2 aggregate interface bridge-aggregation 1 to learn a maximum of 100 dynamic ARP entries.
<Sysname> system-view
[Sysname] interface bridge-aggregation 1
[Sysname-Bridge-Aggregation1] arp max-learning-num 100
arp static
Use arp static to configure a static ARP entry.
Use undo arp to remove an ARP entry.
Syntax
arp static ip-address mac-address [ vlan-id interface-type interface-number ]
undo arp ip-address
Views
System view
Default command level
2: System level
Parameters
ip-address: Specifies an IP address for the static ARP entry.
mac-address: Specifies a MAC address for the static ARP entry, in the format H-H-H.
vlan-id: Specifies the ID of a VLAN to which the static ARP entry belongs, in the range of 1 to 4094.
interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
A static ARP entry is effective when the device works normally. However, when the VLAN or VLAN interface to which an ARP entry corresponds is deleted, the entry, if long, is deleted, and if short and resolved, becomes unresolved.
The vlan-id argument specifies the VLAN corresponding to an ARP entry and must be the ID of an existing VLAN. In addition, the Ethernet interface following the argument must belong to that VLAN. The VLAN interface of the VLAN must have been created.
If both the vlan-id and ip-address arguments are specified, the IP address of the VLAN interface corresponding to the vlan-id argument must be in the same network segment as the IP address specified by the ip-address argument.
Examples
# Configure a static ARP entry, with IP address 202.38.10.2, MAC address 00e0-fc01-0000 and outbound interface GigabitEthernet 1/0/1 of VLAN 10.
<Sysname> system-view
[Sysname] arp static 202.38.10.2 00e0-fc01-0000 10 gigabitethernet 1/0/1
· reset arp
· display arp
arp timer aging
Use arp timer aging to set the aging timer for dynamic ARP entries.
Use undo arp timer aging to restore the default.
Syntax
arp timer aging aging-time
undo arp timer aging
Default
The aging timer for dynamic ARP entries is 20 minutes.
Views
System view
Default command level
2: System level
Parameters
aging-time: Specifies the aging time for dynamic ARP entries, in the range of 1 to 1440 minutes.
Examples
# Set aging timer for dynamic ARP entries to 10 minutes.
<Sysname> system-view
display arp timer aging
display arp
Use display arp to display ARP entries.
Syntax
display arp [ [ all | dynamic | static ] | vlan vlan-id | interface interface-type interface-number ] [ count ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
all: Displays all ARP entries.
dynamic: Displays dynamic ARP entries.
static: Displays static ARP entries.
vlan vlan-id: Displays the ARP entries of the specified VLAN. The VLAN ID ranges from 1 to 4094.
interface interface-type interface-number: Displays the ARP entries of the interface specified by the argument interface-type interface-number.
count: Displays the number of ARP entries.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Usage guidelines
If no parameter is specified, all ARP entries are displayed.
Examples
# Display the detailed information of all ARP entries.
Type: S-Static D-Dynamic
IP Address MAC Address VLAN ID Interface Aging Type
20.1.1.1 00e0-fc00-0001 N/A N/A N/A S
193.1.1.70 00e0-fe50-6503 1 GE1/0/1 14 D
192.168.0.115 000d-88f7-9f7d 1 GE1/0/1 18 D
192.168.0.39 0012-a990-2241 1 GE1/0/1 20 D
Table 1 Command output
Field |
Description |
IP Address |
IP address in an ARP entry. |
MAC Address |
MAC address in an ARP entry. |
VLAN ID |
ID of the VLAN to which the ARP entry belongs. |
Interface |
Outbound interface in an ARP entry. |
Aging |
Aging time for a dynamic ARP entry in minutes. If the aging time is unknown, or the entry has no aging time, N/A is displayed. |
Type |
ARP entry type: · D—Dynamic. · S—Static. |
# Display the number of all ARP entries.
<Sysname> display arp all count
Total Entry(ies): 5
· arp static
· reset arp
display arp ip-address
Use display arp ip-address to display the ARP entry for a specified IP address.
Syntax
display arp ip-address [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
ip-address: Displays the ARP entry for the specified IP address.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display the corresponding ARP entry for the IP address 20.1.1.1.
<Sysname> display arp 20.1.1.1
Type: S-Static D-Dynamic
IP Address MAC Address VLAN ID Interface Aging Type
20.1.1.1 00e0-fc00-0001 N/A N/A N/A S
Related commands
· arp static
· reset arp
display arp timer aging
Use display arp timer aging to display the aging timer for dynamic ARP entries.
Syntax
display arp timer aging [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
2: System level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display the aging timer for dynamic ARP entries.
<Sysname> display arp timer aging
Current ARP aging time is 10 minute(s)
Related commands
arp timer aging
naturemask-arp enable
Use naturemask-arp enable to enable natural mask support for ARP requests.
Use undo naturemask-arp enable to restore the default.
Syntax
naturemask-arp enable
undo naturemask-arp enable
Default
Natural mask support for ARP requests is disabled.
Views
System view
Default command level
2: System level
Examples
# Enable natural mask support for ARP requests.
<Sysname> system-view
[Sysname] naturemask-arp enable
reset arp
Use reset arp to clear ARP entries except authorized ARP entries from the ARP table.
Syntax
reset arp { all | dynamic | static | interface interface-type interface-number }
Views
User view
Default command level
2: System level
Parameters
all: Clears all ARP entries except authorized ARP entries.
dynamic: Clears all dynamic ARP entries.
static: Clears all static ARP entries.
interface interface-type interface-number: Clears the ARP entries for the interface specified by the argument interface-type interface-number.
Examples
# Clear all static ARP entries.
<Sysname> reset arp static
· arp static
· display arp
gratuitous-arp-learning enable
Use gratuitous-arp-learning enable to enable the gratuitous ARP packet learning function.
Use undo gratuitous-arp-learning enable to disable the function.
Syntax
gratuitous-arp-learning enable
undo gratuitous-arp-learning enable
Default
The function is enabled.
Views
System view
Default command level
2: System level
Usage guidelines
With this function enabled, a device creates a dynamic ARP entry by using the sender IP and MAC addresses in a received gratuitous ARP packet if no matching ARP entry exists. If a matching ARP entry exists, the device updates the ARP entry regardless of whether this function is enabled.
Examples
# Enable the gratuitous ARP packet learning function.
<Sysname> system-view
[Sysname] gratuitous-arp-learning enable
gratuitous-arp-sending enable
Use gratuitous-arp-sending enable to enable sending gratuitous ARP packets upon receiving ARP requests whose target IP address is on a different subnet.
Use undo gratuitous-arp-sending enable to restore the default.
Syntax
gratuitous-arp-sending enable
undo gratuitous-arp-sending enable
Default
A device does not send gratuitous ARP packets upon receiving ARP requests whose target IP address is on a different subnet.
Views
System view
Default command level
2: System level
Examples
# Disable a device from sending gratuitous ARP packets upon receiving ARP requests whose target IP address is on a different subnet.
<Sysname> system-view
[Sysname] undo gratuitous-arp-sending enable
arp-snooping enable
Use arp-snooping enable to enable ARP snooping.
Use undo arp-snooping enable to disable ARP snooping.
Syntax
arp-snooping enable
undo arp-snooping enable
Default
ARP snooping is disabled.
Views
System view
Default command level
2: System level
Examples
# Enable ARP snooping.
<Sysname> system-view
[Sysname] arp-snooping enable
display arp-snooping
Use display arp-snooping to display ARP snooping entries. If no parameters are specified, the command displays all the ARP snooping entries.
Syntax
display arp-snooping [ ip ip-address | vlan vlan-id ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
2: System level
Parameters
ip ip-address: Displays the ARP snooping entry information for the IP address.
vlan vlan-id: Displays ARP snooping entries for a specified VLAN. The vlan-id argument is in the range of 1 to 4094.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display ARP snooping entries for VLAN 1.
<Sysname> display arp-snooping vlan 1
IP Address MAC Address VLAN ID Interface Aging Status
3.3.3.3 0003-0003-0003 1 GE1/0/1 20 Valid
3.3.3.4 0004-0004-0004 1 GE1/0/2 5 Invalid
---- Total entry(ies) on VLAN 1:2 ----
reset arp-snooping
Use reset arp-snooping to remove ARP snooping entries. If no parameters are specified, the command removes all ARP snooping entries.
Syntax
reset arp-snooping [ ip ip-address | vlan vlan-id ]
Views
User view
Default command level
2: System level
Parameters
ip ip-address: Removes the ARP entry for a specified IP address.
vlan vlan-id: Removes the ARP entries for a specified VLAN. The vlan-id argument is in the range of 1 to 4094.
Examples
# Remove ARP snooping entries for VLAN 1.
<Sysname> reset arp-snooping vlan 1