- Plesk for Linux
When removing an IP address from Plesk on Linux, the following error message appears:
PLESK_ERROR: Error: Cannot remove the IP address 203.0.113.2 because it is the primary IP address of a network interface.
How to change the main (primary) IP address in Plesk for Linux?
Note: This solution is applicable only if there are at least 2 IP addresses on a server. To add a new IP address, see this KB article.
Connect to a Plesk server via SSH.
Create a backup file of a Plesk database:
# plesk db dump psa > /root/psa_backup.sql
Connect to the Plesk database:
# plesk db
Modify the IP_Addresses table as follows:
Change the value of the "main" field to true for the new main IP address:
MYSQL_LIN: mysql> UPDATE IP_Addresses SET main='true' WHERE ip_address='203.0.113.3';
Change the value of the "main" field to false for the IP address which will not be used as a default:
MYSQL_LIN: mysql> UPDATE IP_Addresses SET main='false' WHERE ip_address='203.0.113.2';
Make sure that only the main IP address has the value "true":
MYSQL_LIN: mysql> SELECT ip_address, main FROM IP_Addresses WHERE main='true';
| ip_address | main |
| 203.0.113.3 | true |
| 203.0.113.2 | false |
Remove the old IP address via Plesk if necessary.