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?

Thank you very much, best regards.

2016-07-01 23:01 GMT+02:00 Selva Nair <[email protected]>:
> Hi,
>
> On Tue, Jun 28, 2016 at 5:49 AM, Josu Lazkano <[email protected]>
> wrote:
>>
>> Hello again,
>>
>> I configured a site to site OpenVPN with 2 Debian Jessie servers.
>>
>> site1 server: 192.168.1.10/24
>> site1 router/gw: 192.168.1.1/24
>> site1 conf: http://paste.debian.net/766912/
>> site2 server: 192.168.2.10/24
>> site2 router/gw: 192.168.2.1/24
>> site2 conf: http://paste.debian.net/766913/
>>
>> I can ping from site2 server to site1 server:
>>
>> # ping 192.168.1.10 -c 4
>> PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
>> 64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=44.2 ms
>> 64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=46.9 ms
>> 64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=41.6 ms
>> 64 bytes from 192.168.1.10: icmp_seq=4 ttl=64 time=43.8 ms
>>
>> --- 192.168.1.10 ping statistics ---
>> 4 packets transmitted, 4 received, 0% packet loss, time 3004ms
>> rtt min/avg/max/mdev = 41.605/44.158/46.980/1.920 ms
>>
>> But could not reach to the other devices in the remote LAN from the
>> server:
>>
>> # ping 192.168.1.1 -c 4
>> PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
>
>
> Most likely because ping will use the VPN ip (10.0.0.2) as the source
> address and there is no way for the ping reply to get back to that address
> from the site1 router.
>
> You can confirm this by pinging with source address specified: try this from
> site 2 server
>
> $ ping -I 192.168.2.10 192.168.1.1   <-- this should work
>
> Easiest way to fix the routing would be to add a route to 10.0.0.2 on
> router1:
>
> # ip route add 10.0.0.2/32 via 192.168.1.10
> and similarly on router 2
>
> Alternatively you could remove the route option in the configs and set them
> up manually with source address sepcified. On server 2 that would be
>
> # ip  route add 192.168.1.0/24 dev tunX src 192.168.2.10
> (replace tunX by the actual tun device used)
>
> Selva



-- 
Josu Lazkano

------------------------------------------------------------------------------
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

Reply via email to