How to enable and disable network interface on Manjaro

Linux-based systems support a networking mechanism like any other operating system. The network interface is an interconnection point between a computer and a network (public or private). The functionality of software highly depends on network interfaces. Whenever any change in network settings occurs, the network interfaces may stop functioning. To get out of such a scenario, you must enable/disable the network interfaces.In this modern era of tech, the network administrator manages the network configurations in an organization. However, a typical Linux user must know the basic configuration of a network. In this Manjaro guide, we will demonstrate several ways that a Manjaro user can adopt to enable and disable network interfaces.

How to enable and disable network interfaces in Manjaro

The Linux-based machines provide strong command line support to configure the networks. In this section, we will explain the usage of several commands that can be used to enable/disable network interfaces in Manjaro Linux.

Let’s start with getting the information of network interfaces. We have executed the IP command in this regard.

$ ip a

Text Description automatically generated

How to use the ifconfig command to enable and disable a network interface in Manjaro

Before getting into depth, first, check the availability of the ifconfig command. The ifconfig command may not work on your Manjaro, because Manjaro does not offer ifconfig by default. To access it, you have to install net tools and the below-mentioned command assists in this regard.

$ sudo pacman -S net-tools

The ifconfig command in Manjaro can be used to change the status of any network interface. To use this command, the syntax is provided below.

Syntax

$ ifconfig <Network-Interface-name> up/down

For instance, the below-mentioned command will disable the interface named enp0s3.

$ sudo ifconfig enp0s3 down

A screenshot of a computer Description automatically generated with medium confidence

To verify the changes, the status of enp0s3 is checked with the help of the following command.

$ ip a sh dev enp0s3

Text Description automatically generated

Moreover, to enable the same network interface, you can use ifconfig in the following way,

$ sudo ifconfig enp0s3 up

The status can be verified by using the below-mentioned command.

$ ip a sh dev enp0s3

Text Description automatically generated

How to use the ip command to enable and disable a network interface in Manjaro

The ip command in Linux-based distros can also be used to enable or disable any network interface. To do so, you must follow the syntax provided below.

Syntax

> ip link set <interface-name> up/down

For example, we have disabled enp0s3 by using the below-mentioned command.

$ sudo ip link set enp0s3 down

Verify the status with the help of the following command.

$ ip a sh dev enp0s3

Text Description automatically generated

To set the status back to enable, the following command is executed.

$ sudo ip link set enp0s3 up

After that, you can get the status by issuing the following command.

$ ip a sh dev enp0s3

Text Description automatically generated

How to use nmcli command to enable and disable a network interface in Manjaro

The nmcli command is a powerful command-line utility that can be used to edit, activate/deactivate the network connections. Moreover, it is also used to change the status of network interfaces as well.

Syntax

$ nmcli con up/down 'name-of-connection'

The name-of-connection refers to the name of the wired connection of your Manjaro Linux. For instance, in our case, the name is “Wired connection 1“.

For instance, the following use of nmcli will disable “Wired connection 1“.

$ nmcli con down 'Wired connection 1'

Text Description automatically generated

You can verify the status of the connections by issuing the following command.

$ nmcli dev status

Graphical user interface, application Description automatically generated

To enable it again, the command written below is executed.

$ nmcli con up 'Wired connection 1'

Graphical user interface, text Description automatically generated

Check the status with the help of the following command.

$ nmcli dev status

Graphical user interface, application, website Description automatically generated

How to use nmtui tool to enable/disable a network interface in Manjaro

The nmtui is a command-line graphical interface of network configuration and it can also be used to enable/disable the network interfaces.

So, to launch this tool, simply execute the following command from your Mnajaro’s terminal.

$ nmtui

After that, you will find the interface shown below. Navigate to “Activate a connection” using arrow keys and then move to “OK” using tab key and hit enter.

Graphical user interface, application Description automatically generated

Now, choose “Wired connection 1” and move towards “Deactivate” to disable that interface.

Graphical user interface, text, application Description automatically generated

Once the network is disabled successfully, you will observe an “Activate” option. Moreover, choose “Activate” to turn the status back to active state.

Graphical user interface, application Description automatically generated

How to use systemctl command to enable/disable interface in Manjaro Linux

The systemctl command in Manjaro is exercised to enable/disable several services including the network interfaces as well. The usage of systemsctl command is very easy to manipulate the status of interfaces.

Firstly, check the current state of network interfaces. The network service is enabled and active.

$ sudo systemctl status NetworkManager.service

Text Description automatically generated

It is to notice that, before disabling the services, you have to first stop it by issuing the following command.

$ sudo systemctl stop NetworkManager.service

Now, disable the network services with the help of the command written below.

$ sudo systemctl disable NetworkManager.service

Text Description automatically generated

It is recommended to check the status of NetworkManager;

$ sudo sudo systemctl status NetworkManager.service

Graphical user interface, text Description automatically generated

Similarly, you are directed to start the service before enabling it. To do so, use systemctl command as provided below.

$ sudo systemctl start NetworkManager.service

A picture containing text Description automatically generated

And now you can enable the network service by issuing the following command.

$ sudo systemctl enable NetworkManager.service

Text Description automatically generated

After enabling, check the status with the help of the command written below.

$ sudo systemctl status NetworkManager.service

Text Description automatically generated

Conclusion

Network interfaces play a vital role in keeping the smooth functioning of the network connections. For instance, if any change occurs in the network settings, the network interface acts up and resultantly the network also stops functioning. In this article, you have learned how to enable or disable the network interfaces in Manjaro Linux. There is a list of commands supported by Manjaro that can be used to change the status of any interface individually or you can enable/disable all the interfaces at once. A typical Linux user or a network administrator can get help from this guide to manage network interfaces in Manjaro.



from https://ift.tt/3lDfWZz

Post a Comment

0 Comments