Cart

    Sorry, we could not find any results for your search querry.

    Adding an ipv4 or ipv6 address to AlmaLinux 8

    When you order an extra IPv4 address or add an extra IPv6 address to your IP addresses via the TransIP control panel, these cannot be automatically added to your VPS via DHCP. Additional IP addresses are added manually to the network interfaces.

    In this article, we explain how you can statically add an extra IPv4 or IPv6 address to your AlmaLinux 8 VPS. For this, an extra IPv4 and/or IPv6 address is required (depending on which you'd like to add / configure). Don't have an extra address yet? The following articles explain how you can get one:

    Click here for a complete overview of all our tutorials for adding an extra or static IPv4 or IPv6 address to various Linux distros. For adding an IPv4 or IPv6 address to a Windows VPS, see this article.

    • This manual is about public IP addresses. In this manual, you will find more information about setting up internal addresses (for your private network).
       
    • Please note: in the steps in this article the adapter is called eth0. In your installation this may be ensX (replace X by a number). Make sure to check this using the ip a command and if necessary change eth0 to ensX where applicable.

    A VPS includes 1 IPv4 address by default, but you can expand this to a maximum of 10 IPv4 addresses via the control panel. A maximum limit of 20 IPv4 addresses applies to the VPSs of the PRO series.

    Each VPS has a /64 IPv6 range at its disposal by default, where IP addresses can be added as desired. A /64 IPv6 range contains a total of 18,446,744,073,709,551,616 IP addresses, so the likeliness that you will not have enough is quite small! The default gateway falls outside of the /64 range so as netmask you always use a /48 range.


    Adding an IPv4 address in AlmaLinux 8

     

    Step 1 

    Connect to the VPS via the VPS console or via SSH.


     

    Step 2 

    Once logged in you see the current network interfaces and the configured IPs by using the command:

    ip a
    

    For the next steps, it is especially important that you are aware of the correct adapter name. Which is eth0 in this example.   

    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 127.0.0.1/8 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 pfifo_fast state UP group default qlen 1000
        link/ether 52:54:00:f6:ae:54 brd ff:ff:ff:ff:ff:ff
        inet 149.210.111.222/24 brd 149.210.111.255 scope global noprefixroute eth0
           valid_lft forever preferred_lft forever
        inet6 2a01:7c8:aabb:111::1/48 scope global noprefixroute
           valid_lft forever preferred_lft forever
        inet6 fe80::5054:ff:fef6:ae54/64 scope link noprefixroute
           valid_lft forever preferred_lft forever

     


     

    Step 3

    Do you use the fast installs feature for your VPS and have you chosen an installation using SSH-keys, one time password, or config user data? Then, disable the underlying CloudInit and optionally remove the existing configuration:

    sudo touch /etc/cloud/cloud-init.disabled
    sudo rm 

    Now add the extra IPv4 address in the network interfaces. First, open the network configuration file:

    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

    Add/adjust the following to the existing configuration file:

    BOOTPROTO=none
    IPV4_FAILURE_FATAL=no
    PROXY_METHOD=none
    DEFROUTE=yes
    IPADDR=149.210.111.222
    IPADDR1=149.210.222.111
    NETMASK=255.255.255.0
    NETMASK1=255.255.255.0
    PREFIX=24
    PREFIX1=24
    GATEWAY=149.210.111.1
    GATEWAY1=149.138.222.1
    
    • IPADDR(x) is the IP address that you want to set and GATEWAY(x) the gateway, which for your IP address can be found in the control panel
    • For every IP address that you add, you use an ascending number, i.e. IPADDR, IPADDR1, IPADDR2, etc. The same applies to gateways if applicable. You need to leave the (sub)NETMASK at 255.255.255.0. 
    • You are not required to add a gateway if the IP is part of the same /24 range. If it isn't, you are required to set the gaeway.

    Save the changes and exit nano (ctrl + x > y > enter).  


     

    Step 4 

    Reset your network interfaces with the following command to use the new IP address:

    ifdown eth0 && ifup eth0

     

    Step 5 

    If you run ip a again you will see the newly added IPv4 address. You can test this IP address by performing a ping test from another computer / IP.

    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 127.0.0.1/8 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 pfifo_fast state UP group default qlen 1000
        link/ether 52:54:00:f6:ae:54 brd ff:ff:ff:ff:ff:ff
        inet 149.210.111.222/24 brd 149.210.111.255 scope global noprefixroute eth0
           valid_lft forever preferred_lft forever
        inet 149.210.222.111/24 brd 149.210.222.255 scope global noprefixroute eth0
            valid_lft forever preferred_lft forever
        inet6 2a01:7c8:aabb:111::1/48 scope global noprefixroute
           valid_lft forever preferred_lft forever
        inet6 fe80::5054:ff:fef6:ae54/64 scope link noprefixroute
           valid_lft forever preferred_lft forever

    Repeat the above steps if you want to add more IP addresses.


    Adding an IPv6 address in AlmaLinux 8

     

    Step 1 

    Connect to the VPS via the VPS console or via SSH.


     

    Step 2 

    Once logged in you see the current network interfaces and the configured IPs by using the command:

    ip a

    For the next steps, it is especially important that you are aware of the correct adapter name. Which is ens3 in this example.  

    ipa centos8


     

    Step 3

    Do you use the fast installs feature for your VPS and have you chosen an installation using SSH-keys, one time password, or config user data? Then, disable the underlying CloudInit and optionally remove the existing configuration:

    sudo touch /etc/cloud/cloud-init.disabled
    sudo rm 

    Now add the extra IPv6 address in the network interfaces. First, open the network configuration file:

    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

    In the opened configuration file, add the following lines if they are missing (replacing the IPv6 address by your server's primary IPv6 address): 

    IPV6INIT=yes
    IPV6_AUTOCONF=no
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6ADDR=2a01:7c8:aabb:111::1
    IPV6_DEFAULTGW=2a01:7c8:aabb:1
    

    Save the changes and exit nano (ctrl + x > y > enter). If you want to add more IPv6 addresses, add the following line (placing all additional addresses between the brackets):

    IPV6ADDR_SECONDARIES="2a01:7c8:aabb:111::2 2a01:7c8:aabb:111::3"

     

    Step 4 

    Process the changes using the following command:

    ifdown eth0 && ifup eth0

     

    Step 5

    If you run ip a again you will see the newly added IPv6 address. You can test this IP address by performing a ping test from another computer / IP.

    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 127.0.0.1/8 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 pfifo_fast state UP group default qlen 1000
        link/ether 52:54:00:f6:ae:54 brd ff:ff:ff:ff:ff:ff
        inet 149.210.111.222/24 brd 149.210.111.255 scope global noprefixroute eth0
           valid_lft forever preferred_lft forever
        inet6 2a01:7c8:aabb:111::1/48 scope global noprefixroute
           valid_lft forever preferred_lft forever
        inet6 2a01:7c8:aabb:111::2/48 scope global noprefixroute
            valid_lft forever preferred_lft forever
        inet6 fe80::5054:ff:fef6:ae54/64 scope link noprefixroute
           valid_lft forever preferred_lft forever

    Repeat the above steps if you want to add more IP addresses. 


     

    Should you have any questions left regarding this article, do not hesitate to contact our support department. You can reach them via the ‘Contact Us’ button at the bottom of this page.

    Need help?

    Receive personal support from our supporters

    Contact us