Solved FreeBSD disables Wake On LAN

obsigna

Profile disabled
I cannot seem to get WOL working with FreeBSD on my server based on a ASRock B250M Pro4 board. In the UEFI Chip Set Configuration of the board, I enabled PCIe/PCI Devices Power On.

Actually, when I start the system into the UEFI settings, and then by using the power button directly switch it off again – without booting into FreeBSD – it can be awoken by a broadcast WOL packet. Once booted into FreeBSD and then powered down by any method, WOL would be turned disabled. So on the hardware side WOL is functional.

Is there any way to tell FreeBSD to either honour the UEFI settings or to force it leaving WOL enabled on shutdown?
 
Have you enabled WoL option on the NIC via ifconfig(8)?

If that works, you can add the "wol" option to the ifconfig entry in rc.conf
Yes, I tried this and this didn't make any difference. The on board NIC is advertised to be a Intel GigaBit interface, and it is controlled by the em(4) device driver: <Intel(R) PRO/1000 Network Connection 7.6.1-k>, however, ifconfig -m does not show any WOL in the list of options. I got another system with a PCIe Intel 1000/PRO GigaBit NIC, and with that one WOL does work.
 
Really surprised that it doesn't use Intel igb(4) interface.

Just for isolation have you tried a Linux LiveCD and see what the WOL situation is.
Might help elimanate FreeBSD as the culprit.
 
You might have network card set wrong. According to the specs it has:
Giga PHY Intel® I219V

This is most definatly igb(4) driver needed.
https://www.asrock.com/MB/Intel/B250M Pro4/index.asp#Specification

The only reason I know that this works is because I moved a drive yesterday and I noticed em(4) driver supports my igb(4) adapter.
Change to this in your /etc/rc.conf:
ifconfig_igb0=""
To verify Network Adapter spec maybe checkout what pciconf -lv | grep network -B3 -A2 shows for the device.
 
I gave it a try, to set ifconfig_igb0="inet ..." in /etc/rc.conf, however this is not honoured because the system is starting-up with the em(4) driver with the onboard NIC. So, I would need to specify the igb(4) driver in an earlier stage of booting – is this possible?
 
What does pciconf show? Maybe the website is wrong.
pciconf -lv | grep network -B3 -A
Code:
em0@pci0:0:31:6:    class=0x020000 card=0x15b81849 chip=0x15b88086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Connection (2) I219-V'
    class      = network
    subclass   = ethernet
FreeBSD 11.1-RELEASE-p9 thinks that it is an em(4) device. I will check FreeBSD 12-CURRENT on this, perhaps this has a different notion.
 
I booted the FreeBSD 12-CURRENT mini-memstick image with this board, and FreeBSD 12 seems to support much better the onboard Intel NIC. Although FreeBSD 12 still thinks that it is an em(4) device, WOL is fully functional with this one:
Code:
em0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=85259b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO>
capabilities=853d9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,LRO,WOL_UCAST,WOL_MCAST,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO>
ether 70:85:c2:5d:e8:6d
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
supported media:
media autoselect
media 1000baseT
media 1000baseT mediaopt full-duplex
media 100baseTX mediaopt full-duplex
media 100baseTX
media 10baseT/UTP mediaopt full-duplex
media 10baseT/UTP

I will mark this question as solved, since quite obviously the ASRock B250M Pro4 is too new for FreeBSD 11.1 and I only need to await the upcoming releases, or simply switch to CURRENT.
 
You may want to give 11-STABLE a try instead of -CURRENT. Everything that's in 11-STABLE now will go into the next 11.2-RELEASE.
 
I preferred to stay with RELEASE on a production system, anyway, I tried the following:
# svn checkout http://svn.freebsd.org/base/stable/11/sys/dev/e1000 ~/install/e1000
# cd /usr/src/sys/dev
# mv e1000 e1000_11.1
# ln -s ~/install/e1000
# cd ../..
# tmux new "make -j6 buildkernel KERNCONF=GENERIC"
# tmux new "make installkernel KERNCONF=GENERIC"
# shutdown -r now

System boots perfectly, and WOL_MAGIC is listed in the em0 options, and this looks good already. Now the final check.
# shutdown -p now

In the Terminal on my Mac:
wol -b 192.168.0.255 70:85:c2:5d:e8:6d

Voilà the ASRock board has been awoken :)

Just in case, I will keep /boot/kernel.old around, of course.
 
Back
Top