VPS Management
Manually Change IP Address in Ubuntu (Versions 18.04 to 24.04)
16min
Easily update your IP address without server reinstallation. Follow these step-by-step instructions to manually configure the network settings in Ubuntu.
- Log in to KVM Management Portal:
- Enable your VNC server:
- Open VNC:
- Enter your username and password on the Ubuntu login page.
- It will look like the image below:
- Open Terminal in the VNC session.
- Run the command to find your network interface name:
or
Take note of the name of the interface you wish to configure, such as ens3 or eth0.
Navigate to the Netplan directory:
Open the configuration file (e.g., 50-cloud-init.yaml):
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.
- Locate the line with the old IP address and change it to your new IP address (e.g., 172.16.30.15).
- Update the Gateway address in the routes section to the new gateway IP.
To add multiple IP addresses, format them like this:
Ensure proper indentation in the YAML file.
- Press CTRL + X to save the file.
- Press Y to confirm changes and then hit Enter to exit.
- Run the following command to apply the new configuration:
Check if the new IP is set by running:
Alternatively, check the specific interface:
(Replace ens3 with your network interface name).
Updated 06 Nov 2024
Did this page help you?