Removing public IPv4 addresses from a VPS or migrated Cloud Server (Ubuntu 22.04, 24.04, Debian 12, and Debian 13)
Please use the “Print” function at the bottom of the page to create a PDF.
Valid for VPS and migrated Cloud Servers running Ubuntu 22.04, 24.04, Debian 12, or Debian 13 that are managed in the Cloud Panel.
This article explains how to remove additional public IPv4 and IPv6 addresses from a VPS or migrated Cloud Server running Ubuntu 22.04, 24.04, Debian 12, or Debian 13.
Requirement
You have cancelled the assignment of the additional public IPv4 or IPv6 address in the Cloud Panel.
Log in to the server.
Change to the directory in which the configuration file is located. To do this, enter the following command:
[root@localhost ~]# cd /etc/netplan
Check the name of the configuration data and make a note of it. To do this, enter the following command:
[root@localhost ~]# ls /etc/netplan
Open the configuration file. To do this, enter the following command:
[root@localhost ~]# sudo vi etc/netplan/CONFIGURATION_FILE.yaml
Example:
[root@localhost ~]# vi etc/netplan/50-cloud-init.yaml
Note
The vi editor has an insert mode and a command mode. You can enter insert mode by pressing the [i] key. In this mode, the characters you type are immediately inserted into the text. To enter command mode, press [ESC]. When you use command mode, your keyboard entries are interpreted as commands. vi cannot be exited in insert mode. Therefore, always enter command mode to exit vi.
Press [i] and delete the entry for the IPv4 address to be removed in the configuration file under the addresses key.
To enter command mode, press [ESC]. Then enter the command :wq to save the text and close the editor.
Restart the server so that the changes are applied. To do this, enter the following command:
[root@localhost ~]# systemctl reboot