0

I'm trying to connect from a laptop, through a VPN, and a 3G modem/router, to a remote PC / computer.

PC (192.168.1.33)
   |
3G Modem (192.168.1.22)  
   |
[3G internet, connecting to VPN]
   |
Modem VPN IP (192.168.0.3)


My laptop on VPN: 192.168.0.2

Under normal circumstances, the PC has its gateway set to 192.168.1.22, and I am able to connect from my laptop to the PC through the VPN and 3G modem. However I forgot to set up the gateway on the PC this time, and I cannot connect to it. The PC is very far away and not accessible, so I can't physically log in and change the gateway.

Is there another way to get through to the PC, by adding some sort of 'iptables' route in the modem, to give me access to RDP or VNC? The only access I have is telnet access to the modem. I need to be able to connect from my laptop to the remote PC via RDP or VNC.

Thanks for any ideas.

PS: this is the current port forwarding setup I have on the modem router

# port 3389 PC (RDP)
iptables -A PREROUTING -t nat -i ppp0 -p tcp --dport 3389 -j DNAT --to 192.168.1.33:3389
iptables -A FORWARD -p tcp -d 192.168.1.33 --dport 3389 -j ACCEPT
Rhett
  • 1
  • 1
  • I have solved this problem using POSTROUTING and SNAT. I will post the answer another day when I am back at work. – Rhett Jul 06 '14 at 02:32

1 Answers1

1

The remote PC needs a default gateway in order to access anything beyond it's local network or for anything beyond it's local network to access it. There's no way for you to remotely connect to the remote PC in order to set it's Default Gateway without it having a Default Gateway set, so you're in a bit of a catch-22.

If you can access another computer on the PC's local network you could then connect to the remote PC via that computer in order to set the Default Gateway on the remote PC.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171