I have very far physical PC running on W10 that sits behind a 4G router (teltonika Rut955) with public IP. The rut955 has a running and configured OpenVPN server that I was using to access the PC with TightVNC through the VPN.
The original LAN configuration was:
Rut955: 192.168.2.1 255.255.255.0
PC: 192.168.2.3 255.255.255.0
The OpenVPN server was running on with the push route option set to 192.168.2.0 255.255.255.0. So I could connect through VPN to the PC.
As thightVNC was the ONLY way to access that PC I was trying to set another one, SSH. And as my skills with windows admin are so low I was trying to set a WSL2 and place inside it the SSH server that will allow me to manage files inside the PC.
Once I had debian installed on WSL2 I noticed that the WSL instance didn't have internet connectivity and it wasn't directly accessible neither, instead the W10 was running as router/nat for the WSL. In order to make WSL directly accessible I followed this:
And here are were problems start. Instead of clicking into the pyshical adapter and share it with vEthernet (WSL) I did it the other way around. I clicked on vEthernet (WSL) adapter and in "Home networking connection" I entered my physical ethernet connection. I was stressed and didn't read carefully, so I'm not 100% sure but I think so.
After that, popup appeared telling that the address was going to change to 192.168.137.1. As I was making changes on the vEthernet (WSL) adapter and not the physical one I clicked continue because I thought it was referring to the WSL address. It wasn't. I lost connectivity instantaneously.
After that I changed the rut955 ip to 192.168.137.100/24 and changed the push option on the OpenVPN server to 192.168.137.100/24. But no ping through the VPN. I supose because the PC has no gateway configured.
If I ssh into the Rut955 I can ping the PC. Also, if I scan the network through Rut955 GUI, there it is the W10 PC.
192.168.137.1
XX:XX:XX:XX:XX:XX
DESKTOP-9V9NTVH
Then I proceed to forward all the ports from the router wan to the PC and tried to vnc to the public rut955 IP. That fails too.
How can I recover my vnc connectivity to the W10 PC?
EDIT for @user1686 answer:
Thanks for your answer. I'm not an expert at all in networking so I have been reading about your answer for a while on the internet.
For the option A: I don't know if I have understood your answer correctly but 192.168.137.1 isn't the Rut955 IP but the current PC IP. I had already forwarded through the Rut955 GUI the wan port 5900 (the vnc port, tried also with 0:65535) to the the PC ip (192.168.137.1:5900).
I have studied it deeper and seems that the router GUI works on top of iptables. I have never worked with iptables directly but doing a little bit of research iptables -t nat -L
returns:
DNAT tcp -- anywhere anywhere tcp dpt:5900 /* emergency */ to:192.168.137.1:5900
DNAT udp -- anywhere anywhere udp dpt:5900 /* emergency */ to:192.168.137.1:5900
So it seems that the router GUI creates DNAT. Should I replace it with a SNAT? Also I'm not sure at all between what IP's I should do the SNAT...
For the option B: Excuse my ignorance, but does this solution works if there is no SSH server on the PC? Actually, there is one, openSSH for windows, but the only windows user that exists has empty password...