VPS Management

Manually Change IP Address in Ubuntu (Versions 18.04 to 24.04)

16min

Manual IP Change Instructions

Easily update your IP address without server reinstallation. Follow these step-by-step instructions to manually configure the network settings in Ubuntu.

Access Portal and Launch VNC

  1. Log in to KVM Management Portal:
  2. Enable your VNC server:
    • Follow the instructions here.
  3. Open VNC:
    • Enter your username and password on the Ubuntu login page.
    • It will look like the image below:
Document image



Identify Your Network Interface

  1. Open Terminal in the VNC session.
  2. Run the command to find your network interface name:
Bash

Document image


or

Bash

Document image


Take note of the name of the interface you wish to configure, such as ens3 or eth0.



Edit the Netplan Configuration File

Navigate to the Netplan directory:

Bash


Open the configuration file (e.g., 50-cloud-init.yaml):

Bash

Document image


Note: The filename 50-cloud-init.yaml may differ across servers; for example, it could be 01-network-manager-all.yaml. Ensure you edit the correct file accordingly.



Change the IP Address

  1. Locate the line with the old IP address and change it to your new IP address (e.g., 172.16.30.15).
  2. Update the Gateway address in the routes section to the new gateway IP.


Configure Multiple IPs (Optional)

To add multiple IP addresses, format them like this:



Bash

Document image


Ensure proper indentation in the YAML file.



SAVE CONFIGURATION

  1. Press CTRL + X to save the file.
  2. Press Y to confirm changes and then hit Enter to exit.


Apply Changes

  1. Run the following command to apply the new configuration:
Bash



Verify Changes

Check if the new IP is set by running:

Bash


Alternatively, check the specific interface:



Bash


(Replace ens3 with your network interface name).