[EN] How to config Additional IP address for Dedicated Server

Before configuring an Additional IP Address on the Dedicated Server, you must first receive the Additional IP Address range in routed mode.

For example, you may be assigned an Additional IP Address range such as 103.x.x.1 – 103.x.x.5 configured in routed mode.

Temporarily configure the Additional IP Address.

You can temporarily configure the Additional IP Address for testing purposes. The configuration will be lost after the server is rebooted.

				
					# Temporarily add all the IP addresses you want to use to the network interface.
ip addr add 103.x.x.1/32 dev eno1 
ip addr add 103.x.x.2/32 dev eno1 
ip addr add 103.x.x.3/32 dev eno1 
ip addr add 103.x.x.4/32 dev eno1
ip addr add 103.x.x.5/32 dev eno1
				
			

Permanently configure the Additional IP Address on OS that use NetworkManager.

For systems using NetworkManager, the configuration files are located at the following path: /etc/NetworkManager/system-connections/

				
					ls /etc/NetworkManager/system-connections/
				
			

Verify that the configuration file is named: eno1.nmconnection

				
					cat /etc/NetworkManager/system-connections/eno1.nmconnection
				
			

Then, edit the configuration as shown in the example below:

				
					[ipv4]
method=manual

# Main IP Address and Gateway
address1=103.27.203.x/24,103.27.203.1

# Additional IP Address
address2=103.x.x.1/32
address3=103.x.x.2/32
address4=103.x.x.3/32
address5=103.x.x.4/32
address6=103.x.x.5/32

dns=8.8.8.8;1.1.1.1;
				
			

After saving the configuration changes, run the following command to reload the configuration:

				
					nmcli connection reload
nmcli connection up eno1
				
			

Permanently configure the Additional IP Address on OS that use Netplan.

For systems using Netplan, the configuration files are located in the following directory: /etc/netplan/

Verify the configuration file name by running the following command:

				
					ls /etc/netplan/
				
			

Then, edit the configuration as shown in the example below:

				
					network:
   version: 2
   ethernets:
     eno1:
       addresses:
        # Main IP Address
         - 103.27.203.x/24
        # Additional IP Address
         - 103.x.x.1/32
         - 103.x.x.2/32
         - 103.x.x.3/32
         - 103.x.x.4/32
         - 103.x.x.5/32
       routes:
         - to: default
           via: 103.27.203.1 # Gateway
       nameservers:
         addresses: [8.8.8.8, 1.1.1.1]
				
			

After saving the configuration changes, run the following command to apply the configuration:

				
					netplan apply
				
			

Permanently configure the Additional IP Address on OS that use /etc/network/interfaces

The network configuration file is located at: /etc/network/interfaces

Verify the configuration file name by running the following command:

				
					cat /etc/network/interfaces
				
			

Then, edit the configuration as shown in the example below:

				
					auto eno1
iface eno1 inet static
     address 103.27.203.x/24
     gateway 103.27.203.1
     dns-nameservers 8.8.8.8 1.1.1.1  
auto eno1:1 
iface eno1:1 inet static
     address 103.x.x.1/32  
auto eno1:2 
iface eno1:2 inet static
     address 103.x.x.2/32  
auto eno1:3 
iface eno1:3 inet static
     address 103.x.x.3/32  
auto eno1:4 
iface eno1:4 inet static
     address 103.x.x.4/32
auto eno1:5 
iface eno1:5 inet static
     address 103.x.x.5/32
				
			

After saving the configuration changes, run the following command to apply the configuration:

				
					systemctl restart networking
				
			

Was this article helpful?