Brand new WHM 11.44.1 VPS, additional IPs don't stay

Ark

Member
Dec 18, 2012
7
0
1
cPanel Access Level
Root Administrator
I set up 4 sites, 3 on the main IP, and a 4th on a second dedicated IP because it needs SSL. Later, I noticed that the 4th site was not reachable.
"/etc/init.d/ipaliases restart" does not help. "ifconfig" shows that the IP is not bound anymore. The IP is still listed in /etc/ips. Only if I remove the line from /etc/ips can I use IP Functions » Add a New IP Address to add it back in WHM, but it does not stay for long. Rebooting, or doing something like "/etc/init.d/ipaliases restart" actually causes it to be *removed* and it says "UnRouting x.x.x.x [ OK ] / Shutting down eth0:cp1 [ OK ]"

What can I do to get the extra IP to stay? I'm certainly not going to SSH in after each reboot, delete /etc/ips, and then go to WHM and re-add the IP to set it up, every time.
 

Ark

Member
Dec 18, 2012
7
0
1
cPanel Access Level
Root Administrator
This might work, from a shell, find out which eth the IP is bound to then run ( example)
ip link set eth1 up
That command does nothing. I know 'ifconfig' will show the current devices and virtual devices, and the extra IPs should be on eth0:cpX but ifconfig only shows eth0 (main shared IP) and "lo" for localhost IPs. I've Googled around and people having similar issues are all told in other thread that "/etc/init.d/ipaliases restart" will help, and for other people, it seems to. But for me, "/etc/init.d/ipaliases restart" actually will specifically *remove* the extra IPs.
 

Ark

Member
Dec 18, 2012
7
0
1
cPanel Access Level
Root Administrator
A little bit of digging shows that /var/cpanel/mainip is 0 bytes and last modified March 26 (long before this VPS even was started) -- this causes /etc/init.d/ipaliases to grep against "\b\b" in the start) section, thus basically ignoring everything in /etc/ips ...
How is mainip supposed to be populated?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello :)

What method did you use to add the IP address? Did you modify files within /etc/sysconfig/network-scripts or did you simply use Web Host Manager?

Thank you.
 

Ark

Member
Dec 18, 2012
7
0
1
cPanel Access Level
Root Administrator
Hello :)

What method did you use to add the IP address? Did you modify files within /etc/sysconfig/network-scripts or did you simply use Web Host Manager?

Thank you.
It was added via WHM at IP Functions » Add a New IP Address with a 255.255.255.255 subnet.
In fact, nobody SSHed into the VPS with any account, root or otherwise, until I noticed the 4th site dropped off the Internet.

As a work-around, I did find that /var/cpanel/mainip would be regenerated by /scripts/mainipcheck but *only* if I deleted it first. /scripts/mainipcheck wouldn't do anything to fix the 0-byte file that came out of the box from GoDaddy's setup. The VPS was purchased yesterday, and although I'm the guy with root putting everything in place, I didn't pick GoDaddy as the hosting choice, so don't laugh at me for that..
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
I suggest consulting with GoDaddy's support team to have them check why their VPS templates are not populating the /var/cpanel/mainip file.

Thank you.