This guide is applicable only for KVM based VPSes, for OpenVZ based VPSes please click here
In this article, we will learn how to configure networking in newer versions of Ubuntu, such as Ubuntu 18.04, 19.04 and 19.10 using Netplan.
To know the gateway and netmask of your IP address, please see this guide http://wiki.crowncloud.net/?viewing_network_gateway_netmask
First, We find the Network Interface Name,
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 220.127.116.11 netmask 255.255.255.0 broadcast 18.104.22.168 inet6 fe80::5652:ff:fee4:7796 prefixlen 64 scopeid 0x20<link> ether 54:52:00:e4:77:96 txqueuelen 1000 (Ethernet)
In this example, the system is configured with the network interface name as ens3, this might not be the case with your system, please verify the system network interface name with the ifconfig -a command above before proceeding with the guide below!
Second, to add additional ip address.
File Content should be,
network: version: 2 renderer: networkd ethernets: [below your system interface name needs to use] ens3: addresses: - ip address here
network: version: 2 renderer: networkd ethernets: ens3: addresses: - 22.214.171.124/24 - 126.96.36.199/24 - 188.8.131.52/24
To configuration the network.
Warning: Stopping systemd-networkd.service, but it can still be activated by: systemd-networkd.socket Do you want to keep these settings? Press ENTER before the timeout to accept the new configuration Changes will revert in 113 seconds Configuration accepted.
After this step, try pinging the IP with the command.
ping ip address
Note If ip address is not pinging adding additional ip is unsuccessfull. If ip is ping, adding additional ip is successfuly Completed.