configuring Additional IP in server

How to add additional static IP’s

Ubuntu 17 / 18 / 20

From Ubuntu 17.10 and on the /etc/network/interfaces file is no longer used. It uses Netplan. This configuration file is found at /etc/netplan. Now we will edit the configuration file, we recommend to use ‘nano’ to edit the file:

nano /etc/netplan/01-netcfg.yaml

Adding a static IP in the netplan file is easier than you might think. Just add a comma after the current address and add the new one. We have highlighted this.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   ens3:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.1.50/24,192.168.1.51/24]
     gateway4: 192.168.0.1
     nameservers:
       addresses: [93.190.136.10,217.23.0.121]

To apply the new configuration, apply with the following in the command line:

netplan apply

If you want to add more IP addresses, simply add this after the one that was just added and separate by using a comma. Do not add any spaces in between.

Note: if you receive an error, please check the configuration as netplan is very space and character-sensitive. If you don’t use the exact amount of spaces in the above example it will fail.

  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

Dedicated Servers

Dedicated server is a type of remote server that is entirely dedicated to an individual,...

Update rDNS

You can update the Reverse DNS for server IP by using your client area, We have developed a User...

RAID levels

RAID (Redudnat Array of Independent Disks) is a way of storing the same data in different places...

How to assign multiple IP addresses to one network interface on CentOS

The practice of configuring multiple IP addresses on a particular network interface is called IP...

Features of Dedicated servers

ScopeHosts dedicated servers provides you ulitmate power, security and control, you will get full...