Activate an Additional Private IPv4 Address
After assigning additional private IPv4 address to your elastic compute instance, you need to access the instance and configure the private IPv4 to make it effective.
Configure Private IPv4 on Linux Instance
RHEL Series Operating Systems
Applicable operating systems: CentOS, AlmaLinux, Rocky, etc.
Check current network information:
View current network details on the cloud server and use
route -n
to check the default gateway.route -n
Modify network configuration file:
If configuring a single private IPv4 address, edit the following file:
sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
Sample configuration file content:
DEVICE=eth0:0 BOOTPROTO=static HWADDR=00:0C:29:6F:62:A7 ONBOOT=yes IPADDR=172.16.2.6. # Additional private IPv4 NETMASK=255.255.255.0. # Subnet mask GATEWAY=172.16.2.1 # Gateway
Activate network interface or restart network service:
Activate the network interface:
sudo ifup eth0:0
Or restart the network service:
sudo systemctl restart network
Verify configuration:
Check the configuration using
ifconfig
orip addr show
.ifconfig
Debian Series Operating Systems
Applicable operating systems: Ubuntu, Debian.
Check current network information:
View current network details on the cloud server and use
route -n
to check the default gateway.route -n
Modify network configuration file:
Edit the network configuration file:
sudo vi /etc/network/interfaces
Sample configuration file content:
auto eth0:0 iface eth0:0 inet static address 172.16.2.2 # Additional private IPv4 netmask 255.255.255.0 # Subnet mask gateway 172.16.2.1 # Gateway
Restart network service:
Restart the network service:
sudo systemctl restart networking
Verify configuration:
Check the configuration with
ifconfig
orip addr show
.ifconfig
SLES Series Operating Systems
Applicable operating systems: OpenSUSE.
Modify network configuration file:
Edit the network configuration file:
sudo vi /etc/sysconfig/network/ifcfg-eth0
Sample configuration file content:
IPADDR_0=172.16.2.8 # Additional private IPv4 NETMASK_0=255.255.255.0 # Subnet mask
Restart network service:
Restart the network service:
sudo systemctl restart network
Verify configuration:
Check the configuration with
ifconfig
orip addr show
.ifconfig
Configure Private IPv4 on Windows Instance
View network information:
Open Windows PowerShell and run the following command to view IP address, subnet mask and default gateway information:
ipconfig /all
Open Network and Sharing Center:
Go to Control Panel > Network and Internet > Network and Sharing Center, and click on the Ethernet adapter to edit.
Edit Ethernet properties:
In the Ethernet Status dialog, click on Properties.
Configure IPv4 settings:
Select Internet Protocol Version 4 (TCP/IPv4) and click on Properties.
Fill in network information:
Fill in the following fields with the values obtained in step 1:
IP address
Subnet mask
Default gateway
Preferred DNS server
Alternate DNS server (if applicable)
Configure additional private IPv4:
Click on Advanced and add the additional private IPv4.
In the Advanced TCP/IP Settings dialog, click on Add under the IP addresses section.
Fill in the additional private IPv4 and subnet mask, then click Add.
Save and verify configuration:
Click OK to save the settings in all dialogs.
In the Ethernet Status dialog, click Details to view the configured IP information.
Test connectivity:
Test the connectivity of the additional private IPv4 from other instances within the same global VPC using ping.
Last updated