Articles on: Tutorials

Configure Netplan & Network Interfaces on Linux Operating Systems

If your IP has changed, or if you wish to change your IP, you must edit the network configuration in your operating system. To do so, open your Terminal and run the following command.



sudo nano /etc/network/interfaces



This file may look like the following.




Edit the configuration as follows. Please note that individual configurations may look different from this.

auto ens18
iface ens18 inet static
  address xxx.xxx.x.x
  netmask xxx.xxx.xxx.x
  gateway xxx.xxx.x.x
  dns-nameservers 8.8.8.8 1.1.1.1


Make sure not to change the loopback adapter config. Use the arrow keys to navigate through the configuration file and remove your old IP address, subnet, etc. Type in your new address information on each line. After the change, it will look something like the following screenshot.




Save the file and exit from the editor.

Updated on: 22/03/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!