View Single Post
Old 13th February 2013, 21:22
Unfaiir Unfaiir is offline
HowtoForge Supporter
Join Date: Jul 2012
Location: Orange County, CA, USA
Posts: 43
Thanks: 14
Thanked 4 Times in 2 Posts
Cool CentOS 6.3 - Change From Single Private IP To Multiple Public IP Block

I'm using CentOS 6.3 and ISPConfig 3 and have been up and running on this particular server for several months.

Currently I use a single private IP:

I just bought a new block of 3 public IPs from my ISP:[xx0-xx2]

I've been scouring the forums trying to find out the best way to go about doing this and can only find vague details here and not necessarily for CentOS, so I'm going to create this thread both for asking questions on the right way to do this in ISPConfig, and also I will summarize it up for everyone (including myself for later) as an update to this initial post.

Note: I used 3 IPs, but this information is relevant to any type of IP change.

Here is what I have so far (Note: you can use system-config-network if you want, but I personally find it much easier to do manually. Also, system-config-network doesn't have a delete feature, so you'll have to do it manually anyway if you're consolidating IPs rather adding IPs):

Part I: Server IP Config
1.) Add a new line in /etc/hosts for each new IP address with the same server name as the current IP
vi /etc/hosts
2.) Update your nameservers:
vi /etc/resolv.conf
2.) Copy the network interface config for your network card into 2 alias network interface config files, starting with
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
3.) Open all 3 network interface files and update the IP addresses, network masks, and gateways to the new ones:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
4.) Restart the network service:
service network restart
5.) Verify that everything is up and running
ifconfig | more
Part II: Service IP Config (UPDATE: You can skip to the bottom for Part II if you don't care about the details)
************************************************** **********************************

This is where I'm a bit stuck. What all needs to be updated now? From this post I found ( These seem to be the next steps to take:

Change the IP in /root/ispconfig/httpd/conf/httpd.conf
Change the IP in /etc/postfix/
Change the IP in /etc/proftpd.conf
Change the IP in the includes too
Change the IP through ISPConfig interface
Re-save the hosted sites with the new IP
So, I have some questions though and I hope that someone will have some answers:

1.) In CentOS there is no /root/ispconfig/httpd/conf/httpd.conf. Is this just the normal Apache httpd.conf file that is located in /etc/httpd/conf/httpd.conf or is this a separate file that needs to be modified?

2.) my /etc/httpd/conf/httpd.conf, /etc/postfix/ and my /etc/pure-ftpd/pure-ftpd.conf (the CentOS guide doesn't use proftpd) don't have IP addresses in them, so I'm guessing this can be skipped in my case?

3.) Pure FTP doesn't seem to have includes to change. Is that a Pro FTP only thing?

4.) Changing the IP through the ISPConfig 3 interface is a little confusing too. I've added the IPs using System->Server IP Addresses but what do I do about System->Server Config-> There is only room for one IP here, which IP do I use?

Additonally, the gateway and dns server IPs are not the one's I setup in the system... ever... They say:


So what do i do about these? Do I leave them alone? Do I change them to the Gateway & Nameservers for my new IP Block?

Can someone please shed some light on these 4 questions? I'm really confused and I would prefer not to break anything if I don't have to.


I did a bit of testing and a lot of waiting (For DNS cache to clear), but finally all sites are back up and using the new IP Block. First I'll answer my own questions from above, and then I'll write out the steps for Part II.

1.) In CentOS there is no /root/ispconfig/httpd/conf/httpd.conf so I checked /etc/httpd/conf/httpd.conf but there was no IPs listed so I left it alone.

2.) I checked all of these configuration files but there were no IPs listed so I left them alone too.

3.) The "be sure to modify the includes too" doesn't apply to PureFTP apparently, just ProFTP so I skipped this step as well

4.) This took some testing. I used the main IP from eth0 here and not any of the aliases. I then filled in the netmask, gateway, and nameservers from eth0 here as well but then nothing was loading so I put the netmask, gateway and name servers back to what they were but left the new IP, though looking back, it may have been just the DNS cache hadn't cleared for my sites yet.

So in conclusion, here are the steps I for completing the IP change and/or adding multiple IPs:

Part II: Service IP Config

1.) Check your config files for anywhere that the old IP may be hanging around, though I followed the Perfect Server Guide for CentOS 6.3 and I didn't have to edit any of these. You should still check to be sure though:

vi /etc/httpd/conf/httpd.conf
vi /etc/postfix/
vi /etc/pure-ftpd/pure-ftpd.conf
2.) Log into ISPConfig and update your IP list with all of the new IPs and also your server IP using the main IP from eth0:

System->Server IP Addresses - ALL IPs
System->Server Config-> - ONLY set the MAIN IP (whatever you used in eth0)
(NOTE: I'm not sure if you can set the netmask, gateway, or nameservers on teh System->Server Config-> form or not, it didn't seem to be working so I changed it back except for the new IP. This could have just been because I hadn't written step 5 yet...)

3.) Open your sites one by one in ISPConfig and then save them. (Note: I also opened each of my alias domains and saved those, but I don't think that was required)

4.) Update your nameservers. I use external nameservers still, so I changed the zone files there to point to my new IPs for all of my sites.

5.) BE PATIENT! I was questioning whether what I did actually worked, but I was able to login to ISPConfig interface using any of the IP's. Slowly the sites began to work over the next 4 hours. It may have been 2-3 hours for me, I spent the last two watching American Idol and the beginning of Green Lantern so I don't know exactly, but after 4 hours they were definitely all back up. I'm pretty sure it can be up to 48 hours sometimes, so I guess I'm lucky here that it was only 2-4 hours.

I hope you've all enjoyed my tale of how the little IP grew up to become a big block of 3 IP's and that you found at least one thing in here helpful somehow or other.
We are not equal

Last edited by Unfaiir; 14th February 2013 at 10:51. Reason: Answered My Own Questions & Added Part II Steps
Reply With Quote
Sponsored Links