RHEL/CentOS 6 network takes FOREVER to start when there’s lots of IP’s

Share Button

Do you ever run into this issue?  You need to reconfigure networking and do a network restart and this happens:

# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Determining if ip address 192.0.2.1 is already in use for device eth0...
Determining if ip address 192.0.2.2 is already in use for device eth0...
Determining if ip address 192.0.2.3 is already in use for device eth0...
Determining if ip address 192.0.2.4 is already in use for device eth0...
Determining if ip address 192.0.2.5 is already in use for device eth0...
Determining if ip address 192.0.2.6 is already in use for device eth0...
                                                           [  OK  ]

That duplicate ip address check takes a LONG time.  On a large web server, you may have hundreds of IP addresses defined for SSL-based websites, and that means your server could take up to 15 or even 30 minutes to restart networking or boot up initially; turning your maintenance windows into a nightmare.  This behavior was introduced somewhere around RHEL/CentOS 6.3+ and uses ARP to do the check of each and every IP.

Fortunately, it is easily disabled if you want to revert back to the earlier behavior.  No I don’t know why some idiot decided once again that changing default behavior would be a great idea.  Just add this to your interface files:

ARPCHECK=no

Initially, I thought it could just be added to /etc/sysconfig/network and it would affect all IP’s on the server but that didn’t seem to work. Instead, it has to be added to each interface file. This is pretty easy to do manually if you use range files like /etc/sysconfig/network-scripts/ifcfg-eth0-range0 to define all of your IP’s, but if you use individual files for each IP, like what you’d end up with if you add IP’s through a control panel like Plesk, then you could have hundreds of /etc/sysconfig/network-scripts/ifcfg-eth0:# type files. In that case, use this command to add the arpcheck disable to all of them:

find /etc/sysconfig/network-scripts/ -name ifcfg-eth0\* -type f -exec sh -c 'echo ARPCHECK=no >> $1' -- {} \;

You may need to modify eth0 to em1 or similar depending on how your web server is configured.

Share Button

2 Replies to “RHEL/CentOS 6 network takes FOREVER to start when there’s lots of IP’s”

  1. Liron

    Well the issue in Cento 7 became problematic (I have about 500+ ip’s)
    Every time the Network service failed to start because the time it took was over couple of minutes.
    Adding this option for the testing interfaces fixed the issue.
    Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *