Extra IP addresses are common on dedicated servers: one IP per website for SEO site networks, separate IPs for mail and web, or a DDoS-protected IP in front of a public service. This guide shows how to add them on the three network systems you will meet on modern Linux, and how to check that they work.
Safety first: a typo in the network configuration can take the server offline. Keep the VNC console in the server control panel open in another tab while you work — it does not depend on the network.
Gather the details
From your welcome email or a support ticket you need:
- The additional IPs (for example
203.0.113.10–203.0.113.20, or a whole block like198.51.100.0/24). - The netmask / prefix for those IPs — often
/32for single IPs routed to your server, or/24for a block. - Whether they are routed to your main IP or need their own gateway. Most additional IPs are routed and need no extra gateway.
If you are unsure, open a ticket and ask for the exact settings before you change anything.
Find your network interface name:
ip -br addr
You will see something like eth0, ens18 or enp3s0 next to your main IP. The examples below use eth0.
Test first: add an IP temporarily
This change disappears on reboot, which makes it safe for testing:
sudo ip addr add 203.0.113.10/32 dev eth0
ip -br addr show eth0
From another machine, ping 203.0.113.10. If it answers, make the change permanent with one of the methods below. Remove the temporary IP with sudo ip addr del 203.0.113.10/32 dev eth0.
Ubuntu 18.04+ (Netplan)
Netplan files live in /etc/netplan/. Open the existing one:
ls /etc/netplan/
sudo nano /etc/netplan/50-cloud-init.yaml
Add the extra IPs to the addresses list of your interface:
network:
version: 2
ethernets:
eth0:
addresses:
- 203.0.113.5/24 # main IP (already there)
- 203.0.113.10/32
- 203.0.113.11/32
routes:
- to: default
via: 203.0.113.1
nameservers:
addresses: [1.1.1.1, 8.8.8.8]
Indentation must be spaces, never tabs. Apply with a safety net:
sudo netplan try
netplan try applies the change and rolls back automatically after 120 seconds unless you press Enter — so if you lose connectivity, just wait. When it works, press Enter to keep it.
Debian (ifupdown)
Edit /etc/network/interfaces:
sudo nano /etc/network/interfaces
Add one up line per IP under the existing interface:
auto eth0
iface eth0 inet static
address 203.0.113.5/24
gateway 203.0.113.1
up ip addr add 203.0.113.10/32 dev eth0
up ip addr add 203.0.113.11/32 dev eth0
down ip addr del 203.0.113.10/32 dev eth0
down ip addr del 203.0.113.11/32 dev eth0
Apply by restarting networking from the VNC console (not over SSH), or simply reboot:
sudo systemctl restart networking
AlmaLinux, Rocky Linux, CentOS (NetworkManager)
Find the connection name, then add the addresses:
nmcli con show
sudo nmcli con mod "System eth0" +ipv4.addresses "203.0.113.10/32,203.0.113.11/32"
sudo nmcli con up "System eth0"
Adding a whole /24 block
On an SEO server with 253 usable IPs, writing them one by one is impractical. Two approaches:
Generate the list. For Netplan, print the YAML lines with a loop and paste them into the addresses list:
for i in $(seq 2 254); do echo " - 198.51.100.$i/32"; done
Add the block as a single prefix. If the provider routes the entire /24 to your server, adding 198.51.100.0/24 as a local route makes every address in the block answer:
sudo ip route add local 198.51.100.0/24 dev lo
Make it persistent with a routes: entry of type: local in Netplan, or an up line in /etc/network/interfaces. Ask support which approach matches how your block is delivered.
Verify
ip -br addr # all IPs listed?
ping -c 3 -I 203.0.113.10 1.1.1.1 # outbound traffic from that IP works?
curl --interface 203.0.113.10 https://ifconfig.me # should print 203.0.113.10
Then reboot once and confirm everything is still there.
Bind a website to one IP
In Nginx, put the IP in the listen directive:
server {
listen 203.0.113.10:80;
listen 203.0.113.10:443 ssl;
server_name site-a.example;
# ...
}
Each site then resolves to and answers from its own IP — the usual setup for multi-site SEO hosting. See Nginx with Let’s Encrypt for the rest of the server block.
Outgoing traffic
By default, outgoing connections use the main IP. To send from a specific IP, set it in the application (for example Postfix smtp_bind_address, or proxy_bind in Nginx). Changing the default source for everything is rarely needed.