You are not logged in.

#1 2021-01-16 13:34:29

moormaster
Member
Registered: 2009-11-09
Posts: 3

WOL (Wake-On-LAN) not working with r8169 and bridged netctl config

In my system I have bridged two virtual network adapters (tap0, tap1) together with my ethernet adapter. Since a few weeks my PC does not wake up to magic pakets anymore.

Hardware-Info

$ lspci 
...
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
$ lsmod 
Module                  Size  Used by
...
r8169                  98304  0
...
mdio_devres            16384  1 r8169
...
libphy                151552  3 r8169,mdio_devres,realtek
...

... for some reason the r8169 module is loaded?

My netctl configuration looks like:

/etc/netctl/tap0:

Description='tap0 interface'
Interface=tap0
Connection=tuntap
Mode='tap'
User='moormaster'
Group='network'

/etc/netctl/tap1:

Description='tap1 interface'
Interface=tap1
Connection=tuntap
Mode='tap'
User='moormaster'
Group='network'

/etc/netctl/br0-dhcp:

Interface=br0
Connection=bridge
Description="br0 (enp2s0 tap0 tap1)"
BindsToInterfaces=(enp2s0 tap0 tap1)
IP=dhcp
TimeoutDHCP=90
MACAddress="1c:6f:65:8a:0e:03"
ExecUpPre="ip link set br0 address 1c:..:..:..:..:.."
ExecUpPost="ethtool -s enp2s0 wol g"

I also want the pc to be able to wake up when it receives a magic packet. So I created the above files according to the wiki documentation

Bridge with netctl
and Wake-on-LAN#netctl

First attempt
I tried adding the s5wol=1 parameter to the r8169 module as it was suggested for Realtek cards in the troubleshooting sections here. But that did not change anything for me - maybe this only works on r8168 modules?

... then I noticed that the link lights on the adapter are going off as soon as i stop the netctl bridge profile

$ sudo netctl stop br0-dhcp

My workaround for that
... was to try to keep the ethernet adapter up even after the bridge profile stopped. I achieved this forking a background process that waits for a second and then sets the link state of my ethernet adapter to up again.

I added these nasty lines to my configuration:

/etc/netctl/br0-dhcp

...
# prevent the physical ethernet link from being shut down when the bridge is stopped to keep WOL working on shutdown
ExecDownPre="sh -c \"(sleep 1; ip link set dev enp2s0 up) &\""

For me this works for now - the link of my ethernet adpater is kept up after stopping the netctl profile and event after shutting down the pc.

But what would be the "right way" to prevent a bridged setup from disabling the ethernet link (and with it the wake-on-lan feature)?

Last edited by moormaster (2021-01-16 13:48:30)

Offline

Board footer

Powered by FluxBB