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
14 comments
can you add a link to the windows version of this doc?
Hello Christopher Danks
For Windows, there's a separate article.
Here's the corresponding documentation.
Thanks for the document, it works fine over Debian. But I have one question, when we execute the IP change:
And check /etc/network/interfaces
I can see:
iface ens32:1 inet static
address x.x.x.x
netmask x.x.x.x
auto ens32:1
It is not necessary to add the gateway, network and broadcast?
Thanks in advance
Hello Salvador Salas Prieto
I've compared it with a similar network subinterface on a test server. Looks like it's expected.
Also, let me note that Plesk reconfiguration doesn't change these settings by design. Feel free to make adjustments if necessary.
Thanks a lot. Can anyone explain who can we delete the old ip once the ip is changed? I have debian server and after a reboot the old IP comes again. And this is a very big problem as the domains start to send mail from that IP, SPF records are wrong and mail is returned.
So it will be a big help for me if somebody can tell me how to delete the old IP permanently from the server to use only the new one.
I delete the old IP:
ip addr del x.x.x.x/24 dev ens192
But after reboot the IP comes again:
Where x.x.x.x is the old IP and y.y.y.y is the new one
Thank you in advance
Hello Salvador Salas Prieto
Most probably you have a virtual server and this address is managed from the outside, Consider contacting server provider.
Hi Ivan,
That is not the problem. If you **only** follow the KB article to change the IP for Plesk on a Debian box (and in other linux distros too I think), next time you reboot the server the old IP will come to the server.
Also with the KB you don´t change the network, the broadcast and the gateway (if they are different), which will be critical in the server.
So the Kb works to change the IP of plesk but if you don´t set the server correctly, you will have a big problem once the server is rebooted if the old IP still works.
Best regards
Hello,
I have 2 IPs in the plesk and would like to change the current main IP to swap to the other IP as the main IP.
Both the IPs are already in the system.
How do i delete the current second IP, then go change the current main ip to a new ip?
Thanks,
Gary
Hello Salvador Salas Prieto
Yes, you're right, indeed some attention to the server's network configuration is still required.
The aim of this utility is to set up Plesk to work with the new server configuration.
Hello Gary Gopinathan,
You can follow this guide https://support.plesk.com/hc/en-us/articles/115002822565. Here is the documentation as well
https://docs.plesk.com/en-US/onyx/advanced-administration-guide-linux/system-maintenance/changing-ip-addresses.68622/
Hello,
I see this error:
[root@mail ~]# plesk bin ipmanage --remap /root/ip_map_file_name
Unknown command: --remap
exit status 1
[root@mail ~]#
Hello again,
In one article this command is recommended:
plesk bin ipmanage --remap /root/ip_map_file_name
In another article, this one:
./reconfigurator <ip_map_file_name>
And except network interfeaces, will postfix, qmail, bind, opendns ip configurations be changed manually after plesk ip replace command?
Which one should I use for colocation change (change all ip range of server)?
Despite i upgraded ip i still have old one in message at top of login form :
Ok, in fact i just had to update Hostname in Server settings !
Hmmm .. but it don't change this message ! :p
Please sign in to leave a comment.