{"id":47062,"date":"2024-08-19T15:04:05","date_gmt":"2024-08-19T15:04:05","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=47062"},"modified":"2025-06-16T07:37:14","modified_gmt":"2025-06-16T07:37:14","slug":"enable-wake-on-lan-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2024\/08\/enable-wake-on-lan-ubuntu\/","title":{"rendered":"Enable Wake-on-LAN to Wake up (or Boot) Ubuntu 24.04 Remotely"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-47063\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/cpu-power-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This is a step by step guide shows how to enable Wake-on-LAN feature in Ubuntu, so you can wake it up from suspend, hibernation, or shutdown state remotely using another computer or mobile phone.<\/p>\n<p>Wake on LAN, WoL in short, is a protocol allows computer to be turned on or waked up from sleep using network message. It&#8217;s based on AMD&#8217;s Magic Packet Technology, and also known as <b>wake on WAN<\/b>, <b>remote wake-up<\/b>, <b>power on by LAN<\/b>, and <b>resume by LAN<\/b>.<\/p>\n<p>WoL uses wired network on target computer for the communication. Though, there&#8217;s also <b>Wake on Wireless LAN (WoWLAN)<\/b> allowing to wake up wirelessly.<\/p>\n<p><!--more--><\/p>\n<h3>Requirements:<\/h3>\n<p>This tutorial is tested on Ubuntu 24.04 LTS, though it should work on all current Ubuntu releases, as well as many other Linux distributions.<\/p>\n<p>Before getting started, you need:<\/p>\n<ul>\n<li>Motherboard and Network interface card that support Wake on LAN.<\/li>\n<li>Keep the target computer or laptop <b>connected with network cable.<\/b> Some wireless network cards do support WowLAN, and I&#8217;ll show you how to enable the feature below, however, it does NOT wake in my case on WiFi.<\/li>\n<\/ul>\n<h3>Step 1: Enable Wake on LAN in BIOS settings<\/h3>\n<p>First, start or restart your computer. During the startup process, press a specific key (<code>F1<\/code> ~ <code>F12<\/code>, <code>Esc<\/code>, or <code>Del<\/code> depends on your device) to enter BIOS.<\/p>\n<p>Configure following options in BIOS:<\/p>\n<ul>\n<li>Enable <b>Wake-on-LAN<\/b>. The name may vary depends on motherboard manufacturers. It can also be &#8220;PCI Power up&#8221;, &#8220;Allow PCI wake up event&#8221;, or &#8220;Boot from PCI\/PCI-E&#8221;.<\/li>\n<li>Disable <b>ErP<\/b> mode if exist. It&#8217;s designed to save even more power when in power-off state. Which however prevent WoL to work properly.<\/li>\n<li>Enable USB power or similar option. In my ThinkPad, I have to enable &#8220;Always on USB&#8221; and &#8220;Charge in Battery Mode&#8221; &#8211; charge external device when system is in hibernate or power-off state and in battery mode. Or, it won&#8217;t wake up from hibernate or shutdown when on battery.<\/li>\n<\/ul>\n<p><b>NOTE: After this step, network interface card still has power when computer is in power-off state. This may cause battery draining problem on some laptops.<\/b><\/p>\n<div id=\"attachment_47064\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-47064\" class=\"size-large wp-image-47064\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-700x373.webp\" alt=\"\" width=\"610\" height=\"325\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-700x373.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-300x160.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-768x410.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-1536x819.webp 1536w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol-1320x704.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/thinkpad-wol.webp 1650w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><p id=\"caption-attachment-47064\" class=\"wp-caption-text\">ThinkPad BIOS settings for Wake on LAN<\/p><\/div>\n<h3>Step 2: Enable Wake on LAN in Ubuntu<\/h3>\n<p>After enabled the feature in BIOS, you also have to configure your operating system for it to work. As far as I know, there are graphical option and few command line tools to do the job in Ubuntu Linux.<\/p>\n<h4>Option 1: Use Network Connection Editor (Graphical Way)<\/h4>\n<p>If your run the target computer with Ubuntu Desktop, then the thing is super easy by using the built-in network connections editor tool. However, it works only for the wired network!<\/p>\n<p>First, search for and launch &#8220;Advanced Network Configuration&#8221; from system start menu or GNOME overview depends on your desktop environment.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/launch-nm-connection-editor.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-47065\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/launch-nm-connection-editor.webp\" alt=\"\" width=\"527\" height=\"286\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/launch-nm-connection-editor.webp 527w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/launch-nm-connection-editor-300x163.webp 300w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/a><\/p>\n<p><i>Tips: for choice you may run <code>nm-connection-editor<\/code> command to start the tool from command line.<\/i>.<\/p>\n<p>When it opens, double click to edit the wired network connection. Finally, enable &#8220;<b>Magic<\/b>&#8221; option for Wake on LAN under Ethernet tab, and Save.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47066\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic-700x590.webp\" alt=\"\" width=\"610\" height=\"514\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic-700x590.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic-300x253.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic-768x647.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nm-con-editor-magic.webp 908w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Option 2: use nmcli command-line tool<\/h4>\n<p>For choice, the <code>nmcli<\/code> command line configuration tool for Network Manager can also do the job for both wired and wireless connections.<\/p>\n<p><b>1.<\/b> First, open terminal (Ctrl+Alt+T) and run command to show all the network connections:<\/p>\n<pre>nmcli connection show<\/pre>\n<p>As the screenshot below shows you, I have the wired network device connected to &#8220;netplan-enp0s31f6&#8221;, and wifi network device connected to &#8220;elite01&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47068\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-700x302.webp\" alt=\"\" width=\"610\" height=\"263\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-700x302.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-300x130.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2.<\/b> Then, run the last command follow with a network connection name (&#8220;netplan-enp0s31f6&#8221; or &#8220;elite01&#8221; in my case) to check its configurations.<\/p>\n<p>For example, run the command below in my case, will show the configurations about the wired network connection (replace <code>netplan-enp0s31f6<\/code> to yours).<\/p>\n<pre>nmcli connection show \"netplan-enp0s31f6\" |grep 802<\/pre>\n<p>While <code>|grep 802<\/code> filter out the part that I need for info about Wake on Lan.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-ethernet.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47069\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-ethernet-700x525.webp\" alt=\"\" width=\"610\" height=\"458\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-ethernet-700x525.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-ethernet-300x225.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-show-ethernet.webp 746w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3.<\/b> As the last screenshot shows you, &#8220;802-3-ethernet.wake-on-lan&#8221; is the key config option for enable WoL for this connection.<\/p>\n<p>The key value is usually &#8220;default&#8221;. We have to <strong>set it to &#8220;magic&#8221;<\/strong> to make it work (replace <code>netplan-enp0s31f6<\/code> to yours).<\/p>\n<pre>nmcli connection modify \"netplan-enp0s31f6\" 802-3-ethernet.wake-on-lan magic<\/pre>\n<p>Also, set &#8216;802-3-ethernet.auto-negotiate&#8217; to yes which may help if network adapter is powered off on shutdown.<\/p>\n<pre>nmcli connection modify \"netplan-enp0s31f6\" 802-3-ethernet.auto-negotiate yes<\/pre>\n<p>(<b>For WoWLAN<\/b>) If you&#8217;re trying to enable Wake on WiFi, then use following commands instead (replace &#8216;elite01&#8217; with yours wifi network connection name):<\/p>\n<ul>\n<li>Check the config options:\n<pre>nmcli connection show \"elite01\" |grep 802<\/pre>\n<\/li>\n<li>Set the &#8220;802-11-wireless.wake-on-wlan&#8221; option to &#8220;magic&#8221;:\n<pre>nmcli connection modify \"elite01\" 802-11-wireless.wake-on-wlan magic<\/pre>\n<\/li>\n<li>Disable WiFi power autosave feature:\n<pre>nmcli connection modify \"elite01\" 802-11-wireless.powersave disable<\/pre>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47070\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi-700x512.webp\" alt=\"\" width=\"610\" height=\"446\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi-700x512.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi-300x219.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi-768x562.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/nmcli-wifi.webp 882w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Step 3: Trigger WoL on target machine<\/h3>\n<p><b>1.<\/b> To trigger WoL, you need to know the <b>MAC address<\/b> of the network interface in target machine. Just open terminal (<code>Ctrl+Alt+T<\/code>), then run the command below to tell:<\/p>\n<pre>ip link<\/pre>\n<p>Then, copy or write down the mac address (e8:6a:64:d9:d3:66 in my case) for the network device you want to use it to trigger WoL.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/ip-link-mac.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-47071\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/ip-link-mac.webp\" alt=\"\" width=\"666\" height=\"441\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/ip-link-mac.webp 666w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/ip-link-mac-300x199.webp 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/a><\/p>\n<p><b>2.<\/b> Next, install a Wake-on-LAN app in remote computer or mobile phone, then set it up for the target machine.<\/p>\n<ul>\n<li>For Android, iOS, just search &#8216;wake on lan&#8217; in Google Play or App Store. There are quite a few apps to do the job.<\/li>\n<li>For Linux, search for and install the graphical &#8220;<code>gwakeonlan<\/code>&#8221; tool or command line &#8220;<code>wakeonlan<\/code>&#8221; tool from system repository.<\/li>\n<li>Don&#8217;t know any for Windows and macOS, try to search one in system app store.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47072\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan-700x490.webp\" alt=\"\" width=\"610\" height=\"427\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan-700x490.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan-300x210.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan-768x538.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/gwakeonlan.webp 1214w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3.<\/b> Before suspending, shutting down, or hibernating the target computer, you may first test if it can properly receive the message for WoL.<\/p>\n<p>To do so, open terminal (Ctrl+Alt+T) and run the command below in the target Ubuntu computer:<\/p>\n<pre>sudo nc -u -l -p 9<\/pre>\n<p>After typing user password, it sticks at blinking cursor waiting for the remote message.<\/p>\n<p>In the remote computer or mobile phone, once you click &#8220;Boot&#8221; or &#8220;Turn ON&#8221; button to trigger WoL on the target machine, the terminal window should immediately display the message (though unreadable). If nothing happens, then something must be wrong!<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/test-wol.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47073\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/test-wol-700x347.webp\" alt=\"\" width=\"610\" height=\"302\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/test-wol-700x347.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/test-wol-300x149.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2024\/08\/test-wol.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>4.<\/b> If the last step works properly, you can now suspend, hibernate, or shutdown the target computer. Then, try to wake it up using a remote app.<\/p>\n<p><b>NOTE:<\/b> Wake on Wireless LAN only supports waking up from suspend, though I can&#8217;t get it work in my case because WiFi is always turned off on suspend.<\/p>\n<h3>Undo and Disable Wake on LAN<\/h3>\n<p>To undo all the changes, first configure BIOS to disable WoL.<\/p>\n<p>Then open terminal in Ubuntu and run command:<\/p>\n<ul>\n<li>For wired network, use command to disable wake on LAN:\n<pre>nmcli connection modify \"netplan-enp0s31f6\" 802-3-ethernet.wake-on-lan disabled<\/pre>\n<\/li>\n<li>For wireless network, use this one to disable wake on WLAN:\n<pre>nmcli connection modify \"elite01\" 802-11-wireless.wake-on-wlan disabled<\/pre>\n<\/li>\n<\/ul>\n<p>In the commands above, replace <code>netplan-enp0s31f6<\/code> and <code>elite01<\/code> with yours connection names according to <code>nmcli c show<\/code> command output.<\/p>","protected":false},"excerpt":{"rendered":"<p>This is a step by step guide shows how to enable Wake-on-LAN feature in Ubuntu, so you can wake it up from suspend, hibernation, or shutdown state remotely using another computer or mobile phone. Wake on LAN, WoL in short, is a protocol allows computer to be turned on or waked up from sleep using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":47063,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1317,2088],"class_list":["post-47062","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-network","tag-power"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=47062"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/47062\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/47063"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=47062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=47062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=47062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}