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.
-
Connect to the server via SSH.
Note: If direct SSH access to the server is not possible, contact a server administrator for further assistance.
-
Generate a mapping file with current Plesk IP addresses by running the following command:
# plesk bin ipmanage --remap /root/ip_map_file_name
-
Open the file
/root/ip_map_file_name
for editing, for example, using vi text editor. To switch all subscriptions from the IP address203.0.113.2
to203.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
-
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:
-
Generate a mapping file with current Plesk IP addresses by running the command:
# plesk bin reconfigurator /root/ip_map_file_name
-
Open the file
/root/ip_map_file_name
for editing, for example, using vi text editor. To switch all subscriptions from the IP address203.0.113.2
to203.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
-
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.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.
Comments
1 comment
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:
Get all subs using
In theory it would be easy to create a shell script to loop through all subscriptions and change it to $ip.
Please sign in to leave a comment.