3

I had opened a terminal to install macchanger via sudo apt-get install -y macchanger, and then entered my password. It stated that macchanger was already the newest version, so I typed clear and then ran:

sudo ifconfig eth0 down

which is when this error message appeared:

eth0 ERROR while getting interface flags: no such device

This is a laptop and I am connected via ethernet cable.

How can I resolve this, so that I can run macchanger?


So I used ifconfig -a and I'm looking but seeing no mention of eth0

The interfaces that are showing top to bottom are:

enp58s0f1
lo
tun0
UNSPEC
wlp59s0

The only reference to ethernet is the MAC and also txqueuelen

Does this help in figuring what I need to do to get this sorted?

9

According to your ifconfig -a output, enp58s0f1 is your Ethernet, not eth0.

When Ubuntu switched to systemd (at Ubuntu 15.04), it switched away from the old system with eth0 and so on to what are called Predictable Network Interface Names. Ethernet interfaces start with en (so yours is enp58s0f1). Wireless interfaces start with wl.

| improve this answer | |
  • That is so helpful! Really appreciate your explanation, which has made a Noob2Ubuntu very happy. – mogruith Nov 17 '17 at 18:41
  • Nice of them to make explanatory error messages... :| – endolith Aug 28 '18 at 2:05
1

first, read the manual.

$ man ifconfig

then, afterwards, you'll understand what ifconfig does. also, ifconfig is considered to be a deprecated tool (i still use it however, it's handy because it's familiar and easy to use).

$ ifconfig -a

will display all interfaces.

$ ip address will also display similar information.

You might want to do some googling on some basic networking commands and how they work. TLPD has a quick synopsis on some of the most common commands in linux for networking.

My arch system is configured to give older interface names, but the newer names (automatically configured by ubuntu) give newer (more complicated, harder to remember, and type) information.

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.254.3/24 brd 192.168.254.255 scope global dynamic wlan0
       valid_lft 82688sec preferred_lft 82688sec
    inet6 f::f:f:f:f/64 scope link 
       valid_lft forever preferred_lft forever

You can see I have 3 interfaces, lo (for loopback), eth0 (for ethernet), and wlan0 (for wireless). If you don't use the correct interface name, then it won't work.

$ sudo ip link set eth0 up will bring the interface up if it was down. The Ubuntu Server Guide has some detailed information on how to accomplish configuration, bringing the interface down, and back up.

| improve this answer | |
0

Network interfaces may have other names, since the renaming mode is enabled when 1-2 digits are partially taken from the pci number of the network device to generate a specific name. This is done so that the names of network devices are not connected to the machine by new adapters. As a result, eth0 can be called, for example, enp2s1 or ens1, or even eng78e7d1er12ds

to disable renaming:

sudo nano /etc/default/grub

replace the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

on

GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0"

sudo update-grub ; reboot

ifconfig

as a result, i get (depending on the number of your installed network cards):

eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    ether 00:w0:4c:u6:97:11  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
    inet6 ue80::c93e:6718:72e9:4423  prefixlen 64  scopeid 0x20<link>
    ether 00:0a:5r:c2:21:70  txqueuelen 1000  (Ethernet)
    RX packets 376  bytes 467372 (467.3 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 398  bytes 41048 (41.0 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 137  bytes 11110 (11.1 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 137  bytes 11110 (11.1 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.