tomdchi

Well-Known Member
Feb 24, 2008
142
4
68
Atlanta, GA
cPanel Access Level
DataCenter Provider
I have WHM installed on AWS and the networking is configured as DHCP.

/etc/sysconfig/network-scripts/ifcfg-eth0 has

Code:
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=12:fd:fc:7c:55:cc
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
I tried editing this file and setting the static IP assigned but it reverted back to DHCP on reboot. Is there a way to get this to use a static IP or should I just leave it alone? Everything seems to be working OK but I would prefer to have this as static.
 

Eminds

Well-Known Member
Nov 10, 2016
319
32
28
India
cPanel Access Level
Root Administrator
You can edit the configuration as you have mentioned , instead you will need to assign an elastic IP which will be the actual IP of your instance. The reason to assign elastic IP to the instance is , every time you reboot the instance the IP of the aws instance will change
 

tomdchi

Well-Known Member
Feb 24, 2008
142
4
68
Atlanta, GA
cPanel Access Level
DataCenter Provider
You can edit the configuration as you have mentioned , instead you will need to assign an elastic IP which will be the actual IP of your instance. The reason to assign elastic IP to the instance is , every time you reboot the instance the IP of the aws instance will change
Thanks for the reply!

An elastic IP is already assigned and is being used. I have set up WHM servers many times so I am very familiar with it but this is the first time installing on AWS. I found a couple of guides that were pretty old and none of them mentioned doing anything special other than assigning an elastic IP. Will having DHCP set cause any issues?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,275
313
Houston
Hi @tomdchi

cPanel may experience issues with IP if it's not static. You may want to contact AWS to identify the proper network configuration on their servers when running cPanel.

I know I did find some other resources which address the same issue you had here:

Part 2: How I Built a cPanel Hosting Environment on Amazon AWS | cPanel Blog
How to fix local IP in Nat Configuration on WHM/Cpanel on Centos 6 on Google Compute Engine

But if neither of these provides a resolution contacting AWS would be the best route.


Thanks!
 

tomdchi

Well-Known Member
Feb 24, 2008
142
4
68
Atlanta, GA
cPanel Access Level
DataCenter Provider
Finally found the solution! If someone else has the same problem here is what you do:
  1. Edit /etc/sysconfig/network-scripts/ifcfg-eth0 with appropriate parameters to set as static.
  2. Edit /etc/cloud/cloud.cfg and at the end of the file add:
Code:
network:
 config: disabled
Now cloud-init will stop overwriting your network config.
 
  • Like
Reactions: cPanelLauren

mekatech

Member
Aug 11, 2016
12
1
3
Dominican Republic
cPanel Access Level
Root Administrator
Hi @tomdchi

cPanel may experience issues with IP if it's not static. You may want to contact AWS to identify the proper network configuration on their servers when running cPanel.

I know I did find some other resources which address the same issue you had here:

Part 2: How I Built a cPanel Hosting Environment on Amazon AWS | cPanel Blog
How to fix local IP in Nat Configuration on WHM/Cpanel on Centos 6 on Google Compute Engine

But if neither of these provides a resolution contacting AWS would be the best route.


Thanks!
Bro, can you help me to understand how to add elastik ips as dedicated ips to whm for ssl purposes, cpanel is lacking a little support for that