![]() ![]() # nmcli c modify "wired1" 802-3-ethernet.wake-on-lan magic # nmcli c show "wired1" | grep 802-3-ethernet.wake-on-lan 802-3-ethernet.wake-on-lan: defaultĮnable Wake-on-LAN by magic packet on that connection: Wired1 612e300a-c047-4adb-91e2-12ea7bfe214e 802-3-ethernet enp0s25īy following, one can view current status of Wake-on-LAN settings: One way to enable Wake-on-LAN by magic packet is through nmcli.įirst, search for the name of the wired connection: NetworkManager provides Wake-on-LAN ethernet support. etc/netctl/ profile ExecUpPost='/usr/bin/ethtool -s interface wol g' NetworkManager ![]() If using netctl, one can make this setting persistent by adding the following the netctl profile: First, make sure cron is enabled, and then edit a crontab for the root user that contains the following /usr/bin/ethtool -s interface wol g The $name placeholder will be replaced by the value of the NAME variable for the matched device.Ī command can be run each time the computer is (re)booted using in a crontab. etc/udev/rules.d/ les ACTION="add", SUBSYSTEM="net", NAME="en*", RUN+="/usr/bin/ethtool -s $name wol g" Otherwise, NAME would be undefined and the rule would not run. The file name is important and must start with a number between 81 and 99 so that it runs after les, which renames interfaces with predictable names. The following rule will turn on WOL on all network interfaces whose name matches en*. Udev is capable of running any command as soon as a device is visible. This is an equivalent of previous systemd.link option, but uses a standalone systemd Īlternatively install the wol-systemd AUR package, then activate this new service by starting rvice. In the Match section, OriginalName= can also be used to identify the interface.This configuration applies only to the link-level, and is independent of network-level daemons such as NetworkManager or systemd-networkd.To be considered, the file name should alphabetically come before the default 99-default.link.The content of the default link file /usr/lib/systemd/network/99-default.link shipped with systemd has to be included, otherwise the interface might be misconfigured. Only the first matching file is is applied.Add this line last in the file: hass ALL=NOPASSWD:/usr/sbin/pm-suspend, where you replace hass with the name of your user on the target, if different, and /usr/sbin/pm-suspend with the command of your choice, if different. On the target, using an account with sudo access (typically your main account), sudo visudo.On my system, this is /usr/sbin/pm-suspend. First, get the full path: which pm-suspend. Here is it pm-suspend, use poweroff to turn off the computer. On the target, we need to let the hass user execute the program needed to suspend/shut down the target computer.On the server, verify that you can reach your target machine without password by ssh TARGET.Enter the password you created in step 3. On the server, transfer your public SSH key by ssh-copy-id where TARGET is your target machine’s name or IP address.If you do, you can leave out in the SSH commands below. It’s recommended using the same user name as on the server. Just press enter on all questions except password. On the target, create a new account that Home Assistant can ssh into: sudo adduser hass.On the server, create SSH keys by running ssh-keygen.On the server, log in as the user account Home Assistant is running under.Suggested recipe for letting the turn_off script suspend a Linux computer (the target)įrom Home Assistant running on another Linux computer (the server). Here are some real-life examples of how to use the turn_off variable. ![]()
0 Comments
Leave a Reply. |