
Assigning multiple public IP addresses to a Vultr Cloud Compute instance allows you to host multiple services, bind applications to separate IPs, or configure advanced networking setups such as NAT or IP-based virtual hosts. You add IPv4 addresses in the Vultr Console and then configure them in the instance's operating system.
This guide explains how to assign and configure multiple public IPv4 addresses on a Vultr Cloud Compute instance. It covers adding IPv4 addresses in the Vultr Console, configuring them on Ubuntu, CentOS, FreeBSD, and Windows, and verifying that each address is active.
Before you begin, you need to:
Follow these steps to assign and configure multiple public IPv4 addresses on your Ubuntu instance.
Log in to the Vultr Console.
Click Compute in the left navigation menu, then click Instances.
Click your Ubuntu instance to open its details page.
Click the Settings tab, then click IPv4. The Public Network table lists the main IP address, netmask, and gateway assigned to the server.
Under Additional IPv4 IP, click Add Another IPv4 Address.
Check Yes, add and restart this server, then click Add IPv4 Address to assign a new IPv4 address to your server.
Click the networking configuration link under Public Network to view the configuration examples for your OS. Ubuntu requires you to configure the new IP address manually. The following is an example Netplan configuration for Ubuntu.
Replace the following values with those provided in your Vultr Console:
192.0.0.4/23: Your main IP address and prefix length.192.0.2.5: Your newly assigned IPv4 address.192.0.0.6: Your DNS server.192.0.0.1: Your gateway IP.In the above configuration:
network: The top-level key that begins the Netplan configuration.version: Specifies the Netplan format version. Version 2 is the standard used in most modern Ubuntu systems.renderer: Indicates which backend to use for applying the configuration.ethernets: Defines Ethernet interface configurations. All Ethernet-based interfaces are declared under this section.enp1s0: The name of the network interface to configure.dhcp4: no: Disables DHCP for IPv4, so the interface uses a static IP configuration.addresses: A list of static IP addresses assigned to the interface.nameservers: Specifies DNS resolver addresses.routes: Adds static routes to control traffic flow.to: default / via: 192.0.0.1: Sets the default gateway to 192.0.0.1, used for routing external traffic.to: 169.254.0.0/16 / via: 192.0.0.1 / metric: 100: Routes link-local addresses via the same gateway with a metric of 100.After you have copied the configuration, SSH into your Ubuntu server.
Create a new Netplan configuration file using a text editor such as nano.
Paste the copied configuration into the file, then save and exit.
Set restrictive file permissions to prevent unauthorized changes.
Test the configuration before applying it permanently.
This command applies the new network configuration temporarily and gives you 120 seconds to confirm that everything is working as expected. If the system loses connectivity or something goes wrong, Netplan automatically rolls back to the previous configuration after the timeout, preventing accidental lockouts on remote systems.
If everything works as expected, apply the configuration permanently.
Restart the server from the Vultr Console by clicking the Server Restart icon to make the changes take effect.
After the server restarts, SSH into the server and list the IPv4 addresses on the network interface.
Verify that the output lists both the main IP address and the newly assigned IPv4 address.
You have assigned additional public IPv4 addresses to a Vultr Cloud Compute instance in the Vultr Console and configured them in the operating system using Netplan on Ubuntu, cloud-init on CentOS, rc.conf on FreeBSD, and the network adapter settings on Windows. Each instance now responds on its main IP address and every additional IPv4 address you assigned.
0 Comments
Be the first to comment and share your perspective with the community.