![]() 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. For Wake-on-LAN via the network, the TeamViewer ID of a computer via which the computer is to be wakened must be entered in the TeamViewer Wake-on-LAN options.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. Click OK.Īfter the above configuration, you can now launch a third-party WOL software on PC B and send a Magic Packet to boot up PC A.The port to send the magic packet to. However, it’s safe to assume that no ports have been forwarded. Then you need to do it again using UDP, which is even more complicated. Specify the internal server IP as 192.168.0.100, which is the IP address of PC A. You need to listen on all ports and someone on the Internet needs to try and connect to all ports. Specify the external port and internal port as 7, which is used to receive Magic Packets. Specify the WAN port according to the network environment. Click OK.Ĭhoose the menu Transmission > NAT > Virtual Servers and click to load the following page. Enter the IP address and MAC address of PC A. If there is not a desired entry, click to load the following page. Check if the desired IP address is reserved for PC A. Click OK.Ĭhoose the menu Network > LAN > Address Reservation to load the following page. Enable Export to DHCP Address Reservation. In the IP-MAC Binding List section, click to load the following page. In the Scanning Result section, click the corresponding to bind MAC and IP address of PC A.Ĭhoose the menu Firewall > Anti ARP Spoofing > IP-MAC Binding to load the following page. Wait a minute until the scanning is completed. In the general section, specify the scanning IP range according to the DHCP address pool. If the desired entry is in the list, click the corresponding to bind MAC and IP address of PC A.Ĭhoose the menu Firewall > Anti ARP Spoofing > ARP Scanning to load the following page. There are three methods to do IP-MAC binding: bind in the ARP list, bind in ARP scanning result, or add IP-MAC Binding list entry manually.Ĭhoose the menu Firewall > Anti ARP Spoofing > ARP List to load the following page. To achieve this requirement, you can configure the router as follows:Īfter you complete the configuration, you can use a WOL software to wake up PC A on PC B.įollow the steps below to configure the router. Make sure the WAN port of the router is routable from PC B. ![]() PC A should be powered off normally and the power supply is normal.In network card properties configuration of PC A, allow the network card to wake up the PC, forbid the PC to turn off the network card to save power, and enable Wake on Magic Packet. Make sure that the network card of PC A supports WOL.In BIOS setup of PC A, enable Power On By PCIE or Wake Up On LAN. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |