Unix Like, 操作系统

Remove “Determining if ip address (^([0-9]{1,3}\.){3,3}[0-9]{1,3}$) is already in use for device (^[a-zA-Z0-9]+$)…”

Have you ever binded a lot of ip addresses to your CentOS?

If your answer is yes, you must have seen some informations like this:

Determining

 

What a anti-human decision to determining a large of ip address in use on boot.

In CentOS, /etc/init.d/network run ifup to bring up your interface, fortunately, ifup is not a binary file but a shell script, so we have a chance to remove this anti-human function.

Change dir to /etc/sysconfig/network-scripts/ and run “ls”, we can see several ifup script:

We use grep to search key words “Determing if”:

Results:

We need to modify both ifup-eth and ifup-aliases files so as to clean this function.

Open ifup-eth, go to 244 line, we can see some code like this:

Code

ifup uses arping to know whether there a  MAC address is using the ip address is going to bind for this host.

ARP packages are broadcast packages, aftering send a arp package to determining ip in use, arping need to wait for a reply broadcast package.

When there is a host using that ip, arping can get that reply package quickly, but if not, arping need to wait for several seconds so as to confirm no host is using the ip address.

According to the code in 243 line, we can know if the device is lo or APRCHECK is set to no, the ARPCHECK will be skip.

So we just need to add such line to the ifcfg files:

Now the “Determing if” does not show on boot anymore.

(91 Posts)

自信、努力、活出精彩;以前未所见的颜色,绘大千世界!

View all author’s posts

Leave a reply