не поднимается eth0 после обновления на Jessie
Обновил Debian Jessie и отвалилась сеть. Явно видно что саму сетевую карту он видит, но .. подключить не может. Куда копать ?
P.S. дрова тоже есть, вечером смогу выложить подтверждение. Вроде стоит firmware-realtek (0.43).
> lspci | grep Ethernet 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03) > ifconfig Controller (rev 03) 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:65536 Metric:1 RX packets:802 errors:0 dropped:0 overruns:0 frame:0 TX packets:802 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:147174 (143.7 KiB) TX bytes:147174 (143.7 KiB) > dmesg | grep r8169 [ 0.787318] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded [ 0.787329] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control [ 0.787639] r8169 0000:03:00.0: irq 40 for MSI/MSI-X [ 0.787892] r8169 0000:03:00.0 eth0: RTL8168d/8111d at 0xffffc90000644000, 6c:f0:49:b8:d2:e0, XID 083000c0 IRQ 40 [ 0.787895] r8169 0000:03:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko] > sudo du /sys/ | grep eth0 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/power 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/queues/rx-0 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/queues/tx-0/byte_queue_limits 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/queues/tx-0 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/queues 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0/statistics 0 /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/eth0 > cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # add eth0 explicitly auto eth0 > ifup eth0 Ignoring unknown interface eth0=eth0. > sudo service networking restart [warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces . (warning). [. ] Reconfiguring network interfaces. Ignoring unknown interface eth0=eth0. Ignoring unknown interface eth0=eth0. done. > vim /etc/network/interfaces > cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # add eth0 explicitly # auto eth0 > sudo service networking restart [warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces . (warning). [ ok ] Reconfiguring network interfaces. done. > ifconfig Controller (rev 03) 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:65536 Metric:1 RX packets:802 errors:0 dropped:0 overruns:0 frame:0 TX packets:802 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:147174 (143.7 KiB) TX bytes:147174 (143.7 KiB)
Ну так у тебя eth0 и не сконфигурирован же.
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # add eth0 explicitly # auto eth0
auto eth0 iface eth0 inet dhcp
“Периодически ни с того ни с сего при перезапуске сетевого интерфейса возникла ошибка:”
* Reconfiguring network interfaces…
Ignoring unknown interface eth0=eth0.
Если у Вас также как и у меня машина получает IP адрес через DHCP следует проверить конфигурационный файл сети (ekzorchik@ekv:~$ sudo nano /etc/network/interfaces) на наличие следующих строк:
Если их нет, вписать, после перезапустить сетевой интерфейс :
ekzorchik@ekv:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces… Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/08:00:27:0b:36:ff
Sending on LPF/eth0/08:00:27:0b:36:ff
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPOFFER of 192.168.1.2 from 192.168.1.255
DHCPREQUEST of 192.168.1.2 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.2 from 192.168.1.255
bound to 192.168.1.2 — renewal in 684457 seconds.
ssh start/running, process 2181
Как видим по выводу все хорошо . Проверяем утилитой ping любой ресурс интернета.
ekzorchik@ekv:~$ ping ya.ru -c 1
PING ya.ru (213.180.204.3) 56(84) bytes of data.
64 bytes from www.yandex.ru (213.180.204.3): icmp_req=1 ttl=53 time=4.06 ms
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 4.062/4.062/4.062/0.000 ms
От ekzorchik
Всем хорошего дня, меня зовут Александр. Я под ником — ekzorchik, являюсь автором всех написанных, разобранных заметок. Большинство вещей с которыми мне приходиться разбираться, как на работе, так и дома выложены на моем блоге в виде пошаговых инструкции. По сути блог — это шпаргалка онлайн. Каждая новая работа где мне случалось работать вносила новые знания и нюансы работы и соответственно я расписываю как сделать/решить ту или иную задачу. Это очень помогает. Когда сам разбираешь задачу, стараешься ее приподнести в виде структурированной заметки чтобы было все наглядно и просто, то процесс усвоения идет в гору.
ifdown reports unknown interface when it exists!
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 enx00051ba6daff
Unknown interface enx00051ba6daff
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)
It’s a USB gigE + 3 x USB3 ports. Again, the Eth interface works, it just doesn’t like the name when used with ifdown/ifup but I realized I can do it with ifconfig
4 Answers 4
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
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.
Unknown interface eth0 even though `ethtool eth0` shows info
I am running kali linux on a virtual machine (VM). I started the machine today and noticed that the interface eth0 is missing. So I tried ifup eth0 to start it, but got output: unknown interface eth0 . But if I execute ethtool eth0 then I get this output:
Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: on MDI-X: Unknown (auto) Supports Wake-on: d Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: no
2 Answers 2
The reason of this error is that here, eth0 means two different things:
- either the actual interface name, as seen by the kernel, iproute2 tools, ethtool, dhclient, etc. which does exist,
- or the interface configuration in the ifupdown tools, pointing to the actual interface name. Here, if eth0 was never defined in the configuration, then it’s not known by ifup: that’s the error message. An easy way to reproduce this error:
# ip link add name veth5 type veth peer name veth6 # ethtool veth5 Settings for veth5: Supported ports: [ ] [. ] Link detected: no # ifup veth5 ifup: unknown interface veth5
So the interface is not missing. the ifupdown tool has not been configured to use it.
For your case, you could add at the end of /etc/network/interfaces (or in a separate file for example /etc/network/interfaces.d/eth0 if the interfaces file includes the interfaces.d directory in its config) these two lines:
auto eth0 iface eth0 inet dhcp
To have the ifupdown tools and so the ifup command know about it and configure it with DHCP at boot. I have no idea why this wasn’t in place before.
In my previous fake example where I added likewise veth5 ‘s definition (on Debian 9):
# ifup -a Internet Systems Consortium DHCP Client 4.3.5 Copyright 2004-2016 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/veth5/1e:96:59:c3:e4:0c Sending on LPF/veth5/1e:96:59:c3:e4:0c Sending on Socket/fallback DHCPDISCOVER on veth5 to 255.255.255.255 port 67 interval 8