Intermediate 10 min

Configure IP on Linux

Add a secondary IPv4 to Debian/Ubuntu with netplan or interfaces.

#Linux#Network#IPv4

Ready to start your service? Check offers and order online.

View offers and order

Information required

From the client space, note for each additional IP:

  • TheIPv4 address assigned
  • The mask (often /32 or bridge provided)
  • The gateway if indicated in the panel

Debian / Ubuntu (netplan)

Example in /etc/netplan/50-cloud-init.yaml :

network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 203.0.113.10/24
        - 203.0.113.50/32
      gateway4: 203.0.113.1

Then: sudo netplan apply

Interface method (legacy)

Add in /etc/network/interfaces.d/ a secondary IP file, or an alias eth0:1 According to your image.

Full Guide See also mount an additional IP (VPS) for detailed examples.

Verification

ip addr show and ping -I 203.0.113.50 8.8.8.8 to confirm that the IP is responding well.