openvpn and routing

Michael Torrie torriem at
Thu Mar 7 19:53:02 MST 2013

On 03/07/2013 02:58 PM, Charles Curley wrote:
> I tried installing openvpn and following this tutorial:
> I got as far as the statement "You should probably configure your route
> at this step." I have tried several "route add" commands but none seem
> to produce useful results. I can ping the local side of the connection,
> but not the remote side.
> How do I add the appropriate route to each machine? Thanks

I let OpenVPN do it for me.  Here's a complicate setup that puts in
routes for 6 networks.  What this means is that VPN clients are told to
use the vpn server as the gateway for these routes

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (
# back to the OpenVPN server.
push "route remote_host net_gateway"
push "route"
push "route"
push "route"
push "route"
push "route"
push "route"

What's cool is I can tell VPN that some VPN clients have routes to these
networks.  For example, might be the internal network at my
home. might be the internal network at my parents' house.
And might be another network at another site.  Then to tell
openvpn which clients have these networks, in the "/etc/openvpn/ccd/"
directory, I can make individual files (based on user id or TLS
certificate common name).  Like this:

# give this client the same ip address every time (see docs on how the
pairs work)



Now when everyone is vpn'd in you can ping across any of the subnets
just fine and routing is all taken care of.

Hope that makes sense.  Let me know if you have a question about what I

More information about the PLUG mailing list