Let's take a look at an example: A linux host IP address: 192.168.0.25MAC: 00: 14: k2: 5d: 8e: b2 a windows host IP address: 192.168.0.25MAC: 00: 25: e4:
Let's look at an example:
IP address of a linux host: 192.168.0.25 MAC: 00: 14: k2: 5d: 8e: b2
IP address of a windows host: 192.168.0.25 MAC: 00: 25: e4: 6a: 4b: f4
The IP addresses of the two hosts are the same (IP: 192.168.0.25), and the MAC addresses are different.
The windows host will prompt IP address conflict, while the linux host will not prompt any
So how do I know whether my linux host conflicts with the IP addresses of other windows hosts on the network?
In fact, it is very simple to execute on the linux host.
# Arping 192.168.0.25
Unicast reply from 192.168.0.25 [00: 25: e4: 6a: 4b: f4] 1.390 ms
If there is no information, it indicates that my IP address in the network is unique.
If the preceding information is displayed, the IP address of a host with the MAC address 00: 25: e4: 6a: 4b: f4 in the network is the same as that of me. in this case, the ifconfig command can be used for verification, you will find that the MAC address of the local machine is 00: 14: k2: 5d: 8e: b2. We can use the LAN scanning software to find the host whose MAC address is 00: 25: e4: 6a: 4b: f4 and isolate or replace the IP address.
Principle: the arping command uses a broadcast address to send arp packets. all hosts in the Ethernet network will receive the arp packets, but the local machine will not Reply any information after receiving the packets. When we execute the following command on the linux host:
By default, eth0 is used for arping 192.168.0.25. one request is sent to all hosts in the Lan:
Who has 192.168.0.25 arp request, tell 192.168.0.25 your mac address,
When this windows host receives this arp packets, it will respond:
"I am 192.168.0.25, mac is 00: 25: e4: 6a: 4b: f4", then we will receive the mac address 00: 25: e4: 6a: 4b: reply information of f4 windows host.