How to Change the IP Address on a VPS?
Changing the IP address on a VPS server might be necessary for various reasons: to enhance security, change location, or other purposes. In this article, we’ll show you how to easily and quickly change the IP address on your VPS.
Step 1: Connecting to the Server
The first step is to connect to your VPS via SSH. To do this, use the following command:
ssh username@ip_address
Replace username with your username and ip_address with the current IP address of the server.
Step 2: Changing the IP Address
To change the IP address, follow these steps:
- Open the file
/etc/netplan/01-netcfg.yamlfor editing. - Find the line with the current IP address and replace it with the new one.
- Save the changes and close the file.
After making the changes, restart the network interface with the following command:
sudo netplan apply
Step 3: Verifying the Changes
To ensure that the IP address has been successfully changed, run the following command:
ip a
In the command output, you will see the new IP address of your VPS. Now you can close the connection to the server.
You now have a new IP address on your VPS. Configure the necessary services and continue using the server in the new mode.