Wake on LAN (WoL) is a computer networking feature used to remotely wake (turn on) a device that is in sleep (low power) mode. The device’s network interface card (NIC) can cause the computer to wake up after receiving a special broadcast packet (magic packet) containing its MAC address. In this article, we will look at how to enable and use Wake on LAN on a Windows device.
First, you need to enable Wake-on-LAN in your computer’s BIOS/UEFI firmware settings. Depending on your computer model and firmware version, the exact name of this option may vary. It can be called:
- WOL (Wake-on-LAN)
- Power On By PCI-E
- Resume by PCI-E Device
- Resume by PME
- S4/S5 Wake on LAN
- ErP
$getLenovoBIOS = gwmi -class Lenovo_SetBiosSetting -namespace root\wmi
$getLenovoBIOS.SetBiosSetting("WakeOnLAN,Enable")
$SaveLenovoBIOS = (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi)
$SaveLenovoBIOS.SaveBiosSettings()
Then enable Wake on LAN (WOL) in the settings for your network adapter in Windows.
- Open the Device Manager console (
devmgmt.msc
); - Open the properties of your physical NIC in the Network Adapters section;
- Go to the Advanced tab and make sure the Wake on magic packet option is enabled (the option name may vary depending on the network adapter). On Intel network cards, this option may be called PME (Power Management Event); You can use PowerShell to check that the WakeOnLan option is enabled in the settings for your network adapter:
Get-NetAdapter -Physical | Get-NetAdapterAdvancedProperty | where {($_.DisplayName -like '*WOL*') -or ($_.DisplayName -like '*Wake*')}
To enable WOL for a NIC, run (Depends on driver and NIC vendor):
Get-NetAdapter -Physical | Set-NetAdapterPowerManagement -WakeOnMagicPacket Enabled -WakeOnPattern Enabled
- Then go to the Power Management tab and allow the network adapter to wake the computer from sleep mode. Enable the Allow this device to wake the computer and Only allow a magic packet to wake the computer options. You can enable this option using cmd:
powercfg /deviceenablewake "Realtek PCIe GbE Family Controller"
Use the following command to check which devices can wake your computer:
powercfg /devicequery wake_armed
The Realtek PCIe network card can wake the computer from sleep in this case.
You will now be able to send a WoL packet to turn on your computer remotely from another device on the same LAN. Magic Packet contains the hardware address of the network card (MAC address) of the computer you want to turn on. You can find out the MAC address of your NIC from the ipconfig /all
command output, or by using PowerShell:
Get-NetAdapter -Physical
Let’s generate and send a WOL magic broadcast packet using a simple PowerShell script. In the following script, specify the MAC address of the device you want to wake up:
$Mac = "08:99:02:b6:25:2a"
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"}
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16)
$UdpClient = New-Object System.Net.Sockets.UdpClient
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7)
$UdpClient.Send($MagicPacket,$MagicPacket.Length)
$UdpClient.Close()
If configured correctly, the remote computer should wake up.
UDP port 9
) at the network L3 switch or router level.To wake up computers remotely, you can use the free Windows tool WakeMeOnLan from NirSoft. This tool allows you to scan your LAN and find all available devices, or you can manually add devices that you want to turn on remotely using WakeOnLan.
WakeMeOnLan supports command line mode. Run the following command to wake up the remote device by its IP address. The tool will automatically resolve the IP address to the MAC according to the arp
table:
WakeMeOnLan.exe /wakeup 192.168.13.115
Or enter its MAC address:
WakeMeOnLan.exe /wakeup 04-7C-16-DA-CA-63
You can also use WoL tools on smartphones. For example, Wake On LAN for Android. To start your computer remotely, connect to the same LAN via a Wi-Fi hotspot (access point).
Run powercfg.cpl
and navigate Choose what the power buttons do -> Change settings that are currently unavailable -> uncheck the option Turn on fast startup (recommended).
1 comment
Great guide thank you very much! Worked first time