For Dedicated Servers 

This article explains how to add an additional public IPv4 address on a Dedicated Server where CentOS 7 is installed.

To configure an additional public IPv4 address in CentOS 7, please proceed as follows:

  • In the Cloud Panel, you have assigned an additional public IPv4 address to your server.

  • You have logged on to the server as an administrator.

  • Check the entries in the ifcfg-eth0 file. To do this, enter the following command:

    [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

  • To add an additional IP address, you need an Ethernet alias. To do this, a consecutive number is simply appended to the interface name, starting with 1 for the first alias. Thus, the first alias of eth0 is eth0:1. To create the /etc/sysconfig/network-scripts/ifcfg-eth0:1 file with the vi Editor, please enter the following command:

    [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

  • The vi Editor has a command mode and an insert mode. To switch to input mode, press [i] on your keyboard. You can now insert the required content or make the required changes. Press the [ESC] key on your keyboard to exit the input mode.

  • To exit vi and save the file, type the command :wq, then press Enter.

  • To customise the network configuration of your server and use an additional public IPv4 address, enter the following information:

    IPADDR=Additional IPv4 address



  • Save the file.

  • Restart your server then enter the following command:

    [root@localhost ~]# reboot

    The SSH connection will be interrupted after the command is entered.

  • Log on to the server again.

  • To check if the additional public IPv4 address has been added, type the following command:

    [root@localhost ~]# ip addr

    The additional public IPv4 address will now be displayed. Example:

    [root@4eb7808 ~]# ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 3c:ec:ef:22:65:fa brd ff:ff:ff:ff:ff:ff
        inet brd scope global dynamic eth0
           valid_lft 43036sec preferred_lft 43036sec
        inet brd scope global eth0:1
           valid_lft forever preferred_lft forever
        inet6 2001:8d8:1801:8298::1/128 scope global dynamic
           valid_lft 3439sec preferred_lft 3439sec
        inet6 fe80::3eec:efff:fe22:65fa/64 scope link
           valid_lft forever preferred_lft forever
    3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
        link/ether 3c:ec:ef:22:65:fb brd ff:ff:ff:ff:ff:ff