Recently, servers in the data center always send packets externally. After detection, it was found that many ARP spoofing attacks are good. Before learning NP, I learned how to prevent ARP spoofing, in this way, the configuration to prevent ARP spoofing is published.
Cisco protects against ARP spoofing and uses Port Security
Cisco port security has three processing modes in violation of security rules. There are two solutions.
Three Processing modes:
Shudown has the strongest protection capability, but may cause management troubles in some cases. For example, if a virus is detected on a device, the source MAC may send a report on the network.
Protect discards illegal traffic and does not trigger an alarm
Restrict discards illegal traffic and generates an alarm. The usage of the switch's CPU usage increases but does not affect the normal use of the switch. This method is recommended.
Two solutions:
MAC + IP binding
Set the maximum number of MAC learning instances.
I. MAC + IP binding, this method is good, but you need to manually register the MAC addresses of each server, which is too labor-intensive.
Configuration method:
1. Import interface mode
2. switchport port-security // enable port security. This command is required; otherwise, the subsequent configuration does not take effect.
3. switchport port-security mac-address aabb. ccdd. eeff // you can specify the MAC address of the port.
4. switchport port-security violation restrict // set the violation mode to discard and alert
2. Set the learned MAC address and discard other ARP traffic
1. Import interface mode
2. switchport port-security // same as above, required
3. switchport port-security maximum 5 // you can learn up to five MAC addresses.
4. switchport port-security violation restrict // after learning more than five MAC addresses, discard other ARP traffic and give an alarm.
Anti-ARP spoofing settings for Huawei Switches
1. Enter the interface mode int e0/3
2. mac-address max-mac-count 5 // you can learn up to five MAC addresses.