I struggled getting this to work, hopefully this helps somebody else out.
I followed the advice in this thread to get it to work but was a little confused: https://www.reddit.com/r/mikrotik/comme ... _solution/
Step .1 - Ensure that your WoL works (I had to enable mine in the bios) by going to the Mikrotik gui and selecting tools > WoL, select the VLAN that the device you want to wake up is on and input the MAC address and confirm that the router is able to turn your device on.
For this example let's assume that your Home Assistant IP address is 192.168.0.1/24 and the device that you want to wake up is 172.16.0.1/24
1. You need to make a static ARP entry on the Mikrotik, (go to IP > ARP in the gui) go to Add New and you are going to select an avaialble IP address on your device subnet so let's use 172.16.0.254 and for the MAC address use FF:FF:FF:FF:FF:FF and assign the interface to your VLAN / subnet interface. Ensure Enabled is checked and Published is unchecked
2. Ensure that that traffic is able to flow from 192.168.0.1 to 172.16.0.1 for destination port 9 type UDP in the firewall
3. In Home Assistant add the line "wake_on_lan:" without quotes to your configuration.yaml and then reboot Home Assistant (Developer Tools > Restart > Restart Home Assistant)
4. Go to Settings > Devices & Services > Helpers (tab at top) > Create Helper > Button and then give it a name (Wake up Computer) and Icon
5. Create a new automation (Settings > Automamtions > Create Automation. For the Trigger select device state and then select your new button. For action select 'Call Service' and for the service select Wake on LAN: Send Magic Packet. Input your device's MAC and for broadcast address use 172.16.0.254 and then test
This worked for me and I did not need to create a dstnat rule, good luck!
I followed the advice in this thread to get it to work but was a little confused: https://www.reddit.com/r/mikrotik/comme ... _solution/
Step .1 - Ensure that your WoL works (I had to enable mine in the bios) by going to the Mikrotik gui and selecting tools > WoL, select the VLAN that the device you want to wake up is on and input the MAC address and confirm that the router is able to turn your device on.
For this example let's assume that your Home Assistant IP address is 192.168.0.1/24 and the device that you want to wake up is 172.16.0.1/24
1. You need to make a static ARP entry on the Mikrotik, (go to IP > ARP in the gui) go to Add New and you are going to select an avaialble IP address on your device subnet so let's use 172.16.0.254 and for the MAC address use FF:FF:FF:FF:FF:FF and assign the interface to your VLAN / subnet interface. Ensure Enabled is checked and Published is unchecked
2. Ensure that that traffic is able to flow from 192.168.0.1 to 172.16.0.1 for destination port 9 type UDP in the firewall
3. In Home Assistant add the line "wake_on_lan:" without quotes to your configuration.yaml and then reboot Home Assistant (Developer Tools > Restart > Restart Home Assistant)
4. Go to Settings > Devices & Services > Helpers (tab at top) > Create Helper > Button and then give it a name (Wake up Computer) and Icon
5. Create a new automation (Settings > Automamtions > Create Automation. For the Trigger select device state and then select your new button. For action select 'Call Service' and for the service select Wake on LAN: Send Magic Packet. Input your device's MAC and for broadcast address use 172.16.0.254 and then test
This worked for me and I did not need to create a dstnat rule, good luck!
Statistics: Posted by cpeshalelimpix — Sat Mar 09, 2024 9:56 am