i'vr try all possible port... :/
Since there are 65,535 ports, I'm skeptical that you've actually tried them all :p
Let's go through this point by point and make sure we're not forgetting anything:
- Can you wake up your server from within your LAN? In other words, have you confirmed that your server is configured correctly for WoL magic packets?
- Have you confirmed that the client/utility you are using from the remote location sends working WoL packets? In other words, have you successfully woken up your server using the utility you are using in the remote location?
With 1 and 2 taken care of, we know that the problem is something related to the network in between the server and the remote client, and not the server configuration or the WoL utility. As a follow up, what kind of router do you have?
We need to check the following:
- There is a route between the remote client and the server.
- Data can be sent from the remote client to the server.
- WoL packets can be sent from the remote client to the server.
The first two can be taken care of easily: open port 22 for SSH, then SSH to your FreeNAS server. If you can connect, you know that everything is working well. If you can't connect, this may be your first indication that your ISP is blocking traffic. Change the SSH port (
https://doc.freenas.org/9.3/freenas_services.html#ssh) to something in the registered or dynamic range (
https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers), forward that port, and try to SSH in again (making sure to point your SSH client at the new port).
If you are able to SSH to your server, then you know that you're able to connect successfully to the server over the internet. If you were blocked at port 22, your ISP is definitely blocking port. If they are aggressively blocking, they may actually be blocking most if not all of the "well-known" ports. In that case, you'll need to using a registered port or a dynamic port to make WoL work.
Now, get a WoL monitor program working on your PC (make sure to test it from your LAN). Forward a port to it, and then try to wake it remotely. If you get the magic packet, you should be good to go. If not, you'll need to check your network configuration.
FYI, you don't need the same port internal/external for port forwarding. You could forward external port 12345 to internal port 123, for example. Also, I noticed this comment on the Depicus page (
https://www.depicus.com/wake-on-lan/wake-on-lan-port-numbers.php):
If you wish to use Wake On Lan over the internet you will need to set up your destination firewall/router to allow "Subnet Directed Broadcasts". Most routers and firewalls disable this option by default.
Hopefully this helps.