Articles in this section

How to change the IP address of a Plesk for Linux server

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

A new network interface with a new IP address has been assigned to a server, or an IP address has been updated on an existing network interface (for example, via ifconfig utility).

How to switch all subscriptions to a different IP address on a Plesk for Linux server?

Answer

For Windows, please refer to the following article

Note: The new IP should not be added under Plesk > Tools & Settings > IP Addresses before applying the instructions below. Remove it if it's already added.

  1. Connect to the server via SSH.

    Note: If direct SSH access to the server is not possible, contact a server administrator for further assistance.

  2. Generate a mapping file with current Plesk IP addresses by running the following command:

    # plesk bin ipmanage --remap /root/ip_map_file_name

  3. Open the file /root/ip_map_file_name for editing, for example, using vi text editor. To switch all subscriptions from the IP address 203.0.113.2 to 203.0.113.3 edit the file as below:

    Before:

    CONFIG_TEXT: venet0 203.0.113.2 255.255.255.255 -> venet0 203.0.113.2 255.255.255.255

    After:

    CONFIG_TEXT: venet0 203.0.113.2 255.255.255.255 -> venet0 203.0.113.3 255.255.255.255

  4. Reconfigure Plesk and its services by running the same command again:

    # plesk bin ipmanage --remap /root/ip_map_file_name

This operation was previously performed with the plesk bin reconfigurator tool, but the following message is now displayed on up-to-date Plesk versions:

# plesk bin reconfigurator /root/ip_map_file_name
`plesk bin ipmanage` should be used instead of this utility

Leaving the old instructions just in case:

  1. Generate a mapping file with current Plesk IP addresses by running the command:

    # plesk bin reconfigurator /root/ip_map_file_name

  2. Open the file /root/ip_map_file_name for editing, for example, using vi text editor. To switch all subscriptions from the IP address 203.0.113.2 to 203.0.113.3 edit the file as below:

    Before:

    CONFIG_TEXT: venet0 203.0.113.2 255.255.255.255 -> venet0 203.0.113.2 255.255.255.255

    After:

    CONFIG_TEXT: venet0 203.0.113.2 255.255.255.255 -> venet0 203.0.113.3 255.255.255.255

  3. Reconfigure Plesk and its services by running the command again:

    # plesk bin reconfigurator /root/ip_map_file_name

Note: Network interfaces are modified in runtime and config (e.g. if the IP address is to be changed to 203.0.113.3/32, while the interface has 203.0.113.2/24, or the main interface itself is to be changed) during the execution of the plesk bin ipmanage --remap utility. If the old IP address(es) are not needed anymore, remove them from Tools & Settings > IP Addresses and after that from the network interface manually. Vote for IP replacement on the interface on UserVoice.

Was this article helpful?

Comments

2 comments
Date Votes
  • Thanks Violeta

    Unfortunately I added the IP and was not able to remove it later. Other articles suggest, you edit the database, im not a fan of that.
    I found out that there is a command line tool to do the same:

    plesk bin subscription -u domain.com -ip 1.2.3.4


    Get all subs using

    plesk bin subscription -l 

    In theory it would be easy to create a shell script to loop through all subscriptions and change it to $ip.

    1
  • Violet Altukhova

    I think the last NOTE comment is wrong, where you used twice the same IP, however it should have been the two different IPs mentioned.

     

    Note: Network interfaces are modified in runtime and config (e.g. if the IP address is to be changed to 203.0.113.2/32, while the interface has 203.0.113.2/24, or the main interface itself is to be changed) during the execution of the plesk bin ipmanage --remap utility. If the old IP address(es) are not needed anymore, remove them from Tools & Settings > IP Addresses and after that from the network interface manually. Vote for IP replacement on the interface on UserVoice.

    0

Please sign in to leave a comment.