10-Security

HomeSupportResource CenterH3C Access Controllers Command References(E5208P03 E5215P01 R5215P01)-6W10210-Security
17-ARP attack protection commands
Title Size Download
17-ARP attack protection commands 81.82 KB

ARP attack protection commands

The WX1800H series, WX2500H series, and WX3000H series access controllers do not support the slot keyword or the slot-number argument.

Source MAC-based ARP attack detection commands

arp source-mac

Use arp source-mac to enable the source MAC-based ARP attack detection feature and specify a handling method.

Use undo arp source-mac to restore the default.

Syntax

arp source-mac { filter | monitor }

undo arp source-mac [ filter | monitor ]

Default

The source MAC-based ARP attack detection feature is disabled.

Views

System view

Predefined user roles

network-admin

Parameters

filter: Generates log messages and discards subsequent ARP packets from the MAC address.

monitor: Only generates log messages.

Usage guidelines

Configure this feature on the gateways.

This feature checks the number of ARP packets delivered to the CPU. If the number of ARP packets from the same MAC address within 5 seconds exceeds a threshold, the device takes the preconfigured method to handle the attack.

If you do not specify both the filter and monitor keywords for the undo arp source-mac command, the command disables this feature.

Examples

# Enable the source MAC-based ARP attack detection feature and specify the filter handling method.

<Sysname> system-view

[Sysname] arp source-mac filter

arp source-mac aging-time

Use arp source-mac aging-time to set the aging time for ARP attack entries.

Use undo arp anti-attack source-mac aging-time to restore the default.

Syntax

arp source-mac aging-time time

undo arp source-mac aging-time

Default

The aging time for ARP attack entries is set to 300 seconds.

Views

System view

Predefined user roles

network-admin

Parameters

time: Sets the aging time for ARP attack entries, in the range of 60 to 6000 seconds.

Examples

# Set the aging time for ARP attack entries to 60 seconds.

<Sysname> system-view

[Sysname] arp source-mac aging-time 60

arp source-mac exclude-mac

Use arp anti-attack source-mac exclude-mac to exclude specific MAC addresses from source MAC-based ARP attack detection.

Use undo arp anti-attack source-mac exclude-mac to remove the excluded MAC addresses.

Syntax

arp source-mac exclude-mac mac-address&<1-10>

undo arp source-mac exclude-mac [ mac-address&<1-10> ]

Default

No MAC address is excluded from source MAC-based ARP attack detection.

Views

System view

Predefined user roles

network-admin

Parameters

mac-address&<1-10>: Specifies a MAC address list. The mac-address argument indicates an excluded MAC address in the format of H-H-H. &<1-10> indicates that you can specify a maximum of 10 excluded MAC addresses.

Usage guidelines

If you do not specify a MAC address, the undo arp source-mac exclude-mac command removes all excluded MAC addresses.

Examples

# Exclude a MAC address from source MAC-based ARP attack detection.

<Sysname> system-view

[Sysname] arp source-mac exclude-mac 2-2-2

arp source-mac threshold

Use arp source-mac threshold to set the threshold for source MAC-based ARP attack detection. If the number of ARP packets sent from a MAC address within 5 seconds exceeds this threshold, the device recognizes this as an attack.

Use undo arp source-mac threshold to restore the default.

Syntax

arp source-mac threshold threshold-value

undo arp source-mac threshold

Default

The threshold for source MAC-based ARP attack detection is 50.

Views

System view

Predefined user roles

network-admin

Parameters

threshold-value: Specifies the threshold for source MAC-based ARP attack detection. The value range for this argument is 1 to 5000.

Examples

# Set the threshold for source MAC-based ARP attack detection to 30.

<Sysname> system-view

[Sysname] arp source-mac threshold 30

display arp source-mac

Use display arp source-mac to display ARP attack entries detected by source MAC-based ARP attack detection.

Syntax

display arp source-mac { slot slot-number | interface interface-type interface-number }

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Specifies an interface by its type and number.

slot slot-number: Specifies an IRF member device by its ID. If you do not specify a member device, this command displays ARP attack entries for the master device.

Examples

# Display the ARP attack entries detected by source MAC-based ARP attack detection on GigabitEthernet 1/0/1.

<Sysname> display arp source-mac interface gigabitethernet 1/0/1

Source-MAC          VLAN ID  Interface                Aging-time

23f3-1122-3344      4094     GE1/0/1                  10

23f3-1122-3355      4094     GE1/0/2                  30

23f3-1122-33ff      4094     GE1/0/3                  25

23f3-1122-33ad      4094     GE1/0/4                  30

23f3-1122-33ce      4094     GE1/0/5                  2

ARP packet source MAC consistency check commands

arp valid-check enable

Use arp valid-check enable to enable ARP packet source MAC address consistency check on the gateway.

Use undo arp valid-check enable to disable ARP packet source MAC address consistency check.

Syntax

arp valid-check enable

undo arp valid-check enable

Default

ARP packet source MAC address consistency check is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Configure this feature on gateways. The gateways can filter out ARP packets whose source MAC address in the Ethernet header is different from the sender MAC address in the message body.

Examples

# Enable ARP packet source MAC address consistency check.

<Sysname> system-view

[Sysname] arp valid-check enable

ARP active acknowledgement commands

arp active-ack enable

Use arp active-ack enable to enable the ARP active acknowledgement feature.

Use undo arp active-ack enable to restore the default.

Syntax

arp active-ack [ strict ] enable

undo arp active-ack [ strict ] enable

Default

The ARP active acknowledgement feature is disabled.

Views

System view

Predefined user roles

network-admin

Parameters

Strict: Enables strict mode for ARP active acknowledgement.

Usage guidelines

Configure this feature on gateways to prevent user spoofing.

In strict mode, a gateway learns an entry only when ARP active acknowledgement is successful based on the correct ARP resolution.

Examples

# Enable the ARP active acknowledgement feature.

<Sysname> system-view

[Sysname] arp active-ack enable

Authorized ARP commands

arp authorized enable

Use arp authorized enable to enable authorized ARP on an interface.

Use undo arp authorized enable to restore the default.

Syntax

arp authorized enable

undo arp authorized enable

Default

Authorized ARP is disabled on the interface.

Views

Layer 3 Ethernet interface view

Layer 3 Ethernet subinterface view

VLAN interface view

Predefined user roles

network-admin

Examples

# Enable authorized ARP on VLAN-interface 100.

<Sysname> system-view

[Sysname] interface vlan-interface 100

[Sysname-Vlan-interface100] arp authorized enable

ARP attack detection commands

arp detection enable

Use arp detection enable to enable ARP attack detection.

Use undo arp detection enable to restore the default.

Syntax

arp detection enable

undo arp detection enable

Default

ARP attack detection is disabled.

Views

VLAN view

Predefined user roles

network-admin

Examples

# Enable ARP attack detection for VLAN 2.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] arp detection enable

Related commands

arp detection rule

arp detection rule

Use arp detection rule to configure a user validity check rule.

Use undo arp detection rule to delete a user validity check rule.

Syntax

arp detection rule rule-id { deny | permit } ip { ip-address [ mask ] | any } mac { mac-address [ mask ] | any } [ vlan vlan-id ]

undo arp detection rule [ rule-id ]

Default

No user validity check rule is configured.

Views

System view

Predefined user roles

network-admin

Parameters

rule-id: Assigns an ID to the user validity check rule. The ID value range is 0 to 511. A smaller value represents a higher priority.

deny: Denies matching ARP packets.

permit: Permits matching ARP packets.

ip { ip-address [ mask ] | any }: Specifies the sender IP address as the match criterion.

·     ip-address: Specifies an IP address.

·     mask: Specifies the mask for the IP address.

·     any: Matches any IP address.

mac { mac-address [ mask ] | any }: Specifies the sender MAC address as the match criterion.

·     mac-address: Specifies a MAC address in the H-H-H format.

·     mask: Specifies the MAC address mask in the H-H-H format.

·     any: Matches any MAC address.

vlan vlan-id: Specifies the ID of a VLAN to which the specified rule applies. The value range for the vlan-id argument is 1 to 4094. If you do not specify a VLAN, the rule applies to all VLANs.

Usage guidelines

A user validity check rule takes effect only when ARP attack detection is enabled.

If you do not specify a rule ID, the undo arp detection rule command deletes all user validity check rules.

Examples

# Configure a user validity check rule and enable ARP detection for VLAN 2.

<Sysname> system-view

[Sysname] arp detection rule 0 permit ip 10.1.1.1 255.255.0.0 mac 0001-0203-0405 ffff-ffff-0000

[Sysname] vlan 2

[Sysname-vlan2] arp detection enable

Related commands

arp detection enable

arp detection trust

Use arp detection trust to configure an interface as an ARP trusted interface.

Use undo arp detection trust to restore the default.

Syntax

arp detection trust

undo arp detection trust

Default

An interface is an ARP untrusted interface.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

Predefined user roles

network-admin

Examples

# Configure GigabitEthernet 1/0/1 as an ARP trusted interface.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] arp detection trust

arp detection validate

Use arp detection validate to enable ARP packet validity check.

Use undo arp detection validate to disable ARP packet validity check.

Syntax

arp detection validate { dst-mac | ip | src-mac } *

undo arp detection validate [ dst-mac | ip | src-mac ] *

Default

ARP packet validity check is disabled.

Views

System view

Predefined user roles

network-admin

Parameters

dst-mac: Checks the target MAC address of ARP responses. If the target MAC address is all-zero, all-one, or inconsistent with the destination MAC address in the Ethernet header, the packet is considered invalid and discarded.

ip: Checks the sender and target IP addresses of ARP replies, and the sender IP address of ARP requests. All-one or multicast IP addresses are considered invalid and the corresponding packets are discarded.

src-mac: Checks whether the sender MAC address in the message body is identical to the source MAC address in the Ethernet header. If they are identical, the packet is forwarded. Otherwise, the packet is discarded.

Usage guidelines

You can specify more than one object to be checked in one command line.

If no keyword is specified, the undo arp detection validate command disables ARP packet validity check for all objects.

Examples

# Enable ARP packet validity check by checking the MAC addresses and IP addresses of ARP packets.

<Sysname> system-view

[Sysname] arp detection validate dst-mac src-mac ip

arp restricted-forwarding enable

Use arp restricted-forwarding enable to enable ARP restricted forwarding.

Use undo arp restricted-forwarding enable to disable ARP restricted forwarding.

Syntax

arp restricted-forwarding enable

undo arp restricted-forwarding enable

Default

ARP restricted forwarding is disabled.

Views

VLAN view

Predefined user roles

network-admin

Examples

# Enable ARP restricted forwarding in VLAN 2.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] arp restricted-forwarding enable

display arp detection

Use display arp detection to display the VLANs enabled with ARP attack detection.

Syntax

display arp detection

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display the VLANs enabled with ARP attack detection.

<Sysname> display arp detection

ARP detection is enabled in the following VLANs:

1-2, 4-5

Related commands

arp detection enable

display arp detection statistics

Use display arp detection statistics to display ARP attack detection statistics.

Syntax

display arp detection statistics [ interface interface-type interface-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

interface interface-type interface-number: Displays the ARP attack detection statistics of an interface.

Usage guidelines

This command displays numbers of packets discarded by user validity check and ARP packet validity check. If you do not specify an interface, the command displays statistics for all interfaces.

Examples

# Display the ARP attack detection statistics for all interfaces.

<Sysname> display arp detection statistics

State: U-Untrusted  T-Trusted

ARP packets dropped by ARP inspect checking:

Interface(State)            IP        Src-MAC   Dst-MAC   Inspect

GE1/0/1(U)                  40        0         0         78

GE1/0/2(U)                  0         0         0         0

GE1/0/3(T)                  0         0         0         0

GE1/0/4(U)                  0         0         30        0

Table 1 Command output

Field

Description

State

State of an interface:

·     U—ARP untrusted interface.

·     T—ARP trusted interface.

Interface(State)

Inbound interface of ARP packets. State specifies the port state, trusted or untrusted.

IP

Number of ARP packets discarded due to invalid sender and target IP addresses.

Src-MAC

Number of ARP packets discarded due to invalid source MAC address.

Dst-MAC

Number of ARP packets discarded due to invalid destination MAC address.

Inspect

Number of ARP packets failed to pass user validity check.

 

ARP scanning and fixed ARP commands

arp fixup

Use arp fixup to convert existing dynamic ARP entries to static ARP entries.

Syntax

arp fixup

Views

System view

Predefined user roles

network-admin

Usage guidelines

The ARP conversion is a one-time operation. You can use this command again to convert the dynamic ARP entries learned later to static.

The static ARP entries converted from dynamic ARP entries have the same attributes as the manually configured static ARP entries. Due to the device's limit on the total number of static ARP entries, some dynamic ARP entries might fail the conversion.

The static ARP entries after conversion can include the following entries:

·     Existing dynamic and static ARP entries before conversion.

·     New dynamic ARP entries learned during the conversion.

Dynamic ARP entries that are aged out during the conversion are not converted to static ARP entries.

To delete a static ARP entry changed from a dynamic one, use the undo arp ip-address command.

Examples

# Enable fixed ARP.

<Sysname> system-view

[Sysname] arp fixup

arp scan

Use arp scan to enable ARP scanning in an address range.

Syntax

arp scan [ start-ip-address to end-ip-address ]

Views

Layer 3 Ethernet interface view

Layer 3 Ethernet subinterface view

VLAN interface view

Predefined user roles

network-admin

Parameters

start-ip-address: Specifies the start IP address of the scanning range.

end-ip-address: Specifies the end IP address of the scanning range. The end IP address must be higher than or equal to the start IP address.

Usage guidelines

ARP scanning automatically creates ARP entries for devices in the specified address range. IP addresses already in existing ARP entries are not scanned.

If the interface's primary and secondary IP addresses are in the address range, the sender IP address in the ARP request is the address on the smallest network segment.

If no address range is specified, the device learns ARP entries for devices on the subnet where the primary IP address of the interface resides. The sender IP address in the ARP requests is the primary IP address of the interface.

The start and end IP addresses must be on the same subnet as the primary IP address or secondary IP addresses of the interface.

ARP scanning will take some time. To stop an ongoing scan, press Ctrl + C. Dynamic ARP entries are created based on ARP replies received before the scan is terminated.

Examples

# Configure the device to scan the neighbors on the network where the primary IP address of VLAN-interface 2 resides.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] arp scan

# Configure the device to scan neighbors in an address range.

<Sysname> system-view

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] arp scan 1.1.1.1 to 1.1.1.20

ARP gateway protection commands

arp filter source

Use arp filter source to enable ARP gateway protection for a gateway.

Use undo arp filter source to disable ARP gateway protection for a gateway.

Syntax

arp filter source ip-address

undo arp filter source ip-address

Default

ARP gateway protection is disabled.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the IP address of a protected gateway.

Usage guidelines

You can enable ARP gateway protection for a maximum of eight gateways on an interface.

You cannot configure both arp filter source and arp filter binding commands on the same interface.

Examples

# Enable ARP gateway protection for the gateway with IP address 1.1.1.1.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] arp filter source 1.1.1.1

ARP filtering commands

arp filter binding

Use arp filter binding to configure an ARP permitted entry. If the sender IP and MAC addresses of an ARP packet match an ARP permitted entry, the ARP packet is permitted. If not, it is discarded.

Use undo arp filter binding to remove an ARP permitted entry.

Syntax

arp filter binding ip-address mac-address

undo arp filter binding ip-address

Default

No ARP permitted entry is configured.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

ip-address: Specifies a permitted sender IP address.

mac-address: Specifies a permitted sender MAC address.

Usage guidelines

You can configure a maximum of eight ARP permitted entries on an interface.

You cannot configure both the arp filter source and arp filter binding commands on the same interface.

Examples

# Configure an ARP permitted entry.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] arp filter binding 1.1.1.1 2-2-2