How to Enable & Disable the Ethernet Card in Linux

Linux interacts with every network adapter through an operating system construct called "network interface." Network interfaces present a uniform set of primitives to applications that require network access, while hiding the details specific to the adapter's hardware and the configuration parameters for its driver. In particular, you can enable and disable an Ethernet card by running Linux commands that interact with the corresponding network interface.

...
You can turn on or off your wired Ethernet adapter from Linux.

Step

Log into the Linux computer.

Step

Launch a command shell. The specific way of performing this step depends on the Linux distribution and on how your machine has been configured. For example, for the default configuration of Ubuntu Linux, click on "Applications" on the taskbar at the top of the desktop, then select "Accesories," then select "Terminal."

Step

Gain superuser privileges by typing "su" into the shell, then pressing "Enter." Enter the root password. If your Linux distribution does not have a "root" account enabled by default, type "sudo bash" and enter your own password when prompted.

Step

Type the following command into the shell:

Step

ifconfig

Step

Press "Enter." The command will list the network interfaces known to Linux. Find the one corresponding to the Ethernet card you need to enable or disable; its name will start with "eth."

Step

Enable the Ethernet card by typing the following command into the shell:

Step

ifconfig eth0 up

Step

Replace "eth0" by the name of the network interface obtained in Step 4. Press "Enter."

Step

Disable the Ethernet card by typing the following command into the shell:

Step

ifconfig eth0 down

Step

Replace "eth0" by the name of the network interface, obtained in Step 4. Press "Enter."