Article Title: bind a MAC address to prevent ARP spoofing. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Sometimes some machines in the LAN are poisoned, and the arp virus packets will always be sent. These arp virus packets will mislead your machine into parsing the mac address of the gateway. Therefore, you need to bind the mac address.
Two methods:
1. List the MAC addresses of all machines in the LAN.
# arpAddress HWtype HWaddress Flags Mask Iface192.168.1.1 ether 00:07:E9:2A:6F:C6 C
|
Then, bind the MAC address,
#arp -s 192.168.1.1 00:07:E9:2A:6F:C6
|
Note: Here 192.168.1.1 may be replaced by hostname, if your gateway has set hostname.
2. Create a/etc/ethers file. For example, if you want to bind a gateway, write the following in/etc/ethers:
192.168.1.1 00: 07: E9: 2A: 6F: C6
Then execute
In this way, the gateway address is bound. If there are other machines bound, add records.
Note: You need to re-bind the MAC address after each restart.
In addition, binding a mac address requires two-way binding: machine a is bound to machine B, and machine B is also bound to machine a, so that the arp virus will be completely blocked.