Manually Change IP Address in Ubuntu (Versions 18.04 to 24.04)
Update your IP address without server reinstallation. Follow these step-by-step instructions to manually configure the network settings in Ubuntu.
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
Log in to your
Enable your VNC server
Follow the instructions here
Open VNC
- Enter your username and password on the Ubuntu login page.
- It will look like the image below:
Identify Your Network Interface
- 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.
Edit the Netplan Configuration File
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.
Change the IP Address
- 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.
Configure Multiple IPs (Optional)
To add multiple IP addresses, format them like this:
Ensure proper indentation in the YAML file.
SAVE CONFIGURATION
- Press
CTRL + X
to save the file. - Press
Y
to confirm changes and then hitEnter
to exit.
Apply Changes
- Run the following command to apply the new configuration:
Verify Changes
Check if the new IP is set by running:
Alternatively, check the specific interface:
(Replace ens3
with your network interface name).
Was this page helpful?