Running 16.04 w/ USB ethernet running ifconfig -a lists the interface named as enx00051ba6daff however when I try to bring that interface down with:
sudo ifdown enx00051ba6daffI get:
Unknown interface enx00051ba6daffI know its up because I'm writing this post from this connection. My ifconfig is as follows:
enx00051ba6daff Link encap:Ethernet HWaddr 00:ff:ff:ff:ff:ff inet addr:192.168.2.105 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::ffff:ffff:ffff:ffff/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:86522 errors:0 dropped:0 overruns:0 frame:0 TX packets:84828 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:56466348 (56.4 MB) TX bytes:12987882 (12.9 MB) 3 4 Answers
Try
sudo ifconfig enx00051ba6daff downI had the exact same problem and this worked. Here is the link I used.
1sudo ifdown enx00051ba6daff or sudo ifup enx00051ba6daff, will not work because enx00051ba6daff is not explicitly defined inside /etc/network/interfaces file.
So ifup | ifdown | ifquery family of functions is pretty unaware of what is inside the system unless this is written inside /etc/network/interfaces, but they could be since they all depend internally on ip¹ command.
It is more secure to use the sudo ifconfig enx00051ba6daff down or sudo ifconfig enx00051ba6daff up.
Note: There are couple things sudo ifconfig enx00051ba6daff down or sudo ifconfig enx00051ba6daff up will not do comparing to sudo ifdown enx00051ba6daff and sudo ifup enx00051ba6daff. ifup and ifdown will keep the state of interfaces inside /run/network/ifstate so ifstate command can tell you the state of the interface. And one another thing, if you ifup or ifdown the interface, the scripts inside /etc/network/if-*.d will run (if-down.d if-post-down.d if-pre-up.d if-up.d)
¹ip link show, will show you the correct interfaces just as ifconfig will.
In my case:
Go to /etc/network/interfaces.d/
I didn't found the setup file.
i created one
nano /etc/network/interfaces.d/setup with below contents:
auto lo
iface lo inet loopback
auto wlp2s0
iface wlp2s0 inet dhcpThen restart the service.
/etc/init.d/networking restartThen try ifdown:
ifdown wlp2s0It worked!!!
The commands ifdown and ifup listen to the file /etc/network/interfaces. In your case, it cannot find the interfaces, because they are not defined within this file.
You can fix this by:
Use the command
sudo nano /etc/network/interfacesor vi instead of nano, if you prefer.
Here you can add an entry like this:
auto enx00051ba6daff iface enx00051ba6daff inet dhcpNow you must restart your network services for the change to take effect. You can do so by running one of the following commands
systemctl restart networking.serviceor
/etc/init.d/networking restart
I know this response is well over-due, but I'm contributing this as a reference for others.
Hope this helps!