Cart

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

    Adding an extra or static IPv4 or IPv6 address in CentOS Stream 10, AlmaLinux 10 or RockyLinux 10

    When you order an additional IPv4 address or add an extra IPv6 address to your IP addresses via the control panel, these are not automatically added to your VPS via DHCP. You therefore need to add extra IP addresses to the network interfaces manually.

    In this article we explain how to add or statically configure an IPv4 and IPv6 address on your CentOS Stream 10, AlmaLinux 10 or Rocky Linux 10 VPS. For this you will first need an additional IPv4 and/or IPv6 address. Don’t have one yet? Then first check one of the following articles:

    See this article for an overview of all our guides on how to add extra or static IPv4 and IPv6 addresses to different Linux distros, or this one for Windows.

    • This tutorial covers public IP addresses. In this guide you’ll find more information on configuring internal addresses for your private network.
       
    • A VPS comes with one IPv4 address by default, but you can expand this up to a maximum of 20 IPv4 addresses.
       
    • Each VPS also has a /64 IPv6 range available by default, from which you can add IP addresses as needed. A /64 IPv6 range contains a total of 18,446,744,073,709,551,616 IP addresses, so the chances of running out are pretty slim! The gateway is outside this range, so you should always set the netmask to 48.
     

     

    Adding an IPv4 address in CentOS Stream 10, AlmaLinux 10 or RockyLinux 10

     

    Step 1

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


     

    Step 2

    Once logged in, you can view the current network interfaces and the IPs configured on them with:

    ip a

    For the steps that follow it’s especially important that you know the correct adapter name. In this example that’s eth0. On installations that use a control panel such as Plesk this is usually ens3

    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

    Note: If you used the Fast Installs feature for your VPS and chose installation via SSH keys, one-time password or cloud-config user data, disable the underlying CloudInit:

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

     

    Step 4

    There's a couple of options to proceed from here: 

    • A manual configuration via command-line if no fast installs installation process has been used for your VPS.
    • A manual configuration via command-line if fast installs installation process has been used for your VPS.
    • The configuration via a graphical interface (GUI).

    Did you clone a VPS or restore a snapshot? If so, we recommend using the GUI option. 

    Manual configuration - no Fast Installs

    Step 1

    Open the network configuration. It can usually be found in /etc/NetworkManager/system-connections/ (adjust eth0 to the name of the adapter found in the earlier step 2).

    sudo nano /etc/NetworkManager/system-connections/eth0.nmconnection

     

    Step 2

    Adjust the configuration so that it looks like below, keeping the following in mind:

    • Do not change the options under [connection] 
    • Adjusting the IP addresses to those of your VPS (as can be seen in the control panel under 'Manage' > 'Netwerk information'). 

    Save the changes and close nano (ctrl + > > enter).

    Optional: The options dns, ignore-auto-dns together allow you to configure your own DNS server configuration, regardless of what DNS servers have been configured earlier through DHCP. You are free to leave out these options and instead use the already present configuration in /etc/resolv.conf.

     
    [connection]
    id=eth0
    uuid=123fasb4-123c-4fd9-ab12-d23s1235154
    type=ethernet
    autoconnect-priority=-100
    autoconnect-retries=1
    interface-name=eth0
    timestamp=1763650419
    
    [ethernet]
    
    [ipv4]
    address1=123.123.123.123/32
    address2=123.123.123.234/32
    dhcp-timeout=90
    dhcp-vendor-class-identifier=anaconda-Linux
    dns=195.8.195.8;195.135.195.135;
    ignore-auto-dns=true
    gateway=123.123.123.1
    method=manual
    required-timeout=20000
    
    [ipv6]
    addr-gen-mode=eui64
    dhcp-timeout=90
    method=auto
    
    [proxy]
    
    [user]
    org.freedesktop.NetworkManager.origin=nm-initrd-generator

     

    Step 3

    Restart NetworkManager to apply the new IP configuration:

    sudo systemctl restart NetworkManager
     
     

    Manual configuration - with Fast Installs

    Step 1

    Open the network configuration. This is usually located in /etc/sysconfig/network-scripts/ (replace eth0 with the adapter name you found in step 2).

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

     

    Step 2

    Adjust the configuration so that it looks like the example below, replacing the IP addresses with those of your own VPS.

    AUTOCONNECT_PRIORITY=120
    BOOTPROTO=none
    DEVICE=eth0
    ONBOOT=yes
    TYPE=ethernet
    IPV4_FAILURE_FATAL=no
    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.210.222.1
    • IPADDR(x) is the IP address you want to configure and GATEWAY(x) is the gateway; you can find these for your IP address in the control panel.
    • For each IP address you add, increase the number: IPADDR, IPADDR1, IPADDR2, IPADDR3, etc. The same applies to gateways where relevant. Leave the (sub)NETMASK at 255.255.255.0.
    • It’s not mandatory to add the gateway when the extra IP address is in the same /24 range. If that’s not the case, you must add it, otherwise you’ll run into issues reaching other IPs within the TransIP network.

    Save your changes and exit nano (ctrl + > > enter).


     

    Step 3

    Restart NetworkManager to apply the new IP configuration:

    sudo systemctl restart NetworkManager
     
     

    Configuration via a GUI

    Step 1

    An option to manage your IP configuration is to use a graphical command-line tool called ‘nmtui’. Start it with:

    sudo nmtui

     

    Step 2

    You’ll see the menu below. The ‘Edit a connection’ option is selected by default. Press ‘Enter’ to continue.


     

    Step 3

    Next, select the adapter name from step 2 (you’ll usually only see a single adapter here) and press ‘Enter’.


     

    Step 4

    For ‘IPv4 CONFIGURATION’, select ‘Automatic’. Press ‘Enter’, then select ‘Manual’ and press ‘Enter’ again.

    Now use the right arrow keys to select ‘Show’ and press ‘Enter’. Adjust the configuration as in the example below, with the following changes:

    • Replace 136.144.131.92/24 with the primary IPv4 address of your VPS. Don’t forget to include the /24 subnet.
    • Want to add more IP addresses? Select ‘Add’ and add the additional IPs.
    • Set the gateway to the IPv4 gateway of your primary IPv4 address. You can find this in the control panel for your VPS under ‘Beheren’ > ‘Netwerkinformatie’.
    • For the DNS servers, configure the available IPv4 addresses of the DNS servers, which you can also find in your control panel under ‘Netwerkinformatie’.
    • Don’t forget to tick ‘Ignore automatically obtained routes’ and ‘Ignore automatically obtained DNS parameters’.

    Finally, select ‘OK’ at the bottom and press ‘Enter’ to apply the changes.


     

    Step 5

    You’ll be taken back to the screen from step 5. Press ‘Esc’ to go back one screen, select ‘Quit’ and press ‘Enter’ to close nmtui.


     

    Step 6

    Finally, apply the changes with:

    sudo nmcli connection reload
    or...
    sudo nmcli networking off && sudo nmcli networking on
     
     

     

    Adding an IPv6 address in CentOS Stream 10, AlmaLinux 10 or Rocky Linux 10

     

    Step 1

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


     

    Step 2

    Once logged in, you can view the current network interfaces and the IPs configured on them by running:

    ip a

    For the next steps it’s especially important that you know the correct adapter name. In this example that’s eth0.

    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

    Note: If you used the Fast Installs feature for your VPS and chose installation via SSH keys, one-time password or cloud-config user data, disable the underlying CloudInit and (optionally) remove the existing configuration:

    sudo touch /etc/cloud/cloud-init.disabled
    sudo rm /etc/sysconfig/network-scripts/ifcfg-eth0

     

    Step 4

    There's a couple of options to proceed from here: 

    • A manual configuration via command-line if no fast installs installation process has been used for your VPS.
    • A manual configuration via command-line if fast installs installation process has been used for your VPS.
    • The configuration via a graphical interface (GUI).

    Did you clone a VPS or restore a snapshot? If so, we recommend using the GUI option. 

    Manual configuration - no Fast Installs

    Step 1

    Open the network configuration. It can usually be found in /etc/NetworkManager/system-connections/ (adjust eth0 to the name of the adapter found in the earlier step 2).

    sudo nano /etc/NetworkManager/system-connections/eth0.nmconnection

     

    Step 2

    Adjust the configuration so that it looks like below, keeping the following in mind:

    • Do not change the options under [connection] 
    • Adjusting the IP addresses to those of your VPS (as can be seen in the control panel under 'Manage' > 'Netwerk information'). 

    Save the changes and close nano (ctrl + > > enter).

    Optional: The options dns, ignore-auto-dns together allow you to configure your own DNS server configuration, regardless of what DNS servers have been configured earlier through DHCP. You are free to leave out these options and instead use the already present configuration in /etc/resolv.conf.

     
    [connection]
    id=eth0
    uuid=123fasb4-123c-4fd9-ab12-d23s1235154
    type=ethernet
    autoconnect-priority=-100
    autoconnect-retries=1
    interface-name=eth0
    timestamp=1763650419
    
    [ethernet]
    
    [ipv4]
    dhcp-timeout=90
    dhcp-vendor-class-identifier=anaconda-Linux
    method=auto
    required-timeout=20000
    
    [ipv6]
    addr-gen-mode=eui64
    address1=2a01:7c8:d008:123:4567:ff:fe07:e5f0/48
    address2=2a01:7c8:d008:123:4567:ff:fe07:1337/48
    dhcp-timeout=90
    dns=2a01:7c8:7000:195:0:8:195:8;2a01:7c8:7000:195:0:135:195:135;
    ignore-auto-dns=true
    gateway=2a01:7c8:d008::1
    method=auto
    
    [proxy]
    
    [user]
    org.freedesktop.NetworkManager.origin=nm-initrd-generator

     

    Step 3

    Restart NetworkManager to apply the new IP configuration:

    sudo systemctl restart NetworkManager
     
     

    Manual configuration - with Fast Installs

    Step 1

    Open the network configuration. This is usually located in /etc/sysconfig/network-scripts/ (replace eth0 with the adapter name you found in step 2).

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

     

    Step 2

    In the opened configuration file, add the lines below if they’re not present yet. Use the primary IPv6 address and its corresponding gateway as shown in your control panel under ‘beheren’ > ‘netwerkinformatie’.

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

    Save your changes and exit nano (ctrl + > > enter). If you want to add more IPv6 addresses, add the following line (place all extra addresses between the quotation marks):

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

     

    Step 3

    Restart NetworkManager to apply the new IP configuration:

    sudo systemctl restart NetworkManager
     
     

    Configuration via a GUI

    Step 1

    An option to manage your IP configuration is to use a graphical command-line tool called ‘nmtui’. Start it with:

    sudo nmtui

    You’ll see the menu below. The ‘Edit a connection’ option is selected by default. Press ‘Enter’ to continue.


     

    Step 2

    Next, select the adapter name from step 2 (you’ll usually only see a single adapter here) and press ‘Enter’.


     

    Step 3

    For ‘IPv6 CONFIGURATION’, select ‘Automatic’. Press ‘Enter’, then select ‘Manual’ and press ‘Enter’ again.

    Now use the right arrow keys to select ‘Show’ and press ‘Enter’. Adjust the configuration as in the example below, with the following changes:

    • Replace 2a01:7c8:fff9:34c::/48 with the primary IPv6 address of your VPS. Don’t forget to include the /48 subnet.
    • Want to add more IP addresses? Select ‘Add’ and add the additional IPs.
    • Set the gateway to the IPv6 gateway of your primary IPv6 address. You can find this in the control panel for your VPS under ‘Beheren’ > ‘Netwerkinformatie’.
    • For the DNS servers, configure the available IPv6 addresses of the DNS servers, which you can also find in your control panel under ‘Netwerkinformatie’.
    • Don’t forget to tick ‘Ignore automatically obtained routes’ and ‘Ignore automatically obtained DNS parameters’.

    Finally, select ‘OK’ at the bottom and press ‘Enter’ to apply the changes.


     

    Step 4

    You’ll be taken back to the screen from step 5. Press ‘Esc’ to go back one screen, select ‘Quit’ and press ‘Enter’ to close nmtui.


     

    Step 5

    Finally, apply the changes with:

    sudo nmcli networking reload
    or...
    sudo nmcli networking off && sudo nmcli networking on
     
     

     

    That brings us to the end of this guide on adding (static) IPv4 and IPv6 addresses to AlmaLinux 10, Rocky Linux 10 and CentOS Stream 10.

    Need help?

    Receive personal support from our supporters

    Contact us