WNHN
A universe of 3 locations, each behind NAT router;
Locations 2 and 3 have static IP;
OpenVPN client at location 1, OpenVPN server is at location 2.
I want to connect from location 1 to the VNC service at location 3, using the VPN hop from
location 1 to 2, and passing along a VNC connection request from location 1 via 2 to 3.
The reason is that the VNC server at Location 3 by design accepts connections ONLY from the static IP of location 2, and I want to used the VPN to connect from anywhere I happen to be.
OS:
W7 Laptop at internet location 1 >> W7 openvpn server at internet location 2 >> Windows Vista
VNC server at internet location 3.
Laptop successfully lashes up VPN connection to location 2. Laptop does connect to location 2's
VNC server on the same PC with OpenVPN server.
Now I want to establish VNC connection from laptop to location 3. VNC at Location 3 accepts
connections ONLY from static public IP of location 2.
I Need help setting up routing to accomplish this task.
1 -----vpn------>> 2
1 ---------vnc------->> 3.
-- public -- private
Loc. 1 -- any -- 192.168.0.0/24 (or whatever)
Loc. 2 -- a.b.c.d -- 192.168.102.0/24
Loc. 3 -- w.x.y.z -- 192.168.50.0/24
VPN server config:
;local a.b.c.d
port 10234
;proto tcp
proto udp
;dev tap
dev tun
;dev-node MyTap
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key"
dh "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\dh2048.pem"
server 10.60.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
;server-bridge
push "route 192.168.102.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
;learn-address ./script
;push "redirect-gateway def1 bypass-dhcp"
push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 64.222.165.243"
;push "dhcp-option DNS 64.222.84.243"
;client-to-client
;duplicate-cn
keepalive 10 120
;tls-auth ta.key 0 # This file is secret
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
comp-lzo
max-clients 2
;user nobody
;group nobody
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
;verb 3
verb 5 ;change back to 3 after testing
;mute 20
VPN client config:
client
;dev tap
dev tun
;dev-node MyTap
;proto tcp
proto udp
remote a.b.c.d 10234
;remote 192.168.102.10 10234
;remote my-server-2 1194
;remote-random
;resolv-retry infinite
nobind
;user nobody
;group nobody
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
mute-replay-warnings
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\lapdawg.crt"
key "C:\\Program Files\\OpenVPN\\config\\lapdawg.key"
ns-cert-type server
;tls-auth ta.key 1
;cipher x
comp-lzo
verb 3
;mute 20
server's routing table:
C:\Users\WNHN>route print -4
===========================================================================
Interface List
12...00 ff 94 ee 7c 7b ......TAP-Windows Adapter V9
10...00 13 72 85 56 65 ......Broadcom NetXtreme 57xx Gigabit Controller
1...........................Software Loopback Interface 1
15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
14...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.102.1 192.168.102.10 276
10.60.0.0 255.255.255.0 10.60.0.2 10.60.0.1 30
10.60.0.0 255.255.255.252 On-link 10.60.0.1 286
10.60.0.1 255.255.255.255 On-link 10.60.0.1 286
10.60.0.3 255.255.255.255 On-link 10.60.0.1 286
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.102.0 255.255.255.0 On-link 192.168.102.10 276
192.168.102.10 255.255.255.255 On-link 192.168.102.10 276
192.168.102.255 255.255.255.255 On-link 192.168.102.10 276
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.102.10 276
224.0.0.0 240.0.0.0 On-link 10.60.0.1 286
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.102.10 276
255.255.255.255 255.255.255.255 On-link 10.60.0.1 286
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 192.168.102.1 Default
===========================================================================
C:\Users\WNHN>
Client's routing table:
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.50.1 192.168.50.11 25
0.0.0.0 128.0.0.0 10.60.0.5 10.60.0.6 30
10.60.0.1 255.255.255.255 10.60.0.5 10.60.0.6 30
10.60.0.4 255.255.255.252 On-link 10.60.0.6 286
10.60.0.6 255.255.255.255 On-link 10.60.0.6 286
10.60.0.7 255.255.255.255 On-link 10.60.0.6 286
a.b.c.d 255.255.255.255 192.168.50.1 192.168.50.11 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
128.0.0.0 128.0.0.0 10.60.0.5 10.60.0.6 30
192.168.50.0 255.255.255.0 On-link 192.168.50.11 281
192.168.50.1 255.255.255.255 192.168.50.1 192.168.50.11 25
192.168.50.11 255.255.255.255 On-link 192.168.50.11 281
192.168.50.255 255.255.255.255 On-link 192.168.50.11 281
192.168.102.0 255.255.255.0 10.60.0.5 10.60.0.6 30
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 10.60.0.6 286
224.0.0.0 240.0.0.0 On-link 192.168.50.11 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 10.60.0.6 286
255.255.255.255 255.255.255.255 On-link 192.168.50.11 281
===========================================================================
Persistent Routes:
None