Extra IPv4 addresses
A server can have more than one public IPv4 address. The extra addresses go on the same
network card as the server's first address, eth0, and the server keeps its gateway.
Order
- VPS Bygg själv: choose the number of extra IPv4 addresses in the cart, 1 to 4. Our support connects the addresses within one business day and emails them to you.
- VPS Cloud: the addresses are part of your pool. You choose how many a server should have when you create it, see Public IPv4 addresses in VPS Cloud. The extra addresses are listed in the Network Interfaces table on the server.
- VPS Small and Medium have one address. If you need more, choose VPS Bygg själv.
Add the address on the server
Use the netmask /24, the same as for the server's first address. Do not add a gateway,
the server should keep using the one it already has.
The examples use the address 193.180.173.50. Replace it with your own.
Ubuntu (netplan). Create /etc/netplan/60-extra-ip.yaml:
Debian (ifupdown). Create /etc/network/interfaces.d/60-extra-ip:
The file takes effect at the next restart. Add the address right away as well:
Rocky Linux, AlmaLinux and Fedora (NetworkManager). Copy cloud-init's profile to your own with a higher priority and add the address to it:
FreeBSD:
On FreeBSD, extra addresses use the netmask /32. If you have more addresses, continue
with ifconfig_eth0_alias1, ifconfig_eth0_alias2 and so on.
cloud-init creates the server's network settings and may rewrite its own files, for example after you change the SSH key in the portal. The settings above live in files and profiles of their own and stay in place.
Check
On the server:
On FreeBSD: ifconfig eth0 inet. The extra address should be listed. Then ping it from
another computer:
It is a good idea to restart the server once and check that the address is still there.
Give the address a name under Reverse DNS if the server will send email from it.