On Sat, Jul 2, 2016 at 1:59 PM, Josu Lazkano <[email protected]> wrote:
> Thanks Selva!
>
> It works, I remove the routes in the configuration files and execute this:
>
> ip route add 192.168.1.0/24 dev tun0 src 192.168.2.10
> ip route add 192.168.2.0/24 dev tun0 src 192.168.1.10
>
> Now it is working great, the only problem is that if I reboot the
> servers, the lost the routes, how could I add the routes every time
> that tunnel is up?
>
Option 1: Leave the routes as before in the config and add a static route
to the remote vpn ips on the routers:
On router1:
# ip route add 10.0.0.2/32 via 192.168.1.10
On router 2:
# ip route add 10.0.0.1/32 via 192.168.2.10
Option 2: Set up the routes using a script with the "--route-up
path-to-file" option. The file in this case could be a shell-script that
runs
#!/bin/sh
/sbin/ip route add 192.168.2.0/24 dev ${dev} src 192.168.1.10
on server 1. Similarly for server 2.
The tun device name (tun0) will be exported as $dev by openvpn when the
script is executed.
You can also add a --route-pre-down script to tear down the route, though
not really necessary in this case.
I think option 1 is better.
Selva
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Openvpn-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-users