Page 1 of 1

Routing "through" a connected client

Posted: Sun May 29, 2011 3:13 pm
by dboss
Hi,

Is it possible to configure openvpn in a way that will allow routing through connected clients to specific hosts in these client subnets.

for example, lets say the openvpn server is 10.8.0.1, and there is a client connected to it, that gets an IP from the VPN of 10.8.0.22, while its local IP is 192.168.20.1.

now ... lets say there is another server on the distant subnet with an IP of 192.168.20.2
I want to be able to get from my VPN network to this server as well, without needing to connect it with another client.

Thanks,
Benny

Re: Routing "through" a connected client

Posted: Mon May 30, 2011 7:10 am
by Bebop
dboss wrote: I want to be able to get from my VPN network to this server as well, without needing to connect it with another client.
Without being too specific I can give you a general idea to get you started.

Check out the documentation for CCD and iroute.

Its basically a line in the server.conf + a file in the server CCD directory. The CCD filename has to be the common name of the client you want to access (eg, in the CCD directory, create a file named client1). In the file you put the text "iroute 192.168.20.0 255.255.255.0" or something similar.

Next time when client1 connects, a route will automatically be added on the local server which says "192.168.20.0" is via "10.8.0.22" (or a meaning similar to this).