10
1
Once upon a time, I used ifdown eth0 to down a network adaptor. It has been years since I've been able to get this to work, basically since I've been on Ubuntu/Debian.
I get this:
$ sudo ifdown eth0
ifdown: interface eth0 not configured
If I run ifconfig, I get:
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.20.50 Bcast:192.168.21.255 Mask:255.255.254.0
inet6 addr: fe80::6e3b:e5ff:fe36:2ee/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1205280 errors:0 dropped:502 overruns:0 frame:0
TX packets:34930 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:165685286 (165.6 MB) TX bytes:5754120 (5.7 MB)
Interrupt:20 Memory:f7f00000-f7f20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9146 errors:0 dropped:0 overruns:0 frame:0
TX packets:9146 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:734342 (734.3 KB) TX bytes:734342 (734.3 KB)
I've googled to find out how to do this and everything I can find says run ifdown eth0. How do I stop the network adaptor on Debian/Ubuntu boxes?
Captain Obvious here, don't try this in the cloud. – John Lehmann – 2015-12-09T13:09:27.060
This just brings the adapter down on the physical layer (i.e. as far as the kernel network stack is concerned), and this has nothing to do with the userland layer supposed to manage the adapter. Please see my answer -- may be you'll be able to join efforts with the OP to figure out which subsystem manages your network. – kostix – 2013-12-31T12:19:04.847
OK, this did it. I didn't try this before because, on Redhat, ifdown ran ifconfig so I assumed the same for Debian. Silly me. Thanks for this. WTF? – Thom – 2013-12-31T12:20:39.823
@Thom, the problem is that the next time you boot
eth0
will most likely be up again. – kostix – 2013-12-31T12:21:13.603@Thom, as to WTF... ;-) The kernel is (almost) the same across the distros but the userland tools are not. Well,
nm
andwicd
are the same across the distros, but the "traditional" low-level stuff is not. – kostix – 2013-12-31T12:23:14.550@kostix That's fine. Just wanted to disable a bit for testing. Since it's a VirtualBox it's hard to unplug the network cable. :) Also, I understand about the tools, but the Debian docs say to use ifdown. That's why WTF? – Thom – 2013-12-31T12:52:59.227
@Thom, as per the docs, a call to
– kostix – 2013-12-31T12:58:55.720VBoxManage modifyvm your_vm_name --cableconnected 1 off
should do the trick. That's only if you're running w/o the GUI front-end, otherwise it could be done right from the main menu of the window showing the guest's console.@kostix Looked at the GUI and the checkbox for enable this adaptor was disabled, so I couldn't disable it that way. Didn't look for a command prompt option. Thanks for the info, though. – Thom – 2013-12-31T14:29:22.693