S
S
sudo rm -rf /2019-07-02 12:00:20
SSH
sudo rm -rf /, 2019-07-02 12:00:20

Wake-on-LAN on a gray network? SSH?

I'll give you the gist.
I'm leaving town. With a laptop.
At home there is a PC and a Router.
It should be possible to access the PC at any time.
5d1b21c0809fc898417805.png
There are two problems:

  1. access a PC from the Internet behind two NATs;
  2. start the PC remotely via WOL.

Separately, the problems are easily solved.
The first is the purchase of a VDS (for various needs) + 2 + 1 SSH tunnels:
  1. PC -> -R 127.1:N:127.1:22 -p 443 -> VDS
  2. Notebook -> -L 127.1:N:127.1:N -p 443 -> VDS

Through this bike, you can throw other tunnels with ports in the right amount.
The second problem would be solved, for example, by connecting a PC to a router via a twisted pair cable (since WOL does not support a wifi adapter and a router), and then "according to tutorials".
However! The provider issues gray IP. Random Wi-Fi - too.
And in order to wake up the PC and gain access to it, you need a device that is able to raise Tunnel No. 1 on some event (powering it up | opening a specific port on VDS | etc.) + connected to the PC via a twisted pair cable + connected to the router via regular WiFi.
And this is where I don't know how to proceed.
Who faced such problems?
Suggest solutions. Share wisdom.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin ™, 2019-07-02
@MaxLevs

I have a similar problem solved in this way:
1) I bought a VDS with a white IP, an openvpn server is installed there.
2) Home router with Openwrt. It has an openvpn client configured that connects to the VDS. Wakeonlan is also installed to wake up computers over the local network. The router is always accessible via openvpn. To computers behind a router - through an ssh tunnel.
3) There is one PC for which wakeonlan works crookedly, but there is no desire to change hardware. For him, he invented a crutch based on esp6288 and a relay. The relay is connected in parallel with the Power button on the system unit. ESP-easy firmware is loaded on esp6288, connection to my wifi network and static IP is configured (in my example 192.168.1.105). The relay is connected to GPIO pin 12 and is disabled by default.
There is a power_on.sh script on the router

wget -qO /dev/null http://192.168.1.105/control?cmd=GPIO,12,1
sleep 1
wget -qO /dev/null http://192.168.1.105/control?cmd=GPIO,12,0

As you can see, the script turns on the relay, waits for a second, and then turns off the relay. This action emulates pressing the Power button. The system unit turns on and works fine. I turn off the PC already through the console using shutdown -h now.

S
Saboteur, 2019-07-02
@saboteur_kiev

Well, at least you should have admin access to the router in your apartment. If this is a provider's router, then it's sad, but it shouldn't be a problem to set up the distribution of a static address tied to a MAC. Well, yes, go to the cable.
Gray IP is more problematic. There are two options - the provider must have a "static IP" service, which usually means both a static IP and a white IP at once. Specify, it should not be too expensive - in any case, cheaper than VDS.
Well, if you choose a solution with VDS - if you have admin access to the router, then on average routers it is now possible to set up a VPN tunnel.
In summary, it all boils down to two questions:
1. What access do you have to the router, is it possible to get it, is it possible to agree with the provider's administrator to make the settings you need. Or just buy yourself a normal router and administer it.
2. Buy a static/white IP service from your ISP

D
Dmitry, 2019-07-02
@q2digger

Well... look. you can make a script on your computer that would check for a VPN connection and if it is not there, it would raise a tunnel to your VDS.
On the other hand, you can already connect to this VDS ..
Or even easier - pick up TeamViewer on your home and connect to it whenever you want, from where you want. If only the Internet was on both sides.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question