Your dedicated server has one main IPv4 address and a range of IPv6 addresses. Additional IPv4 addresses can be ordered in the Client Area. The installer configures only the main IPv4 address; every other address has to be added in the network settings of the server. The steps were tested on Ubuntu 26.04 LTS with an address from the IPv6 range of our test server.


1. Find the Addresses

Open your server in the Client Area and go to IP Addresses (1). Each line shows an address or range, its Gateway and the netmask to use. The IPv6 line (2) shows a range such as 2001:db8:4900:a019:2::/112 with the interface netmask /64. More IPv4 addresses are ordered with Order more IPv4 addresses (3).

IP Addresses tab: the main IPv4 address, the IPv6 range and the order button

From the IPv6 range you can choose any address, for example 2001:db8:4900:a019:2::2.

2. Add the Address to Netplan

Ubuntu keeps its network settings in /etc/netplan/. Make a copy of the file first:

ls /etc/netplan/
cp /etc/netplan/01-netcfg.yaml /root/01-netcfg.yaml.backup

Open it with nano /etc/netplan/01-netcfg.yaml. Under your main network card (here eno0) add the new address to the line addresses, and for IPv6 also its gateway under routes:

    ethernets:
        eno0:
            dhcp4: no
            dhcp6: no
            addresses: ['203.0.113.80/26', '2001:db8:4900:a019:2::2/64']
            routes:
                - to: default
                  via: 203.0.113.126
                  metric: 100
                  on-link: true
                - to: default
                  via: 2001:db8:4900:a019::1

Keep the spaces exactly as they are: the file is YAML, and indentation matters. An additional IPv4 address goes into the same list with the netmask shown in the Client Area, for example '203.0.113.90/26'; if its gateway is the same as for your main address, no new route is needed.

An Address From Another Subnet

An additional IPv4 address does not always come from the subnet of your main address. Look at its line in IP Addresses: if its Gateway differs from the gateway of your main address, the address belongs to another subnet. Then:

  • add the address with the netmask of its own subnet, as shown in the Client Area (for example /29), not with the netmask of your main address;
  • send the traffic of that address through the gateway of its subnet, in a routing table of its own;
  • do not add its gateway as a second normal default route: the server then sends everything through one of the two gateways, and the answers of the other address leave through the wrong gateway, so connections to it break.

Example: the additional address 198.51.100.10/29 with the gateway 198.51.100.9:

    ethernets:
        eno0:
            dhcp4: no
            dhcp6: no
            addresses: ['203.0.113.80/26', '198.51.100.10/29']
            routes:
                - to: default
                  via: 203.0.113.126
                  metric: 100
                  on-link: true
                - to: default
                  via: 198.51.100.9
                  table: 100
            routing-policy:
                - from: 198.51.100.10
                  table: 100

routing-policy says: everything sent from 198.51.100.10 uses table 100, whose default route is the gateway of that subnet. All other traffic keeps using your main gateway. For a second address from the same additional subnet, add it to addresses and add one more - from: line with the same table. After netplan try (next step), check the rule and the route:

ip rule
ip route get 1.1.1.1 from 198.51.100.10

The first command lists the new rule, the second shows that the address uses the gateway of its own subnet:

32765:  from 198.51.100.10 lookup 100
1.1.1.1 from 198.51.100.10 via 198.51.100.9 dev eno0 table 100

The same check for your main address (ip route get 1.1.1.1 from followed by the main address) still shows your main gateway. We checked this configuration on our test server with Ubuntu 26.04 and netplan 1.2.

3. Test and Apply

netplan try

netplan try applies the settings for 120 seconds and asks Do you want to keep these settings?. Check in a second SSH window that the server still answers, then press Enter in the first one. If you lose the connection or do not press Enter, the old settings come back by themselves after 120 seconds.

Check the new address:

ip -br addr show eno0
ping -6 -c 3 2001:4860:4860::8888
curl -6 https://ifconfig.co

The first line lists the new address. ping -6 must get answers, and curl -6 prints the IPv6 address your server uses for outgoing connections. For an IPv4 address, test it from another computer, for example with ping 203.0.113.90.

⚠ If the server is unreachable

Wait two minutes for netplan try to undo the change. If you used netplan apply instead and the server no longer answers, use the console (IPMI) or rescue mode (How to Use Rescue Mode) and copy /root/01-netcfg.yaml.backup back.

On Debian: /etc/network/interfaces

Debian does not use netplan. On a server installed with Debian 13, the main network card (here eno0) and its IPv4 address are set up in /etc/network/interfaces, and IPv6 is not configured. Make a copy of the file first:

cp /etc/network/interfaces /root/interfaces.backup

Open it with nano /etc/network/interfaces and add at the end, with your own addresses:

iface eno0 inet6 static
      address 2001:db8:4900:a019:2::2/64
      gateway 2001:db8:4900:a019::1

iface eno0 inet static
      address 203.0.113.90/26

The first block adds an address from your IPv6 range with its gateway, the second an additional IPv4 address from the subnet of your main address; add one such block per address. ifquery eno0 lists everything Debian reads for the card, so you can check for typing errors. Debian applies the file at the next restart. To use the addresses at once, also add them by hand:

ip -6 addr add 2001:db8:4900:a019:2::2/64 dev eno0
ip -6 route add default via 2001:db8:4900:a019::1 dev eno0
ip addr add 203.0.113.90/26 dev eno0

If the second line answers RTNETLINK answers: File exists, the server already has an IPv6 route; that is fine. ping -6 and curl -6 from step 3 then work at once, and after a restart the server comes up with all addresses from the file. If it does not answer after a restart, use the console or rescue mode (see the warning above) and copy /root/interfaces.backup back.

Use the Address

Programs answer on all addresses of the server by default. To bind a website or a program to the new address only, write the address in its settings, for example listen [2001:db8:4900:a019:2::2]:443; in Nginx (see Website With HTTPS on a Linux Server: Nginx and Let's Encrypt). Allow the ports in your firewall as usual (Protect Your Linux Server With a Firewall and Fail2ban).

On Windows Server, see Add an Additional IP Address on Windows Server.


Related Guides

View all Ubuntu and Debian guides

Was this answer helpful? 0 Users Found This Useful (0 Votes)