With providers running out of IPv4 allocations around the world and people resorting to using multiple IP blocks/subnets on the same dedicated server, there’s a chance someone will run into this problem. If you have multiple subnets on the same box, chances are cPanel will get confused and use one of the other subnets as the outgoing IP for license verification purposes. This causes issues because now the cPanel licensing server thinks you’re not licensed (outgoing IP doesn’t match on-file IP). NB: we aren’t circumventing any licensing mechanism (unethical). This issue can happen to a wide array of software that depends on the outgoing email address (ex: email).
Here’s how your eth0:X layout might look like:
eth0 -> 126.96.36.199 / 255.255.255.0
eth0:0 -> 188.8.131.52 / 255.255.255.0
eth0:1 -> 184.108.40.206 /255.255.255.0
So let’s move on to the fix. Normally a cPanel server is licensed against its main IP/interface. In Linux that’s eth0 (0 for zero). So we’re going to tell the server to give eth0’s route a preference over its other interfaces. From the above example, we will increase the metric of eth0:0 and eth0:1 by 1. In metric speak, 0 has higher preference than 1. And 0 happens to be the default metric of interfaces on Linux boxes. All said and done, eth0 will keep its metric of 0 and will the de facto preferred route.
So open /etc/sysconfig/network-scripts/ifcfg-eth0:0 and add this line at the end of the file:
And here’s a visual:
Do the same for /etc/sysconfig/network-scripts/ifcfg-eth0:0 or any other interfaces you have. To effect this change on your system, you’ll need to run this next command but be warned this could knock your server offline if you end up doing things precariously and especially if you’re remoted in via SSH. Here’s the command:
nohup /etc/init.d/network restart &
The above command will freeze your terminal (understandably because you’ve restarted the network subsystem). Wait a minute or two, then open a new SSH/console and get back in as you would normally. It’s preferable to complete this work at the console or via KVMoIP.
That’s all folks!