> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edbb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure an additional IPv4 address on Linux

> Add an assigned IPv4 address to your Linux VPS without reinstalling. Test the address, then save it with Netplan, NetworkManager or Debian interfaces.

After you order an [additional IPv4 address](/faq/ip-addresses/order-additional-ip-address), add it to your VPS's network configuration. You do not need to reinstall the server.

## Before you start

Open the [VNC console](/vps-management/enable-vnc-server) and copy the additional address and prefix from the VPS **Network** tab. Keep the existing primary address, gateway and DNS settings.

The commands below use `eth0` and `192.0.2.20/24` as examples. Replace them with your interface and assigned address/prefix. Do not assume that every service uses `/24`.

## Test the additional address

Find the active interface and existing route:

```bash theme={"system"}
ip -br addr
ip route
```

If the additional IP is not already listed, add it:

```bash theme={"system"}
sudo ip addr add 192.0.2.20/24 dev eth0
ip -4 addr show dev eth0
```

Test the address from another computer using a service that is listening on it. Check the firewall and application binding if the primary IP works but the additional one does not. You do not normally add another default gateway for a secondary address.

<Note>
  This change lasts only until the interface is reconfigured or the server restarts. Save it using the network manager already controlling the interface.
</Note>

## Save the configuration

<Tabs>
  <Tab title="Netplan (Ubuntu)">
    Review the YAML files in `/etc/netplan/` and back up the existing directory before editing. Find the entry for the active interface.

    Add the extra address to its existing `addresses` list. This excerpt shows a primary and additional address; it is **not** a replacement for your complete file:

    ```yaml theme={"system"}
    addresses:
      - 192.0.2.10/24
      - 192.0.2.20/24
    ```

    Keep the existing primary address or DHCP setting, routes, DNS and renderer. Use spaces for YAML indentation. Check syntax, then try the settings with a rollback timeout:

    ```bash theme={"system"}
    sudo netplan generate
    sudo netplan try --timeout 120
    ```

    While the prompt is open, test a second connection and confirm only if access works. If the change is rejected or times out, verify the old configuration was restored before continuing. See the [Netplan examples](https://netplan.readthedocs.io/en/latest/examples/).
  </Tab>

  <Tab title="NetworkManager (Rocky/AlmaLinux)">
    Find the active connection name:

    ```bash theme={"system"}
    nmcli connection show --active
    ```

    Replace `CONNECTION` with that name. The `+` appends an address without replacing the existing list:

    ```bash theme={"system"}
    sudo nmcli connection modify 'CONNECTION' +ipv4.addresses '192.0.2.20/24'
    sudo nmcli device reapply eth0
    ```

    If NetworkManager says the change needs a connection restart, use the console and plan a brief interruption before running `sudo nmcli connection up 'CONNECTION'`. Do not change the primary address, gateway or IPv4 method just to add an address.
  </Tab>

  <Tab title="ifupdown (Debian)">
    Use this only if the interface is managed by `/etc/network/interfaces` or an included file in `/etc/network/interfaces.d/`.

    Back up the file. In the existing IPv4 stanza for your interface, add:

    ```text theme={"system"}
    post-up ip addr replace 192.0.2.20/24 dev eth0
    ```

    Keep the existing `address`, `gateway` and DNS configuration. The temporary command above makes the address usable now; test persistence during a planned reboot with the console open. Avoid restarting all networking over your only SSH connection.
  </Tab>
</Tabs>

Do not configure the same interface through two different network managers. If a file says it is generated by Cloud-Init or another tool, update the tool's configuration so it does not overwrite your changes later.

## Verify after a restart

During a maintenance window, restart the VPS and check `ip -4 addr show dev eth0`. Confirm that both the primary and additional IP still work. If not, restore the saved configuration through the console and review the network manager's error messages.
