How to add a VPC private IP to a VPS
Step 1: Access the Manage Panel
Go to the Manage Panel of your VPS and select the Network tab.
Step 2: Add VPS to VPC
Scroll down to the VPC section within the page.
Add your VPS to the VPC. This action will create a VPC IP, such as 192.168.0.80 in this example.
Note: In most operating systems, the interface will automatically add itself. However, in Ubuntu, the interface is attached to the server, but the configuration must be completed manually.
Step 3: Identify the New Interface
Use the following command to list network interfaces and find the new one (often named ens7, but this may vary):
ip a s
Step 4: Note the MAC Address
Identify and note the MAC address of the new interface.
Step 5: Edit Netplan Configuration
Open /etc/netplan/50-cloud-init.yaml with your preferred text editor.
Step 6: Add Interface Configuration
Add the following configuration for your server.
You ONLY need to add things under the new interface you are adding (ens7) in our case.
In this example, the MAC for the new interface is fa:16:3e:7a:84:21 (replace with your actual MAC address):
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
macaddress: fa:16:3e:46:3f:b1
set-name: ens3
ens7:
dhcp4: true
match:
macaddress: fa:16:3e:7a:84:21
set-name: ens7
Step 7: Apply Netplan Configuration
Run the following command to apply the new network settings:
sudo netplan apply
Step 8: Verify IP Assignment
Finally, use ip a s to confirm that the new VPC IP is assigned to the interface.
Updated on: 09/11/2024
Thank you!