OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Question: Is WOL on demand possible?
« previous next »
  • Print
Pages: [1]

Author Topic: Question: Is WOL on demand possible?  (Read 2475 times)

lewoke

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Question: Is WOL on demand possible?
« on: June 06, 2019, 08:22:18 pm »
Hi,

I'd like to do the following: Opnsense sends a WOL everytime  a client from LAN (own subnet) is requesting access to my home server on OPT1(own subnet).

I know there is the wol plugin but to my knowledge it only allows you to either wake up clients manually or via cron. Any ideas?

Logged

fabian

  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Question: Is WOL on demand possible?
« Reply #1 on: June 07, 2019, 06:31:19 pm »
your server can call the same API the frontend is using to send the packet.
Logged

qinohe

  • Full Member
  • ***
  • Posts: 160
  • Karma: 19
    • View Profile
Re: Question: Is WOL on demand possible?
« Reply #2 on: June 07, 2019, 08:40:05 pm »
@fabian, I'm curious how to do that are there examples anywhere?

@OP, you could use a script, untested, should work though, at least I think so  :P
Code: [Select]
#!/bin/sh

MAC='00:11:22:33:44:55'
IP='192.168.10.100'
ARP=$(arp "$IP"|awk '{print $4 $5}')

[ "$ARP" = noentry ] && wol -i "$IP" "$MAC" || exit
exit 0

edit: @fabian, NVM I found the examples in the wiki, I now need to figure out how to use them  :D
« Last Edit: June 07, 2019, 10:33:56 pm by qinohe »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Question: Is WOL on demand possible?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2