How to Detect IP address conflicts in CentOS

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.