Changing IP-address of a virtual private server

From ISPWiki

Jump to: navigation, search

Contents

XEN

1) Stop the VPS.

2) Change the IP-address in the configuration files.

а) /usr/local/ispmgr/etc/vdsmgr.conf

The following section:

VDS "%OLD_IP%" {

...

...

}

is changed into: VDS "%NEW_IP%" {

б)In /xen/conf/VPS_NAME locate a record that starts with vif and change the IP-address into a new one.

3) Restart vdsmanager by the command: killall vdsmgr.

4) Start the VPS from VDSmanager.

5) Change the IP-address in the VPS configuration files by the command, such as: find ./ -type f | xargs perl -p -i -e 's/%OLD_IP%/%NEW_IP%/g'


OpenVZ

1) Stop the virtual server.

а) Locate the ID: vzlist - a | grep %OLD_IP%

б) Stop: vzctl stop %ID%

2. Change the IP-address in the configuration files.

а) /usr/local/ispmgr/etc/vdsmgr.conf

The following section:

VDS "%OLD_IP%" {

...

...

}

is changed into: VDS "%NEW_IP%" {

б) /etc/vz/conf/%ID%.conf

The following line: IP_ADDRESS="%OLD_IP%"

is changed into: IP_ADDRESS="%NEW_IP%"

3) In: cd /vz/private/%ID%/

change the IP-address in the configuration files by the command, such as: find ./ -type f | xargs perl -p -i -e 's/%OLD_IP%/%NEW_IP%/g'

4) Restart the panel: killall -9 vdsmgr

5) Run the virtual server: vzctl start %ID%

FreeBSD 6

1) Stop the VPS.

2) Rename the directory /vs/disk/%OLD_IP% .

3) If symlinks referring to the old directory is present in /vs/disk, rename them to refer to the folder with a new name.

4) Change the IP-address of the virtual server in the corresponding section of /usr/local/ispmgr/etc/vdsmgr.conf.

5) Enter the directory /vs/disk/%NEW_IP% to execute the command: find ./ -type f | xargs perl -p -i -e 's/%OLD_IP%/%NEW_IP%/g' to change all references to the old IP-address in the configuration filer.

6) Restart VDSmanager: killall vdsmgr.

7) Start the VPS.

FreeBSD 8, FreeBSD 9

1) Stop the VPS.

2) Rename the directory /vs/disk/%OLD_IP%.

3) If symlink referring to the old directory is present in /vs/disk,rename them to refer to the new one.

4) Change the IP address of the VPS in the corresponding section of /usr/local/ispmgr/etc/vdsmgr.conf.

5) Enter the directory /vs/disk/%NEW_IP% and execute: grep -Rl %OLD_IP% ./ | xargs perl -p -i -e 's/%OLD_IP%/%NEW_IP%/g' to modify all references to the old IP address in the configuration file.

6) Restart VDSmanager: killall vdsmgr.

7) Start the VPS.

Was this helpful? Yes | No
Personal tools