Routing "through" a connected client

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
dboss
OpenVpn Newbie
Posts: 3
Joined: Fri May 13, 2011 6:37 am

Routing "through" a connected client

Post by dboss » Sun May 29, 2011 3:13 pm

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

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: Routing "through" a connected client

Post by Bebop » Mon May 30, 2011 7:10 am

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).
The cure for boredom is curiosity

Post Reply