Disable network adaptor eth0 on Debian
Solution 1:
I am facing the same issue on Debian. I don't know the exact cause, however, it is working with sudo ifconfig eth0 down
for me.
Edit: Thanks to @kostix for his annotations. I haven't concerned myself with the problem in much detail since I use it to temporarily bring down the interface. If you want to permanently bring it down, ifdown is the way to go. For this to work, you will need to add the line eth0=eth0
to /run/network/ifstate
and the lines auto eth0
and iface eth0 inet dhcp
to /etc/network/interfaces
.
Solution 2:
if ifconfig
isn't available on your distro, it means it is replaced by the ip
command.
In this case, the solution would be ip link set eth0 down
Solution 3:
There's no definitive answer as there might be several ways to manage networking in Debian. I'm aware of at least three:
-
The "traditional" approach, using
/sbin/ifup
,/sbin/ifdown
and/etc/init.d/networking
, all using the/etc/network/interfaces
configuration file. These are provided by theifupdown
package.Since
ifdown
knows nothing about the adapter, I reckon another way is used to manage the network.I'm also aware about a package which is beleived to be a drop-in replacement for
ifupdown
,netscript
, but since it uses the same means to manage adapters this is supposedly also not your case. - NetworkManager
- Wicd
Supposedly you have to work out which one is instanned and work from there. Both nm
and wicd
usually are configured using GUI tools (and usually via applets starting along with your DE). nm
has a command line tool, called nm-cli
. Not sure about wicd
.
If you did a simple installation and selected the "Desktop" task then I beleive (though not sure) you've got NetworkManager installed.