How can I get WOL to work on 64 bit Ubuntu?
It's a wierd situation. The hardware is a heavily modified ASUS G75VW 3D. Windows and 32 bit Ubuntu work fine for Wake on LAN. The motherboard has a minor role here, only having some power save settings which I disabled in bios to allow WOL. Then, the NIC has to be configured. On Windows this is a one time setting and it works great. On Ubuntu 32 bit, I used an rc.local
trigger for ethtool
and it worked great.
On 32 bit Ubuntu the network card shows up as eth0
as one might expect. On 64 bit, it get's renamed to enp4s0
. I know it's renamed because I checked dmesg
, which also says why my rc.local script doesn't change the wol
from d
to g
in ethtool
:
[ 1.624275] atl1c 0000:04:00.0 enp4s0: renamed from eth0
[ 3.821446] IPv6: ADDRCONF(NETDEV_UP): enp4s0: link is not ready
[ 3.822431] atl1c 0000:04:00.0: atl1c: enp4s0 NIC Link is Up<1000 Mbps Full Duplex>
ok, whatever. I can deal with the link being not ready, put it on a timer or something for later. But if I set it manually, ethtool says it's showing wol g for the card
Supports Wake-on: pg
Wake-on: g
For some reason, this gets reset when I shutdown the computer, because the wol magic packet does not wake the computer even after this.
Testing
I've tested a lot of things. First, the wol trigger does not work if the laptop has been unplugged, even briefly. It does work if the ethernet cable has been unplugged and plugged back in. The wol trigger is clearly being set as the OS shuts down because if I shutdown 32 bit ubuntu and swap the hard drives without unplugging, I can WOL into 64 bit ubuntu.
I suspect it has something to do with the drivers, but I don't know where to get them if that's the case. Then again, can I just run the 32 bit driver on 64 bit and be done with it? I have 32 bit libs on the machine for other purposes.
I can't solve this by running 32 bit ubuntu, because I run JVMs on the machine that require a large amount of RAM (beyond the 32 bit limit).
Per the ubuntu help docs I removed network-manager
and attempted to configure the connection with ifup
(from here). Unfortunately, ifup didn't recognize the interface. Here were the contents of my /etc/network/interfaces
file in 64 bit.
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
I don't know why my wireless and ethernet card were not listed there. Here is ifconfig -a
.
enp4s0 Link encap:Ethernet HWaddr 10:bf:48:19:08:b4
inet addr:192.168.1.91 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::12bf:48ff:fe19:8b4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:505 errors:0 dropped:0 overruns:0 frame:0
TX packets:289 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:48646 (48.6 KB) TX bytes:38816 (38.8 KB)
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:57 errors:0 dropped:0 overruns:0 frame:0
TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8091 (8.0 KB) TX bytes:8091 (8.0 KB)
wlp3s0 Link encap:Ethernet HWaddr c4:85:08:70:7d:7b
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
So per a forum post I added enp4s0
manually to the network interfaces file. It now looks like:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp4s0
iface enp4s0 inet dhcp
Then ifup worked. I don't know if I did it right, but all I did was type:
ifup enp4s0
Everything still worked and I could still SSH in after a restart, so I guess I haven't yet broken my ethernet card. I really don't know what I'm doing here guys and I'm grasping at straws.
I read a little further down the help page and realized I overlooked the link to a bug.
Following the workaround, I added a script to rc6.d
and rc0.d
and set them to executable but I'm not sure how to check if the actually executed (I guess I could echo
something and check dmesg
...would that work?). I rebooted the machine once for good measure and powered it down, but it still did not come up with WOL attempts.
Following the rabbit hole I found a comment on a blog post which suggested a more specific static IP address would help. I didn't see why (since magic packet sends to the entire network with a mac address), but I tried it anyway. If my configuration for network interfaces looks like his, there is no change.
Further details about the machine. Both 32 bit and 64 bit are on the latest Ubuntu 15.10 Wily Werewolf
.
Update
I have more research.
I can confirm that WoL works on a fresh install of Wily Werewolf 64 bit. Following that, I ran:
sudo apt-get update
sudo apt-get upgrade
And then WoL stopped working. That appears to be the only steps necessary to reproduce my issue.
So again, here's my question:
rc.local
has always worked fine. I use it on my raspberry pis and lots of VMs & cloud instances. I know there's a better way (changing the interfaces to trigger it as it "up"s but that doesn't work either so it doesn't matter.rc.local
works fine on 32 bit was all I was saying – deltree Oct 28 '15 at 02:21/etc/udev/rules.d
on the machine. I tried to follow the bit about adding the interface, but write_net_rules does not exist in the/lib/udev
folder – deltree Oct 28 '15 at 05:09