I get problem with main ip when adding new IP to the server


Apr 5, 2023
cPanel Access Level
Website Owner

I have network interface ens18 with IP A.A.A.A and cPanel trial license for this IP.

I add new interface ens19 with IP B.B.B.B, no license for this IP.

A.A.A.A and B.B.B.B are different subnets and both are public IP.

And after i restart network, my cPanel main IP automatically change from A.A.A.A to B.B.B.B and i cannot access cpanel anymore with IP https://A.A.A.A:2087, it now change to https://B.B.B.B:2087. But i don't have license for B.B.B.B so i cannot login to cPanel.

Then i run /usr/local/cpanel/scripts/mainipcheck and it show:
info [mainipcheck] The Server's main IP address has changed from A.A.A.A to B.B.B.B.
The “/usr/local/cpanel/cpkeyclt” command (process 690868) reported error number 1 when it ended. at /usr/local/cpanel/scripts/mainipcheck line 210.
info [mainipcheck] Scheduled SPF record update

And the file "/var/cpanel/mainip" has changed to B.B.B.B
# cat /var/cpanel/mainip

I also try the "Add a New IP Address" from cPanel web interface, but it add B.B.B.B into the same interface ens18 with IP A.A.A.A. But A.A.A.A and B.B.B.B are different subnet and gateway, so i cannot use IP B.B.B.B.

So how can i add new IP to my server and keep my main IP is A.A.A.A, without automatically change to B.B.B.B.

Thank you.


Jurassic Moderator
Staff member
Oct 19, 2014
cPanel Access Level
Root Administrator
Hey there! This is likely a better question for your hosting provider, as cPanel doesn't control the networking setup of the system. We just read the data from the operating system, so something is changing when you add that new interface.
  • Like
Reactions: tuth