trying to route between two openvpn clients

Posted by user42055 on Server Fault See other posts from Server Fault or by user42055
Published on 2010-05-03T08:18:52Z Indexed on 2010/05/03 8:28 UTC
Read the original article Hit count: 252

Filed under:

I have two openvpn clients on the 10.0.1.0 (client1) and 192.168.0.0 (client2) subnets with the server's openvpn connection having the ip 192.168.150.1

The server has ip forwarding enabled.

Currently, client1's vpn ip is 192.168.150.10 and the P-t-P ip is 192.168.150.9 I have created the following static route on client1:

route add -net 10.0.1.0 netmask 255.255.255.0 gw 192.168.150.9

The routing table on client1 looks like this:

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.150.9   0.0.0.0         255.255.255.255 UH        0 0          0 tun0
192.168.150.1   192.168.150.9   255.255.255.255 UGH       0 0          0 tun0
10.0.1.0        192.168.150.9   255.255.255.0   UG        0 0          0 tun0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0

I thought this would be correct to allow traffic from client1 to reach computers on client2's network, but it does not work. Is 192.168.150.9 (the P-t-P address) the correct one to be routing through ? I tried using 192.168.150.1 but I couldn't create the route.

I hope this is clear.

© Server Fault or respective owner

Related posts about openvpn