Wednesday 22 February 2017

How to disable and enable ethernet on Ubuntu


If you are using ethernet cable for your network connection and you want to disable it without unplug the cable, you can do it from the command line.

Ubuntu has specific command dedicated for this type of situation, with this command you can disable and enable any network interfaces that you have including ethernet (usually eth0).

First you want to run 'ifconfig' command to see which network interface you want to disable, let's say the ethernet is eth0 and you want to disable it, so you run this:
sudo ip link set down eth0
You can run 'ifconfig' and see the eth0 should be gone, if you want to enable eth0 again, you can do this:
sudo ip link set up eth0
Using the command above, you can enable and disable any network interface basically, not just eth0, it could be eth1, eth2, wlan0, wlan1, etc.
sudo ip link set [up/down] [network-interface]

Harry

Author & Editor

A technology enthusiast and addictive blogger who likes to hacking tricks and wish to be the best White Hacket Hacker of the World.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.