For Cloud Server

In this article, we'll show you how to remove an additional public IPv4 or IPv6 address in a server with CentOS Stream 9 installed.

Prerequisite

You have already unassigned the additional public IPv4 or IPv6 address in the Cloud Panel.

  • Log in to the server.

  • Open the file /etc/NetworkManager/system-connections/ens192.nmconnection with the vi editor. Enter the following command:

    [root@localhost ~]# vi /etc/NetworkManager/system-connections/ens192.nmconnection

  • To remove the additional, public IPv4 address from the network interface, delete the following entry from the [ipv4] section.

    address2=<ADDITIONAL IPv4 ADDRESS>/32,10.255.255.1

    To remove the additional, public IPv6 address from the network interface, delete the following entry from the [ipv6] section.

    address2=<ADDITIONAL IPv6 ADDRESS>/64,fe80::1

  • Perform a reboot of the server. To do this, enter the following command:

    [root@localhost ~]# systemctl reboot

  • Log in to the server again.

  • To verify that the IPv4/IPv6 address has been removed, enter the following command:

    [root@localhost ~]# ip addr