I have three instances created in google cloud platform, one of them hosts a linux system and the other a windows 2012 r2 server, I have already created the vpn tunnel between my client and my linux instance, the question here is what is it I have to do to be able to connect via RDP to my windows servers, the ip addresses of the instances are as follows:
Instance with OpenVpn installed:
Internal network interface, eth0: 10.128.0.3
Openvpn interface, tun0 10.8.0.1
Ip publishes 104.154.145.xxx
Windows server instance:
Internal network interface, eth0: 10.128.0.2
Ip publishes 35.184.137.xxx
Windows server instance:
Internal network interface, eth0: 10.128.0.3
Ip publishes 35.184.137.xxx
When I connect as a client, the OpenVpn service gives me ip: 10.8.0.6
.
I'd like to connect to the Windows servers by RDP.
I believe it is related to some routing issue but I'm not sure, can you please assist?
Best Answer
I read all communications with Itai. Along with configuring routing in
OpenVPN
configuration file and Windows machine, you should enable forwarding on your Linux machine, to enable it, just addnet.ipv4.ip_forward=1
to/etc/sysctl.conf
and executesysctl -p
. After this you should addiptables
rule by commandiptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
. It should be enough.Don't forget to save iptables configuration by command
service iptables save
.