Celeb Glow
general | March 17, 2026

Enabling and disabling network card through commandline

Can anybody help me to how can I enable and disable network card through terminal?

2

3 Answers

Since ifconfig has been deprecated for many years now, you should probably use the ip command :

To list the interfaces:

ip link

or with the ip addresses:

ip a

To take one down:

if=eth0
sudo ip link set $if down
2

use ifconfig to view your ethernet or NIC ports (to get port names; eg. eth0 was the first port on my machine, next was eth1 etc)

to disable say port named eth0 use

sudo ifconfig eth0 down

to re-enable the port use

sudo ifconfig eth0 up

note: this disables (down) and enables (up) each port individually. if for example a NIC (network interface card) has four ports on a card, you need to enable/disable each port individually.

5

To see list of network cards:

lshw -C network

You will see all the network cards. Attention to logical name example:

logical name: wlp6s0
logical name: enp7s0

So just use ifconfig to enable or disable it.

Examples:

  • Enable sudo ifconfig wlp6s0 up
  • Disable: sudo ifconfig enp7s0 down
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy