I assume the metric for 10.8.0.1 is lower than 192.168.2.99 (by local gateway) so it is trying to take the 10.8.0.1 path instead of my local gateway.
This is what I want, but traffic doesn't route anywhere now, I am assuming this is because tun0 is a VPN connection going through 192.168.2.99 itself, but that may not be the problem, not sure :(

It looks like that deleted the route from 10.8.0.2 to 10.8.0.1, but not the default gateway to 10.8.0.1, was that what you wanted?

nimnull22

03-28-2010 08:47 PM

Ok. This is not really good.
I hope you know that VPN it is like tunnel between you computer and remote one, and
"inet 10.8.0.2 peer 10.8.0.1/32 scope global tun0" - means (if I understand right) 10.8.0.1 on the other side of this tunnel. So if tunnel works you should be able to ping it.

I have computer A (this one) which has
eth0 192.168.2.11 with gateway 192.168.2.99
tun0 10.8.0.2 tunnel to 10.8.0.1 (to computer B)
and I have computer B (the 10.8.0.1 network) which has:
eth1 x.x.x.1 with gateway x.x.x.2 (can't remember what these numbers are)
tun0 10.8.0.1 tunnel to 10.8.0.2 (to computer A)

on computer A my traffic routes through 192.168.2.99, but I want it to route through 10.8.0.1 instead of 192.168.2.99.

When I write "route add -net 4.0.0.0 netmask 255.0.0.0 dev tun0" for example then type "traceroute 4.2.2.3" it works and routes through 10.8.0.1 just like I want.
Similar if I did "route add -net 5.0.0.0 netmask 255.0.0.0 dev tun0" and "route add -net 6.0.0.0 netmask 255.0.0.0 dev tun0" then all 5.x.x.x and 6.x.x.x would route through 10.8.0.1 (which is great!)

The problem is how do I get ALL my traffic to route through 10.8.0.1 without defining 255 different class A addresses manually?

Also, "route add -net 0.0.0.0 netmask 0.0.0.0 dev tun0" loses all my internet connection all together and I believe this is because OpenVPN loses its connection with tun0 because it behind the scenes routes through eth0 (since tun0 is only virtual).