Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    WOL packets across subnets?

    General pfSense Questions
    8
    34
    9.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JKnottJ
      JKnott @dstarr3
      last edited by

      @dstarr3

      WOL is at the Ethernet level, not IP, so routers will not pass it. The best you can hope for is a relay agent, similar to what may be used with DHCP.

      PfSense running on Qotom mini PC
      i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
      UniFi AC-Lite access point

      I haven't lost my mind. It's around here...somewhere...

      1 Reply Last reply Reply Quote 0
      • D
        dstarr3
        last edited by

        Can you go into more detail about that?

        JKnottJ 1 Reply Last reply Reply Quote 0
        • JKnottJ
          JKnott @dstarr3
          last edited by

          @dstarr3 said in WOL packets across subnets?:

          Can you go into more detail about that?

          Not really, as I haven't done that. A relay agent receives the Ethernet frame and transmits it on another network. DHCP relay agents are available with routers from Cisco etc., but I haven't heard of one for WOL. As mentioned above, your only option would be to have WOL originate on pfSense, as it can see all networks.

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Yes you would need some type of relay or proxy. For example:
            https://community.cisco.com/t5/small-business-switches/wake-on-lan-wol-across-different-vlans-on-sg-300-10/td-p/2013610

            I don't think anything included in pfSense by default can do that.

            Steve

            1 Reply Last reply Reply Quote 0
            • jahonixJ
              jahonix
              last edited by

              Come on, WOL is not that complicated and it's well documented.

              • https://en.wikipedia.org/wiki/Wake-on-LAN
              • AMD: Magic Packet Technology Whitepaper Rev. A (1995) (englisch, PDF; 37 kB)

              The "Magic Packet" is sent on OSI L2, usually as UDP to the subnet's broadcast address and might be directed at one of a few ports. I typically use port 7. IMHO p:0 and p:9 work as well.

              So if you are on 192.168.1.0/24 and want to wake a machine on 192.168.2.0/24 you sent the Magic Packet to:
              UDP 192.168.2.255:7
              I did that from a dedicated Crestron control system but have no experience doing so from a phone.

              The Magic Packet itself is darn simple. It is 6x FF followed by 16x the MAC address of the sleeping host. No spaces or whatsoever in between.

              From a mobile phone your best bet might be to use the WOL page of your local pfSense.

              JKnottJ 2 Replies Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Yeah, I just spent a while playing around with things in pfSense to see if I could reply/proxy it without installing anything else. But either I'm missing the right incantation or, quite likely, it is blocked somewhere I'm missing.

                Steve

                jahonixJ 1 Reply Last reply Reply Quote 0
                • jahonixJ
                  jahonix @stephenw10
                  last edited by

                  @stephenw10
                  Where did you sent the Magic Packet from?

                  The rule I was using is pretty simple an allow from host "Control System" to UDP other subnet's broadcast address with destination port :7
                  That's on an ALIX with 2.3.2 nano IIRC, but I doubt things have changed in this regard.

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    I was using the pfSense WoL client which appears to use port 40000 and also doesn't, from the GUI, allow you to specify a target IP.
                    More testing needed obviously... ๐Ÿ˜‰

                    Steve

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      Mmm, yeah it won't forward traffic to the broadcast address and that seems like the correct thing to do.

                      I wonder if that was tightened up since 2.3.X....

                      1 Reply Last reply Reply Quote 0
                      • jahonixJ
                        jahonix
                        last edited by

                        Not necessarily ... that's Subnet Directed Broadcast.

                        Try a translator for this page:
                        https://decatec.de/software/magicpacket-unterstuetzt-nun-wake-lan-andere-subnetze/
                        which features a Windows .exe to WOL in other subnets. I'm on a Mac so it's not for me.

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          Yeah FreeBSD doesn't do that AFAIK and hasn't for some time.

                          As of March 2007, FreeBSD 7.0 WILL NOT forward directed broadcasts to directly attached local networks.
                          This behaviour is compliant with RFC 2644. 
                          

                          Unless I'm misreading that. It is late here and I lost an hour of sleep last night! ๐Ÿ˜‰

                          But that's the behaviour I'm seeing.

                          [2.4.4-RELEASE][root@7100.stevew.lan]/root: wol -i 192.168.126.255 -p 9 00:0e:8e:24:cd:0a
                          Waking up 00:0e:8e:24:cd:0a...
                          

                          That packet arrives at the pfSense interface the 7100 is in but never leaves the 192.168.126.X interface.
                          It is passed by the firewall rules and opens states but only on the incoming interface.

                          Running that same command on the firewall between the subnets wakes the client as expected.

                          Steve

                          jahonixJ 1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by stephenw10

                            Wow horrendous workaround here: https://forum.netgate.com/post/525988 ๐Ÿ˜จ

                            Haven't tried that. Not going to!

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              Mmm, just to confirm attempting to send those increments the counter packets not forwardable shown in netstat -s -p ip.

                              I can't see any way to enable forwarding directed broadcasts either.

                              This is the expected, and correct, behaviour as far as I can see.

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • JKnottJ
                                JKnott @jahonix
                                last edited by

                                @jahonix said in WOL packets across subnets?:

                                Come on, WOL is not that complicated and it's well documented.

                                From that link:

                                "it could be sent as any network- and transport-layer protocol, although it is typically sent as a UDP datagram to port 0,[6] 7 or 9, or directly over Ethernet as EtherType 0x0842."

                                Take a look at what's sent on the wire, using Packet Capture or Wireshark. If it's bare Ethernet, then it definitely won't be routed. If UDP, with a broadcast address, then you'll have to figure out how to get pfSense to route it to the correct interface, when there's no network address to route with. There's a reason why broadcasts are not routed.

                                BTW, when I used WoL, a few years back, it was bare Ethernet.

                                PfSense running on Qotom mini PC
                                i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                                UniFi AC-Lite access point

                                I haven't lost my mind. It's around here...somewhere...

                                1 Reply Last reply Reply Quote 0
                                • JKnottJ
                                  JKnott @jahonix
                                  last edited by

                                  @jahonix said in WOL packets across subnets?:

                                  The "Magic Packet" is sent on OSI L2, usually as UDP

                                  UDP is layer 4. IP is 3 and Ethernet, 2.

                                  PfSense running on Qotom mini PC
                                  i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                                  UniFi AC-Lite access point

                                  I haven't lost my mind. It's around here...somewhere...

                                  jahonixJ 1 Reply Last reply Reply Quote 0
                                  • jahonixJ
                                    jahonix @stephenw10
                                    last edited by

                                    @stephenw10 said in WOL packets across subnets?:

                                    Yeah FreeBSD doesn't do that AFAIK and hasn't for some time.
                                    ...
                                    It is late here and I lost an hour of sleep last night! ๐Ÿ˜‰

                                    Strange, I have it working this way, client uses is frequently with this video switcher.

                                    Don't worry about your sleep, same with me. Just 1 hour ahead... ๐Ÿ˜‰

                                    1 Reply Last reply Reply Quote 0
                                    • jahonixJ
                                      jahonix @JKnott
                                      last edited by

                                      @JKnott said in WOL packets across subnets?:

                                      @jahonix said in WOL packets across subnets?:

                                      The "Magic Packet" is sent on OSI L2, usually as UDP

                                      UDP is layer 4. IP is 3 and Ethernet, 2.

                                      Correct, I was wondering how long I could get away with writing it this way. ๐Ÿ˜‡
                                      I am using a UDP frame directed at the other subnet's broadcast address as mentioned before. No need to wireshark. And I'm not there often anymore.

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        dstarr3
                                        last edited by

                                        Welp, I guess the solution is just to put my WiFi on the same subnet as my LAN. I was hoping to keep them separated, just for the sake of organization, but it's just causing too many problems. Oh well!

                                        1 Reply Last reply Reply Quote 0
                                        • RicoR
                                          Rico LAYER 8 Rebel Alliance
                                          last edited by Rico

                                          I don't get the problem why you need some App when pfSense can do the job.
                                          Just create some User named "wol" or anything you want, give the privileges only to access Services > WOL
                                          pfSense_WOL-User.png
                                          Now when logging in with User "wol" you are redirected to Services > WOL without to need clicking anything in the WebGUI.
                                          Depending on your smartphone/browser you can even save the pfSense Login to your Homescreen and autologin User "wol".
                                          Now you have your selfmade pfSense WOL App and anything working...deal? โ˜บ

                                          -Rico

                                          1 Reply Last reply Reply Quote 0
                                          • johnpozJ
                                            johnpoz LAYER 8 Global Moderator
                                            last edited by

                                            yup @Rico method is how I would do it if ever need such a thing... But just not a fan of wol at all... If you want to get to so something leave it on..

                                            Its just too much of a pain doing wol for a few devices... What cost you like 2 bucks a month to just leave them on..

                                            I could see if you in the enterprise and had 1000 machines going into standby at night and every now and then you wanted to wake them up to do updates or something..

                                            What exactly are you trying to wake up? While your there on the network with your phone? Just go click the button on it ;) Are you in a 15K square foot mansion and can not be bothered to walk from the west wing to the east? Have the butler go hit the space bar ;)

                                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                                            If you get confused: Listen to the Music Play
                                            Please don't Chat/PM me for help, unless mod related
                                            SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                            J 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.