Setting up my Static Ip Addresses from ISP behind NAT

souleater7

Member
Jan 9, 2014
12
0
1
Wolverhampton, United Kingdom
cPanel Access Level
Root Administrator
Hello, i have just received my Static IP addresses from my ISP

They are as follows
79.77.xx.xx
79.77.xx.xx (Router Main)
79.77.xx.xx
79.77.xx.xx

My question is how do i set this up in cPanel, when i installed cPanel it found 79.77.41.93 and also found i was behind a nat router, but it didn't find my other IP addresses.

I went to add a ip address and it said i needed to add local ip addresses and then assign them my public ip addresses, fair enough

my server ip is 192.168.1.7

so i added 192.168.1.8-10

Then i tried to assign my remaining public IP addresses to the IP addresses i just added, this did not work, Now i cannot remove them from my cpanel as the delete button is missing,

I tried to see if they were in /etc/ips but they were not.

I'm currently re-installing cPanel as I've been at it all night and just cant remove them or setup my other ip addresses, can anybody tell me how to configure this correctly so i can have my 4 Static ip Addresses from my ISP setup in cPanel.

Any help would be appreciated.

Peter
 
Last edited by a moderator:

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
959
76
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
Here's the documentation on 1:1 NAT:

1:1 NAT


Usually when you're not able to remove IPs through WHM due to the Delete button missing, it's because cPanel thinks the IP is either already assigned, or is added as a 'physical' interface instead of an alias. For example, em1 (default interface on CentOS 6) is the main interface and cannot be removed through WHM. However, any IPs you add through WHM are added as aliases, ie em1:cp0, em1:cp1, etc and can be removed if they are not assigned. You can view IP assignments in WHM as well.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Thank you so much for your response, off the command i'm only getting one IP, do i need to do anything to make the static IP's discoverable on my network?

Peter
You can restart the "ipaliases" service if the IP addresses are already configured on the server. EX:

Code:
service ipaliases restart
Thank you.
 

souleater7

Member
Jan 9, 2014
12
0
1
Wolverhampton, United Kingdom
cPanel Access Level
Root Administrator
Hello, it seems my solution was quite simple, i setup my server with a local ip address when i should have given it one of the static ip address (any but the main), this resulted in my cpanel not being behind a Nat.

to do this i run the following command

system-config-network

I then had to delete my nat by the following command

rm /var/cpanel/cpnat

It then fixed all my problems, i could add my ip addresses no problem, its all working

although i had to run

service ipaliases restart

this morning as only 1 ip was showing, strange.


Also the NAT 1:1 documentation has been removed (it was live this morning but now shows page not available)

All Fixed.

Thank you
 

souleater7

Member
Jan 9, 2014
12
0
1
Wolverhampton, United Kingdom
cPanel Access Level
Root Administrator
Every day my extra IP addresses seem to go missing from show IP (and the sites on the IP addresses stop working)

the only way to get them to reappear is for me to run the following command

/etc/rc.d/init.d/ipaliases restart

Then they instantly become available in show ip addresses and the websites are accessible again, any ideas whats causing this?

Peter
 

souleater7

Member
Jan 9, 2014
12
0
1
Wolverhampton, United Kingdom
cPanel Access Level
Root Administrator
It's been ok for the last hour, i seemed to have some old local ip addresses in the etc/ips file, i've removed them now, hopefully this will stop the need for restart, here is the info you requested.



root@server [~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 38:EA:A7:AB:EF:14
inet addr:79.xx.41.xx Bcast:79.77.41.255 Mask:255.255.255.0
inet6 addr: fe80::3aea:a7ff:feab:ef14/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13941 errors:0 dropped:0 overruns:0 frame:0
TX packets:13113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2453504 (2.3 MiB) TX bytes:8370322 (7.9 MiB)
Interrupt:18

eth0:cp1 Link encap:Ethernet HWaddr 38:EA:A7:AB:EF:14
inet addr:79.xx.41.xx Bcast:79.77.41.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:18

eth0:cp2 Link encap:Ethernet HWaddr 38:EA:A7:AB:EF:14
inet addr:79.xx.41.xx Bcast:79.77.41.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:18

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12688 errors:0 dropped:0 overruns:0 frame:0
TX packets:12688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4202667 (4.0 MiB) TX bytes:4202667 (4.0 MiB)