ifdown <interface> reports unknown interface when it exists!

Solution 1:

Try

sudo ifconfig enx00051ba6daff down

I had the exact same problem and this worked. Here is the link I used. https://ubuntuforums.org/showthread.php?t=1323646

Solution 2:

sudo 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.

Solution 3:

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:

  1. Use the command

    sudo nano /etc/network/interfaces
    

    or vi instead of nano, if you prefer.

  2. Here you can add an entry like this:

    auto enx00051ba6daff
    iface enx00051ba6daff inet dhcp
    
  3. Now 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.service
    

    or

    /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!