17
submitted 2 months ago by coffelov@lemmy.ml to c/selfhosted@lemmy.world

So i dont know what im doing wrong. I have 3 interfaces on opnsense

1:Server=192.168.40.0 2:Wlan=192.168.20.0 3:wireguard=192.168.60.0

And lastly the Wan with its default configuration.

I want to be able to Send a WOL packet though the Wlan network to wake up my PC that is inside Server network.

In Firewall>rules>Wlan I made a new rule like this: Action=Pass Interface=Wlan Direction=in TCP/IP=ipv4 Protocol=UDP Source=any Destination=Server address Destination port range=from 7 to 7

When i try sending a wol signal when my pc went to sleep a few minutes later i think the firewall rule goes though, but when i try to send from another device after lots of time later it doesn't go though i think.

Im using Moonlight to send its signal, does anyone have been thought this problem. Thank you

top 9 comments
sorted by: hot top controversial new old
[-] CondorWonder@lemmy.ca 11 points 2 months ago

WoL packets are usually sent to the ip broadcast address for the network as they’re not ip based. I don’t know if this would ever work well across networks. Can you do send the wol packet from the opnsense router instead? Does it work then?

If you’re sending it to the IP of the server, it likely works soon after your turn the machine off because the ARP entry hasn’t timed out yet, but once it times out it won’t work anymore. The router doesn’t know how to get to the machine. You may be able to add a static arp mapping to get it to work long term.

[-] coffelov@lemmy.ml 2 points 2 months ago

Never heard of that phrase ARP thanks i will look into that

[-] coffelov@lemmy.ml 3 points 2 months ago

Update: I have installed the wol plugin from opnsense into my machine, you asked if i can send a wol packet though the router and so in my thinking i was able to do it via the plugin. The problem starts on the ARP, i found what it is and what it do but i dont know how i can insert the MAC address into the firewall rule that i created above, if you dont mind could you help me on how can i do it? And if i do that will i be able to send the wol signal though the Wlan or Wireguard in the future? Thanks

[-] CondorWonder@lemmy.ca 1 points 2 months ago

From a Linux command line it would be the command called arp, you need to add a static arp entry. I don’t know how that works on sense, but on Linux it would be something like arp -s IP MAC

Maybe there’s a module in opnsense to help. The way I’ve done this before is using a machine connected to the same network at my target to wake up by logging into that machine and issuing the wake command.

[-] magikmw@lemm.ee 3 points 2 months ago

There is a trick you could do to send a WoL packet to a separate IP on the sender network and modify it so it is repreated on the network of the machine you want to wake up.

I can't find docs on thisb on mobile, but can look for it later.

It can't work like a typical IP packet routing tho. I've only made it work with a VPN connection.

Another thing you can do is ssh to your router and send a WoL packet from there on the machine's LAN.

[-] coffelov@lemmy.ml 3 points 2 months ago

If you can share that trick it would be great!!. Preferably i would like to use the Moonlight client wol signal but if can't, i can think of doing a script in the termux android app to send the packet

[-] magikmw@lemm.ee 4 points 2 months ago* (last edited 2 months ago)

I think this lead me on the right path: https://community.ui.com/questions/Having-trouble-allowing-WOL-fowarding/5fa05081-125f-402b-a20c-ef1080e288d8#answer/5653fc4f-4d3a-4061-866c-f4c20f10d9b9

This is for edgerouter, which is what I use, but I suppose opensense can do this just as well.

Keep in mind, don't use 1.1.1.1 for your forwarding address, use one in your LAN range, just outside of DHCP because this type of static routing will mess up a connection to anything actually on this IP.

This is how it looks in my edge os config:

protocols {
  static {
    arp 10.0.40.114 {
      hwaddr ff:ff:ff:ff:ff:ff
    }
  }
}

10.0.40.114 is the address I use to forward WoL broadcast to.

Then I use an app called Wake On Lan on Android and set it up like this: Hostname/IP/Broadcast address: 10.0.40.114 Device IP: [actual IP I want to wake up on the same VLAN/physical network] WOL Port: 9

This works fine if you're using the router as the gateway for both VPN and LAN, but it will get messy with masquarade and NAT - then you have to use port forwarding I guess, and it should work from WAN.

I just wanted it to be over VPN to limit my exposure (even if WoL packets aren't especially scary).

[-] coffelov@lemmy.ml 4 points 2 months ago

Thank you, i will try doing it on opnsense

[-] Decronym@lemmy.decronym.xyz 1 points 2 months ago* (last edited 2 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
ARP Address Resolution Protocol, translates IPs to MAC addresses
DHCP Dynamic Host Configuration Protocol, automates assignment of IPs when connecting to a network
IP Internet Protocol
NAT Network Address Translation
VPN Virtual Private Network

5 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.

[Thread #706 for this sub, first seen 23rd Apr 2024, 10:55] [FAQ] [Full list] [Contact] [Source code]

this post was submitted on 23 Apr 2024
17 points (100.0% liked)

Selfhosted

37809 readers
454 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS