How to Enable and Disable the Network Interface on Ubuntu

How to Enable and Disable the Network Interface on Ubuntu

Enable and Disable the Network Interface on Ubuntu 

When you work as a Linux administrator, all system’s network configuration management is also included in your job. In Linux servers, the interface goes down due to performing any changes on the Network interface card. The network interfaces are either physically or virtually present, you can easily enable the network interface by using several methods that we will discuss in this article.

We will talk about how to enable and disable the network interfaces using various methods in Ubuntu distribution. We have executed all commands on the latest available Ubuntu distribution Ubuntu 20.04 LTS. Let’s start with the details!

Methods to Enable and Disable the Network Interface in Ubuntu 20.04

There are the following different methods are available that can be used to enable and disable your network interface in Ubuntu

  1. ifconfig command
  2. nmcli command
  3. systemctl command
  4. nmtui command
  5. Ip command
  6. ifdown/ifup

First, you must know about network interface information on your system. The “ip command” can be used for this task. This command shows the network interface card information that is used on your Linux system. To get the information about the network interface card on your Ubuntu system, open the terminal by pressing ‘Ctrl+Alt+t’ and then type the following command on it:

According to the above-displayed output, one network interface ‘enp0s3’ is enabled (up) and working on this system.

Enabling/Disabling the Network Interfaces through the ifconfig Command

To run the ifconfig command-line utility, you need to install some required “net-tools” on your Ubuntu system. Therefore, install the following required tools by executing the command given below:

$ sudo apt install net-tools

Now, you can execute the ifconfig command on your Ubuntu system. To disable or down the running network interface, mention the network interface, as shown in the following example

$ ifconfig enp0s3 down

Now, check the status of the network interface by typing the below-given command:

$ ip a


$ ip a | grep -A 1 "enp0s3:"

To enable or activate the specified network interface through the ifconfig utility, use the following command:

$ ifconfig enp0s3 up

Verify the bring up the status of “enp0s3” by executing the following command:

$ ip a

Post a Comment

Previous Post Next Post