To change the public IP Address of your Linux machine you need to have an additional IP Address.
If you don’t have any additional IP Address you need to buy it from us. To do that is too easy, open a ticket in the support area and ask for an IP or Multiple IP, a member of our billing department will add the IP to your service, and will generate an invoice.
After that you’ll be able to follow these instructions.
Before changing your IP address, make sure to have a look at your current IP address.
To find your current IP address, you can easily use the “IP” command with the “a” option for the address like that:
Or you can see it with the “ifconfig” command of the “net-tools” package:
How to change ip address on Ubuntu
To change the default static IP address on Ubuntu Server, you need to edit the “netplan” default configuration file.
You have to modify the default config file of “netplan” that is located in
/etc/netplan/ with your preferred editor vim/nano and much more, open that file, and you will see something like this.
You can assign multiple IP addresses or modify the existing one already set. To do that, you need to change the IP under
addresses: and put the IP address that you want to use.
After that save the configuration file and run this command:
sudo netplan applyIf you are connected through SSH, you will be disconnected after run the command above and you can easily reconnect to the server with your new IP.
How to change ip address on Debian
To change the IP on a Debian System, you need to edit the network-manager interface configuration file.
You have to modify the config file, that is located in
/etc/network/interfaces with your preferred editor vim/nano and much more.
Open that file, and you will see something like this.
iface ens1 inet static
dns-nameservers 188.8.131.52 184.108.40.206
Change the IP address on
address , save the file and exit from the text editor.
After that you need only to run this command:
sudo systemctl restart networking
How to change ip address on CentOS / RHEL
To change the IP on a CentOS/RHEL System, you need to edit the sysconfig network interface config.
First of all identify the name of the network interface that are you actually using. To do that follow steps that are written under “Prerequisites”.
You have to modify the config file of your network interface, that is located in
/etc/sysconfig/network-scripts/ into this directory you will find many files with different names, locate the file named like this:
Open that file, and you will see something like that:
# the GATEWAY is sometimes in: /etc/sysconfig/network
To change the IP address change the IP after
IPADDR= after that save and exit from the editor.
To apply the changes you can disable and re-enable the interface with these commands:
ifdown intname;ifup intname or you can easily run this command that restarts the network:
sudo systemctl restart network