CentOS 6.3 - Change From Single Private IP To Multiple Public IP Block

Discussion in 'Installation/Configuration' started by Unfaiir, Feb 13, 2013.

  1. Unfaiir

    Unfaiir Member

    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: 192.168.2.xxx

    I just bought a new block of 3 public IPs from my ISP: xxx.xxx.xxx.[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 (http://www.howtoforge.com/forums/showthread.php?t=26737) These seem to be the next steps to take:

    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/main.cf 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->server1.mydomain.com? 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/main.cf
    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->server1.mydomain.com - 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->server1.mydomain.com 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. :cool:
    Last edited: Feb 14, 2013
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This file you refer to here is from a different controlpanel (ispconfig 2) and not ispconfig 3. So the guide you followed is not related to the configuration and system of your server.

    I guess you use some wrong info again as a ispconfig 3 server never uses proftpd. So if you found some info that refers to proftpd, then this info can not be for a ispconfig 3 server.

    Thats right. The IP is not set in pure-ftpd

    The change in ispconfig is straight forward, just add one IP after another under System > server IP. Thats all.

    You dont have to set the gateway or nameservers of the additional IP block.
  3. Unfaiir

    Unfaiir Member

    Thanks Till!

    You posted this just as I was adding my update to my original post.

    The information I was referring to was from: http://www.howtoforge.com/forums/showthread.php?t=26737

    I now see this is indeed ISPConfig 2 steps, but the same basic principals applied.

    One question though. You wrote:
    What about the IP in System->Server Config->server1.mydomain.com ?
    Does that need to be updated too? I noticed that before I changed IPs it had my old IP, so I put the new main IP there from eth0 and left the rest alone and it is working for me. Are you saying that even the IP here doesn't need to be changed?

    Also, you do still have to go through the sites in ISPConfig 3 one by one and re-save each one after changing the IPs correct?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats the main IP of the server. If your new subnet is a additional subnet, then you dont have to update it. If the old IP does not exist anymore, then you put the first IP address of your subnet there and the additional IP's under System > Server IP.


Share This Page