networkd não está trazendo eth0 no boot

5

Instalei o Debian 8 em um gigrix brix pro e tudo parece funcionar corretamente, exceto para redes.

Eu habilitei systemd-networkd.service , desabilitei networking.service e criei os arquivos network apropriados em /etc/systemd/network . Eu configurei e habilitei wpasupplicant para o adaptador wireless também.

Quando o sistema inicializa, ele encontra o arquivo wlan0.network , traz a interface, detecta um link e funciona perfeitamente, mas por algum motivo ele não vê (ou não registra), o eth0.network arquivo que criei. Ele não detecta um link e não traz eth0 .

Depois que o sistema é totalmente inicializado, posso executar systemctl restart systemd-networkd.service ou ifup eth0 e ele levará a interface para cima e configurá-la corretamente, no ponto em que ela funciona bem. Só não vai aparecer na inicialização.

/etc/systemd/network/wlan0.network

[Match]
Name=wlan0

[Network]
Address=192.168.1.21/24
DNS=192.168.1.1

/etc/systemd/network/eth0.network

[Match]
Name=eth0

[Network]
Address=192.168.1.10/24
Gateway=192.168.1.1
DNS=192.168.1.1

ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether fc:aa:14:db:cf:40 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether dc:85:de:ee:96:af brd ff:ff:ff:ff:ff:ff

lspci -v

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
        Subsystem: Gigabyte Technology Co., Ltd Motherboard
        Flags: bus master, fast devsel, latency 0, IRQ 43
        I/O ports at d000 [size=256]
        Memory at f7c00000 (64-bit, non-prefetchable) [size=4K]
        Memory at f0000000 (64-bit, prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
        Capabilities: [170] Latency Tolerance Reporting
        Kernel driver in use: r8168

journalctl

kernel: r8168 Gigabit Ethernet driver 8.040.00-NAPI loaded
kernel: r8168 0000:03:00.0: irq 43 for MSI/MSI-X

...

kernel: r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
kernel: r8168  Copyright (C) 2015  Realtek NIC software team <[email protected]>
                    This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>.
                    This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>.

...

systemd-networkd[456]: wlan0           : link 3 added
systemd-networkd[456]: wlan0           : udev initialized link
systemd-networkd[456]: wlan0           : flags change: +UP +RUNNING +MULTICAST +BROADCAST
systemd-networkd[456]: wlan0           : flags change: -RUNNING
systemd-networkd[456]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=H
systemd-networkd[456]: sd-rtnl: discarding 20 bytes of incoming message
systemd-networkd[456]: wlan0           : link state is up-to-date
systemd-networkd[456]: wlan0           : found matching network '/etc/systemd/network/wlan0.network'
systemd-networkd[456]: wlan0           : enslaved
systemd-networkd[456]: wlan0           : setting addresses
systemd-networkd[456]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.2 object=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 error=
systemd-networkd[456]: Got message type=signal sender=org.freedesktop.DBus destination=:1.2 object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAc
systemd-networkd[456]: sd-rtnl: discarding 20 bytes of incoming message
systemd-networkd[456]: rtnl: received address for a nonexistent link, ignoring
systemd-networkd[456]: rtnl: received address for a nonexistent link, ignoring
systemd-networkd[456]: wlan0           : added address: 192.168.1.21/24
systemd-networkd[456]: wlan0           : addresses set
systemd-networkd[456]: wlan0           : link configured

systemctl status systemd-networkd.service (da inicialização)

systemd-networkd[456]: sd-rtnl: discarding 20 bytes of incoming message
systemd-networkd[456]: rtnl: received address for a nonexistent link, ignoring
systemd-networkd[456]: rtnl: received address for a nonexistent link, ignoring
systemd-networkd[456]: wlan0           : added address: 192.168.1.21/24
systemd-networkd[456]: wlan0           : addresses set
systemd-networkd[456]: wlan0           : link configured
systemd-networkd[456]: wlan0           : flags change: +LOWER_UP
systemd-networkd[456]: wlan0           : flags change: +RUNNING
systemd-networkd[456]: wlan0           : gained carrier
systemd-networkd[456]: wlan0           : added address: fe80::de85:deff:feee:96af/64

systemctl status systemd-networkd.service (após o reinício de networkd)

systemd-networkd[877]: wlan0           : link configured
systemd-networkd[877]: eth0            : flags change: +UP
systemd-networkd[877]: eth0            : added address: 192.168.1.10/24
systemd-networkd[877]: eth0            : addresses set
systemd-networkd[877]: eth0            : setting routes
systemd-networkd[877]: eth0            : routes set
systemd-networkd[877]: eth0            : link configured
systemd-networkd[877]: eth0            : flags change: +LOWER_UP +RUNNING
systemd-networkd[877]: eth0            : gained carrier
systemd-networkd[877]: eth0            : added address: fe80::feaa:14ff:fedb:cf40/64

Que outras informações devo fornecer para ajudar a encontrar uma solução para isso?

UPDATE

Adicionando as linhas a seguir a /etc/network/interfaces e habilitando networking.service corrige o problema e tudo surge durante a inicialização, mas eu prefiro não usar o antigo sistema init.d. Eu quero usar o novo systemd-networkd e gostaria de saber por que isso está acontecendo nesse ambiente.

auto eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1

EDITAR

wpa_supplicant.service está ausente porque eu o desativei e o networking.service está ativado porque é a única coisa que está funcionando atualmente.

systemctl -t service

UNIT                                            LOAD   ACTIVE SUB     DESCRIPTION
acpid.service                                   loaded active running ACPI event daemon
atd.service                                     loaded active running Deferred execution scheduler
console-setup.service                           loaded active exited  LSB: Set console font and keymap
cron.service                                    loaded active running Regular background program processing daemon
dbus.service                                    loaded active running D-Bus System Message Bus
exim4.service                                   loaded active running LSB: exim Mail Transport Agent
[email protected]                              loaded active running Getty on tty1
kbd.service                                     loaded active exited  LSB: Prepare console
keyboard-setup.service                          loaded active exited  LSB: Set preliminary keymap
kmod-static-nodes.service                       loaded active exited  Create list of required static device nodes for the current kernel
lm-sensors.service                              loaded active exited  Initialize hardware monitoring sensors
networking.service                              loaded active exited  LSB: Raise network interfaces.
nfs-common.service                              loaded active exited  LSB: NFS support files common to client and server
rc-local.service                                loaded active exited  /etc/rc.local Compatibility
rpcbind.service                                 loaded active running LSB: RPC portmapper replacement
rsyslog.service                                 loaded active running System Logging Service
ssh.service                                     loaded active running OpenBSD Secure Shell server
systemd-backlight@backlight:acpi_video0.service loaded active exited  Load/Save Screen Backlight Brightness of backlight:acpi_video0
systemd-journald.service                        loaded active running Journal Service
systemd-logind.service                          loaded active running Login Service
systemd-modules-load.service                    loaded active exited  Load Kernel Modules
systemd-networkd.service                        loaded active running Network Service
systemd-random-seed.service                     loaded active exited  Load/Save Random Seed
systemd-remount-fs.service                      loaded active exited  Remount Root and Kernel File Systems
systemd-resolved.service                        loaded active running Network Name Resolution
[email protected]                  loaded active exited  Load/Save RF Kill Switch Status of rfkill0
systemd-setup-dgram-qlen.service                loaded active exited  Increase datagram queue length
systemd-sysctl.service                          loaded active exited  Apply Kernel Variables
systemd-tmpfiles-setup-dev.service              loaded active exited  Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service                  loaded active exited  Create Volatile Files and Directories
systemd-udev-trigger.service                    loaded active exited  udev Coldplug all Devices
systemd-udevd.service                           loaded active running udev Kernel Device Manager
systemd-update-utmp.service                     loaded active exited  Update UTMP about System Boot/Shutdown
systemd-user-sessions.service                   loaded active exited  Permit User Sessions
udev-finish.service                             loaded active exited  Copy rules generated while the root was ro
    
por vane 21.11.2015 / 07:26

1 resposta

3

O motivo pelo qual adicionar uma sub-rotina a /etc/networking/interfaces resolve seu problema é que você tem o networking.service ativado. Se você olhar para o arquivo networking.service , verá (parcialmente editado):

[Unit]
SourcePath=/etc/init.d/networking
Description=LSB: Raise network interfaces.
.....
[Service]
.....
ExecStart=/etc/init.d/networking start
ExecStop=/etc/init.d/networking stop
ExecReload=/etc/init.d/networking reload

que mostra claramente que este é o serviço que fornece compatibilidade com o antigo script SysV, que você deseja evitar.

Embora isso não esteja claramente definido em nenhum lugar (que eu possa encontrar!), meu palpite é que isso conflita com systemd-networkd.service , que pode fornecer exatamente o mesmo serviço, embora sem a compatibilidade com o SysV.

Então, meu palpite é desativar networking e reiniciar para verificar se essa é a única parte da solução.

    
por 21.11.2015 / 09:01