Articles in this section

Plesk IP address is not removed: Cannot remove the IP address because it is the primary IP address of a network interface

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

Plesk IP address cannot be removed:

PLESK_ERROR: Error: Cannot remove the IP address 203.0.113.2 because it is the primary IP address of a network interface.


PLESK_ERROR: ifmng failed: cannot delete main IP on interface

Cause

Primary IP address of network interface cannot be removed by design.

Resolution

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.

  1. Connect to a Plesk server via SSH.

  2. Create a backup of Plesk database:

    # plesk db dump psa > /root/psa_backup.sql

  3. Connect to the Plesk database:

    # plesk db

  4. Modify the IP_Addresses table:

    Note: In the following example:

    203.0.113.2 - the current main (primary) IP address
    203.0.113.3 - the new main (primary) IP address that is going to replace 203.0.113.2

    • Change the value of the main field to true for the new 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 old IP address:

      MYSQL_LIN: mysql> UPDATE IP_Addresses SET main='false' WHERE ip_address='203.0.113.2';

Was this article helpful?

Comments

3 comments
Date Votes
  • not help

    0
  • Did not work.

    0
  • Just a note; for those who install on Ubuntu with cloud init, you'll end up with your primary ip address in a 50-cloud-init.yaml file in netplan, and Plesk writes their netplan file as 10-plesk.yaml.  The result is that if you add additional ip addresses, with Plesk's file loading first, you'll end up with a secondary IP treated as the primary IP.  You have to disable config rewriting in Cloud and rename the 50 file to a number below 10 so it loads first.

    1

Please sign in to leave a comment.