Categories
cpanel/whm hosting tech

IPAddress is already an active IP

Sometimes, when something odd happens to your server (most of the time intentionally, though not in an ideal situation) when you go to add an IP address to your server, you’ll see this error:

$IPADDRESS is already an active IP. Skipping $IPADDRESS .. already added !

And then when you check the cPanel logs (because you’re a good admin like that), you’ll see this error:

[2013-10-26 15:21:41 -0500] info [xml-api] $IPADDRESS is already an active IP. [addips] version [1].

Well, when that happens there are a plethera of things to check and correct. Hopefully one of these will fix it for you.

Make sure that the IP address you’re trying to add has been removed from these files:

/etc/hosts
/etc/ips
/etc/mail_reverse_dns

If you happen to also be trying to add back the IP that was previous the primary IP address, you will also need to update this file:

/var/cpanel/mainip

This one cannot be manually edited, however, because if you leave the extra space at the end of your line, WHM will still choke. These are the steps I would recommend. First, copy mainip to a new file.

cp /var/cpanel/mainip /var/cpanel/mainip.new

Then, edit /var/cpanel/mainip.new to reflect the new IP address.

vi /var/cpanel/mainip.new

Then cat the new ip into the existing mainip file.

cat /var/cpanel/mainip.new |tr -d "\n" |tr -d "\r" > /var/cpanel/mainip

Once all of that is complete, run these commands and you should be able to add the IP address to WHM again.

/etc/init.d/network restart
/etc/init.d/ipaliases restart
/scripts/rebuildhttpdconf