Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to enable and disable network cards in Linux (not comprehensive but easy to use)

Shulou Source: shulou.com Published: 2022-06-02 14:52:10 10月03日 Update

Enabling disabling the network card can be done in the following ways:

Ifconfig command: used to configure the network card, can provide a lot of information about the network card.

Common syntax for ifconfig:

# ifconfig [NIC_NAME] Down/Up

Execute the following command to disable the enp0s3 network card.

# ifconfig enp0s3 down

Execute the following command to enable the enp0s3 network card.

# ifconfig enp0s3 up

Ifdown/up command: the ifdown command is used to disable the network card, and the ifup command is used to enable the network card.

Common syntax for ifdown/ifup:

# ifdown [NIC_NAME]

# ifup [NIC_NAME]

Execute the following command to disable the eth2 network card.

# ifdown eth2

Execute the following command to enable the eth2 network card.

# ifup eth2

Ip command: used to manage the network card to replace the old, deprecated ifconfig command. The ip command is similar to the ifconfig command, but provides powerful features that many ifconfig commands do not have.

Nmcli command: a command-line tool that controls NetworkManager and reports the status of the network.

Nmtui command: a terminal UI application that interacts with NetworkManager and is based on curses graphics library.

Tags: Commands network cards commonly used syntax powerful similar information graphics tools reports methods features status terminals networks applications control recommendations management configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Linux Shulou Technology Docker Redmi