> For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt.

# 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 \{#bestall}

- **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](/en/vps/index.md#publika-ipv4-i-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 \{#lagg-in-adressen}

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`:

```yaml
network:
  version: 2
  ethernets:
    eth0:
      addresses: [193.180.173.50/24]
```

```bash
sudo chmod 600 /etc/netplan/60-extra-ip.yaml
sudo netplan apply
```

**Debian** (ifupdown). Create `/etc/network/interfaces.d/60-extra-ip`:

```
iface eth0 inet static
    address 193.180.173.50/24
```

The file takes effect at the next restart. Add the address right away as well:

```bash
sudo ip addr add 193.180.173.50/24 dev eth0
```

**Rocky Linux, AlmaLinux and Fedora** (NetworkManager). Copy cloud-init's profile to
your own with a higher priority and add the address to it:

```bash
sudo nmcli con clone "cloud-init eth0" publik
sudo nmcli con mod publik connection.autoconnect-priority 200 \
  +ipv4.addresses 193.180.173.50/24
sudo nmcli con up publik
```

**FreeBSD**:

```sh
sudo sysrc ifconfig_eth0_alias0="inet 193.180.173.50/32"
sudo ifconfig eth0 inet 193.180.173.50/32 alias
```

On FreeBSD, extra addresses use the netmask `/32`. If you have more addresses, continue
with `ifconfig_eth0_alias1`, `ifconfig_eth0_alias2` and so on.

:::tip Why not edit cloud-init's files?
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 \{#kontrollera}

On the server:

```bash
ip -br addr show eth0
```

On FreeBSD: `ifconfig eth0 inet`. The extra address should be listed. Then ping it from
another computer:

```bash
ping 193.180.173.50
```

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](/en/vps/reverse-dns.md) if the server will send
email from it.
