cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Support DHCP

Ruben Kerkhof shared this idea 6 years ago
Open Discussion

At the moment WHM doesn't support VM's with the main ip assigned by DHCP.

In larger complex environments it's not always possible to assign static IPs.

Not being able to use dynamic addressing makes VM moment and restores from backups or snapshots to different VPSes harder than it should be.

Replies (10)

photo
1

What are you actually asking here?


Are you asking for cPanel to work with DHCP enabled on the server, but the IP address being provided via DHCP is going to be static/fixed? Or are you asking for cPanel to be able to work with a dynamic and changing IP address?

photo
1

Both actually. I work with reserved leases which don't change, but I also restore snapshots to different servers so the reserved ip changes.

photo
1

Reserved leases definitely work fine with cPanel, as we use these on a daily basis. What problem are you having specifically?

photo
2

First cPanel doesn't officially support DHCP, I'd like that to change.

Secondly there's currently no way to keep your DHCP IP and /var/cpanel/mainip in sync.

photo
2

I don't think you understand the intended purpose of cPanel. It's meant to be used in hosting environments, where DHCP (or at least dynamic and constantly changing addresses) are not likely to be an issue. It is not logical, nor reasonable, to expect cPanel to detect IP changes and constantly update all configuration files and DNS to a new address. I would also argue that such an environment is not suitable to host anything production worthy. Perhaps it would be useful for messing around on a home connection but that's not the purpose of this software.


cPanel does absolutely and 100% definitively work fine with DHCP environments in which the IP address is from a fixed or static assignment. In a dynamic assignment? Not likely. Why would you be using cPanel in such a non-suited environment to begin with?

photo
1

Can you please accept that there are hosting environments out there where DHCP is used? Yours might not be one of them but mine is. I don't think my request for cPanel to detect an IP change (at boot is fine) is unreasonable at all, otherwise I wouldn't have opened this request.

photo
1

I'm trying to understand your requirements and this feature request, is all. Where are you installing cPanel where your IP address is changing frequently?


Most professional and production grade hosting infrastructures do not utilise DHCP, or at least do not have dynamic IP addresses. This is why I am questioning your request and trying to determine how it fits in with cPanel's intended target audience and design.

photo
2

I can't share much details of my environment here, but it's safe to say that we run hundreds of cPanel instances.

The ips of our cPanel instance do not change frequently, but they *can* change, for instance if I migrate the instance to a different network segment or restore a block-level snapshot of an instance to another one.

I certainly know of a few other providers who use DHCP and will probably have or will have these same issues. And then with IPv6 and SLAAC this will become an even bigger problem.

For what it's worth, WHM reads the primary ip from the interface just fine. My specific issue is that that same IP has to be set in /var/cpanel/mainip. If you don't do that and leave that file empty, /etc/init.d/ipaliases doesn't bring up any extra IP's after a reboot.

photo
1

So basically like as if you were using Linode or Digital Ocean for your infrastructure (for example), then... :) Since it's just the mainip file you need to update, this surely takes all of 2 seconds to do manually via a script? For example:


  1. ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' | head -n 1 > /var/cpanel/mainip

The 'IP Migration Wizard' is also built to accomodate broader IP changes, such as rebuilding configuration files, updating DNS, etc.


I realise you're asking for official cPanel support to have all this done automatically, but I think this is a niche request. I don't know of anyone who uses cPanel in an environment where this becomes a regular issue that needs to be addressed. Sure, there are situations where people may need to change IP's, but for the most part cPanel handles this with the built in tools pretty easily.

photo
2

Since it's not officially supported I don't know if updating /var/cpanel/mainip is al that's needed.

It seems to work in practice but that's not the point.

If it takes me 2 seconds to write a script to fill that file, it would take the cPanel devs 2 seconds too, and make this a supported option.


I'm sorry, but I'm stuck with this issue and my existing environment. That you don't know anyone else having this issue doesn't make it magically disappear for me and my customers. I don't disagree with you that this is a niche request, and I certainly don't expect the cPanel developers to drop everything they're doing and start working on fixing this.

Leave a Comment
 
Attach a file