This is how you can add a different IP / Gateway to your cPanel
Hi guys,
I needed badly to introduce another IP address and another gateway that comes with it but cPanel Add IP doesn't operate that way, and nmtui doesn't either but you can do it with nmcli
This takes into count you are working with a /24 and that your interface is called em1
nmcli connection modify em1 +ipv4.addresses "a.b.c.d/<cidr>"
nmcli connection modify em1 +ipv4.routes "a.b.c.d/<cidr> a.b.c.254/24"
nmcli connection down em1 && nmcli connection up em1
When you check Show IP you can see it appear in cPanel and it is fully functional, It can be assigned and everything.
I don't fully understand why cPanel doesn't support this or even give a good guide on how to do this but I can confirm this easily works on Alma 8+ using nmtui/nmcli for management.
Your thoughts?
-
You should really manage the IPs from cPanel instead. Have you tried adding it from there?
Andrew N. - cPanel Plesk VMWare Certified Professional
Do you need immediate assistance? 20 minutes response time!* Open a ticket
EmergencySupport - Professional Server Management and One-time Services0 -
The cPanel Add IP feature is more geared towards simple, straightforward IP assignments so your situation complex system you cant using this feature. Your solution is good I think.
1 -
Yes this solution works, it binds the secondary Ip to the em1 the primary same as cPanel, and you can use it as a default IP or as a secondary IP for the users, but my use case is that Im just slowly transitioning so this helps. This is also kinda cool that you can have a separate A class if you would like to park one website on your server that isn't even remotely close to the default IP. It would not be difficult for cPanel to add a "+Advanced Assignment" button there for someone who wants to create a custom routing.
0 -
Andrew, I will manage of course the IP's within cPanel but in this case I needed to be able to add a separate IP on a separate Gateway, this is not doable in cPanel but I have tested this way and it works fine, it's just embedded into the nmcli along with the other main IP and gateway it even appears in "show ip" in WHM. It's just not doable to have dual gateway in a single node of cPanel as is :)
0
Please sign in to leave a comment.
Comments
4 comments