Changing IP-address of a virtual private server

From ISPWiki

Jump to: navigation, search

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 /vs/disk/%OLD_IP% folder.

3) Locate symlinks in /vs/disk, if any, that refer to the old folder, edit them for them to refer to the folder with a new name.

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

5) Enter the /vs/disk/%NEW_IP% folder to run the command: find ./ -type f | xargs perl -p -i -e 's/%OLD_IP%/%NEW_IP%/g' t change all references to the old IP-address in the configuration files of the private server.

6) Restart VDSManager by the command: killall vdsmgr.

7) Start the VPS.

Was this helpful? Yes | No
Personal tools