If the /etc/network/interfaces file is missing while configuring linux network, it might be because your Linux distribution uses a different method for network configuration. Here are alternative methods based on various distributions and network managers:

For Systems Using NetworkManager (e.g., Ubuntu 18.04 and newer)

NetworkManager typically uses configuration files in /etc/NetworkManager/ or /etc/netplan/.

Using Netplan (for Ubuntu 18.04 and newer):

  1. Netplan configuration files are located in /etc/netplan/. List the files in this directory:
   ls /etc/netplan/

You will likely see a file with a .yaml extension, such as 01-netcfg.yaml or 50-cloud-init.yaml.

  1. Edit the YAML configuration file:
   sudo nano /etc/netplan/01-netcfg.yaml
  1. Update the file with the new IP address configuration. For example:
     version: 2
         dhcp4: no
  1. Apply the changes:
   sudo netplan apply

For Red Hat-based Systems Using nmcli (NetworkManager Command Line Interface)

  1. List the active connections:
   nmcli connection show
  1. Identify the connection you want to modify (e.g., eth0).
  2. Modify the connection to use a static IP address:
   nmcli connection modify eth0 ipv4.addresses
   nmcli connection modify eth0 ipv4.gateway
   nmcli connection modify eth0 ipv4.dns ""
   nmcli connection modify eth0 ipv4.method manual
  1. Bring the connection down and up to apply the changes:
   nmcli connection down eth0
   nmcli connection up eth0

For Red Hat-based Systems Using ifcfg Files

  1. Open the specific interface configuration file in a text editor (replace eth0 with your interface name):
   sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
  1. Update the configuration with the new IP address:
  1. Save the file and exit the text editor.
  2. Restart the networking service to apply the changes:
   sudo systemctl restart network


The specific method to configure a static IP address permanently depends on your Linux distribution and its version. Use the appropriate method above for your system, whether it’s using Netplan, NetworkManager’s nmcli, or the traditional ifcfg files in Red Hat-based systems.

NetworkManager Configurations For Linux

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *