Dynamic ARP entry learning In most cases, devices can dynamically learn and update ARP entries through the ARP protocol. How do devices learn dynamically? In fact, dynamic ARP mainly completes address resolution through the two processes of broadcasting ARP request messages and unicasting ARP reply messages. For example, Xiao A and Xiao C exchanged IP addresses at a party. As shown in the figure above, when Xiao A needs to communicate with Xiao C, he knows that Xiao C's IP address is 10.1.1.3/24. After judgment, he finds that it is in the same network segment 10.1.1.0/24 as himself, so Xiao A broadcasts an ARP request message to request Xiao C's MAC address. After receiving the ARP request message, Xiao C will unicast an ARP reply message to tell the other party that his MAC address is 3-3-3. (Xiao B in the same network segment will also receive the ARP request message, but because the destination IP address in the ARP request message is not Xiao B's IP address, Xiao B will not respond.) After Xiao A receives the ARP reply message, he will add a dynamic entry to his ARP table: IP address 10.1.1.3 corresponds to MAC address 3-3-3, so that Xiao A can communicate with Xiao C. Note: Due to the limited capacity of the ARP table and to ensure the accuracy of dynamic ARP entries, the PC or switch will age the learned dynamic ARP entries. The dynamic ARP entries on the switch have a certain aging time, the default value is 20 minutes, and it is generally recommended to use the default value. When the dynamic ARP entry on the device reaches the aging time, the device will send an aging detection message (i.e., ARP request message). If an ARP reply message is received, the dynamic ARP entry is updated and the aging detection ends. If no ARP reply message is received after the set aging detection times, the dynamic ARP entry is deleted and the aging detection ends. Static ARP entry configuration For important devices in the network, such as servers, we can configure static ARP entries on the switch. This can prevent the ARP entries corresponding to the IP addresses of important devices on the switch from being incorrectly updated by ARP attack messages, thereby ensuring normal communication between users and important devices. Static ARP entries will not age and will not be overwritten by dynamic ARP entries. Users can manually configure static ARP entries. For example, there is an important server in the network, the IP address of the server is 172.16.10.2, and the MAC address is 0023-0045-0067. If the GE1/0/1 interface of the switch connected to the server is in Layer 2 mode and added to VLAN 100, then a corresponding ARP entry can be configured for the server on the switch. The specific configuration is as follows.
For the server above, if the interface connecting the switch to the server is in Layer 3 mode, you can configure static ARP entries on the switch as follows.
ARP Proxy As mentioned above, when a host performs dynamic ARP learning, if it finds that the destination IP address is in the same network segment as itself, it will send a broadcast ARP request message to perform ARP learning. However, in some cases, although the two hosts are in the same network segment, they are not in the same broadcast domain. The destination host cannot receive the ARP request message, and therefore cannot successfully learn the ARP table entry. After enabling ARP proxy on the switch connecting the two hosts, the switch acts as an intermediary. When Host_1 sends an ARP request message to request the MAC address of Host_2, the switch will tell Host_1 its own MAC address. In this way, the data message sent by Host_1 to Host_2 will be sent to the switch first, and then forwarded to Host_2 by the switch. For example, in the following three situations, we can use ARP proxy. Case 1: Hosts Host_1 and Host_2 (no default gateway is configured on the hosts) that need to communicate are in the same network segment but not in the same physical network (that is, not in the same broadcast domain). Because they are in different broadcast domains, Host_2 cannot receive the ARP request message sent by Host_1. In this case, you can enable the routing Proxy ARP function (arp-proxy enable) on the VLANIF10 and VLANIF20 interfaces of the switch to achieve communication between Host_1 and Host_2. Case 2: Hosts Host_1 and Host_2 that need to communicate are in the same network segment and belong to the same VLAN, but port isolation is configured for interfaces IF_1 and IF_2 in the VLAN. Since the interfaces IF_1 and IF_2 are isolated, Host_2 cannot receive the ARP request message sent by Host_1. In this case, you can enable the intra-VLAN Proxy ARP function (arp-proxy inner-sub-vlan-proxy enable) on the VLANIF interface associated with VLAN10 on the Switch to implement Layer 3 communication between Host_1 and Host_2. Case 3: Hosts Host_1 and Host_2 that need to communicate are in the same network segment but belong to different VLANs. Since they are not in the same VLAN, Host_2 cannot receive the ARP request message sent by Host_1. In this case, you can enable the inter-VLAN Proxy ARP function (arp-proxy inter-sub-vlan-proxy enable) on the VLANIF30 interface on the Switch that is associated with VLAN10 and VLAN20 to achieve Layer 3 communication between Host_1 and Host_2. How to ensure ARP table security? 1. Ensure that ARP packets from legitimate users can be sent to the CPU for processing By default, to ensure the normal operation of the CPU, the switch sets a CPCAR value for each protocol packet sent to the CPU. Packets exceeding the CPCAR value will be discarded. If illegal users send a large number of ARP packets, the ARP packets of legitimate users will not be sent to the CPU, and ARP entries will not be generated normally. (1) ARP message rate limit function Limit the rate of ARP packets based on the source MAC address.
Limit the rate of ARP packets based on the source IP address.
Limit the ARP packet rate globally.
Limit the rate of ARP packets based on VLAN.
Limit the rate of ARP packets based on interfaces.
(2) ARP Miss message rate limit function If a user on the network sends a large number of IP packets whose target IP addresses cannot be resolved to the device (that is, there is a routing table entry corresponding to the destination IP of the IP packet in the routing table, but the device does not have an ARP table entry corresponding to the next hop in the routing table entry), the device will trigger a large number of ARP Miss messages. Such IP packets that trigger ARP Miss messages will be sent to the CPU for processing. The device will generate and issue a large number of temporary ARP table entries based on the ARP Miss messages and send a large number of ARP request packets to the destination network, which increases the burden on the device CPU. By limiting the rate of ARP Miss messages, you can reduce the burden on the device CPU, so that ARP packets from legitimate users are likely to be sent for processing. ARP Miss message rate limit based on source IP address.
Limit the rate of ARP Miss messages globally. You can also limit the rate of ARP Miss messages based on VLAN or interface.
(3) Egress ARP detection function Egress ARP detection reduces the CPU burden by reducing the number of broadcast messages in the VLAN. Its core principle is to find the outbound interface corresponding to the destination IP address according to the DHCP Snooping table, and send the ARP request message directly from the found outbound interface, thereby reducing the number of ARP messages broadcast in the VLAN and thus reducing the CPU burden. The egress ARP detection function is mainly used to reduce the number of ARP packets processed by the gateway device. As shown in Figure 1, by enabling the egress ARP detection function on the L2switch, the DHCP Snooping binding table can be searched before the L2switch broadcasts the ARP request packet. If the egress interface corresponding to the destination IP address in the ARP packet can be found, the ARP request packet is sent out from the found egress interface, effectively reducing the number of ARP request packets received by the gateway. The configuration method of the egress ARP detection function is as follows:
2. Ensure the correctness of ARP entries (1) Preventing Phishing Gateway Attacks Provide the following methods to prevent attacks from fake gateways: The configuration method is as follows: Configure the gateway to periodically send gratuitous ARP packets.
Configure ARP gateway conflict prevention detection.
Configure the ARP gateway protection function.
(2) Prevent attacks by impersonating legitimate users ARP entry fixation:
Dynamic ARP detection function: The device will check the IP address, MAC address, VLAN or interface information of the received ARP message against the entry content recorded in the binding table according to the DHCP Snooping binding table. If they do not match, they will be discarded directly. You can configure ARP entry fixation globally or on an interface.
Configure the dynamic ARP inspection function based on interfaces and VLANs.
3. Ensure that ARP entries for legitimate users can be generated normally (1) Limit the number of ARP entries that can be learned When an attacker is found on an interface and occupies a large amount of ARP table resources, the ARP table can be prevented from being exhausted by limiting the number of ARP entries that the interface can learn. When the number of ARP entries learned on the interface reaches the specified limit, the interface will no longer learn new ARP entries. (2) Strict ARP entry learning Only the reply message of the ARP request message actively sent by the local device can trigger the local device to perform ARP learning. The ARP message actively sent to the local device by other devices cannot trigger the local device to perform ARP learning. The configuration method is as follows: Limit ARP entries.
Configure strict ARP entry learning.
View the ARP table
|
>>: How to protect data in an increasingly insecure environment?
Tempest is a site opened by path.net in 2020. It ...
Wang Guirong, general manager of China Telecom...
Digital transformation has been fully launched in...
[51CTO.com original article] In recent years, pro...
In 2020, the country's top leadership has cla...
5G is coming, and it will be possible to experien...
EBS Monitoring Status Block storage is a block de...
Intuitively, 5G has a very obvious role in drivin...
[Shenzhen, China, March 30, 2020] Today, Huawei o...
The business of the three major operators has bee...
[[255972]] If you use the popular file explorer a...
[51CTO.com original article] Recently, Cisco anno...
This article is reprinted from the WeChat public ...
my country's 5G has been officially commercia...
The Internet of Things has become a globally reco...