PopOS

How To Enable and Disable Network Interfaces on Pop!_OS

As a Linux administrator, you have to manage network settings. For a smoother experience, you have to make the network interface enabled. These network interfaces exist virtually or practically, which you can enable and disable at your convenience.

There are some conditions, like making changes in NIC, where you need to disable the network interface. This tutorial will briefly explain the methods you can use to enable and disable network interfaces on Pop!_OS.

How To Enable and Disable Network Interfaces on Pop!_OS

You can enable and disable network interfaces on Pop!_OS in many ways. Here, we discuss five approaches to enable/disable network interfaces in the system.

Using the Systemctl Command

First, check the status of network interfaces using the following ‘Systemctl’ command:

sudo systemctl status NetworkManager.service

From the previous command’s output, you can see the system’s network interface is active or enabled.

Now, disable a network interface through the Systemctl command. First, you need to stop using the following command so it cannot access the system resources:

sudo systemctl stop NetworkManager.service

After, run the same command to disable the network interfaces with the ‘disable’ keyword.

sudo systemctl disable NetworkManager.service

When you check the status of the network interface again using the Systemctl status command, you will be able to see that it has been disabled.

sudo systemctl stop NetworkManager.service

Similarly, you can enable network interfaces on Pop!_OS with the help of the Systemctl command. The only difference is that you have to use the ‘restart’ keyword and then the ‘enable’ keyword with the Systemctl command.

sudo systemctl restart NetworkManager.service

sudo systemctl enable NetworkManager.service

You will see that the interfaces have been enabled by running the status command.

sudo systemctl status NetworkManager.service

Using the ifconfig Command

Enabling and disabling network interfaces through the ifconfig command requires the network tools in your system.

First, you must install network tools if it still needs to be installed in your system. Use the following command to install network tools in Pop!_OS:

sudo apt install net-tools

Next, get the information about the built-in network interface in the system by running the following ‘ip’ command:

ip a

On running the previous command, you can see that the enp0s3 interface is up, i.e., active. Apart from this, you can also check the interface state separately with the grep flag, as shown below:

ip a | grep -A 1 "enp0s3"

Here, you can disable it using the ‘ifconfig’ command. Hence, the interface name and state (which you must apply) must be used with an ifconfig command, as shown below:

sudo ifconfig enp0s3 down

You do not get any output from the previous command, but it changes the system’s network interfaces. Now, you can recheck the network interfaces with the following command to see if it is disabled or not:

ip a

To enable network interfaces, enter the ‘down’ state in the previous ifconfig command.

sudo ifconfig enp0s3 up

You can verify that the network interface is enabled by executing the following command:

ip a | grep -A 1 "enp0s3"

Using the nmcli Command

The nmcli command-line utility is used as a replacement for nm-applet or other graphical clients. This utility lets you delete, update, create, and display network interfaces and enable and disable the system’s network interfaces.

It displays the profile name instead of the device name. Run the following command to get information about network interfaces:

nmcli con show

Check the status of network interfaces with the help of the following command:

nmcli dev status

You can see that the network interface is connected or enabled. Execute the following command to disable it with the help of the nmcli command:

nmcli con down ‘Wired connection 1’

Thus, you can see that the twerk interface is disconnected or disabled by running the following command:

nmcli dev status

Similarly, you can enable or reconnect the network connection with the following command:

nmcli con up ‘Wired connection 1’

Using the IP Command

You can also enable and disable network interfaces through the IP command. The general syntax for enabling/disabling network interfaces with the help of IP command is as follows:

sudo ip link set <Device_Name> <status>

Use the following IP command to enable network interfaces:

sudo ip link set enp0s3 up

Note that you will not see anything as output after running this command. You can see that the network is enabled using the IP command with the ‘a’ variable.

ip a

Similarly, you can also disable the network interface and check that it is disabled.

sudo ip link set enp0s3 down

ip a

Using the nmtui Command

You can interact with the network manager services using the text-based user interface, ‘Nmtui’. It lets you configure network interfaces by providing a simple text user interface environment. Just type the ‘nmtui’ in the terminal to display its interface.

nmtui

On running the previous command, the following window will appear in the terminal; you can change the network interfaces very easily.

Select the following option to deactivate the system when it is network enabled:

Similarly, you can again enable it by selecting ‘Activate’.

Conclusion

This tutorial explains different ways to enable and disable network interfaces on Pop!_OS. You can change and configure your system’s network interfaces using any of the methods mentioned earlier. We recommend you run the commands correctly, or you may face significant issues and errors.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.