Hello,
(E-Mail Removed) a écrit :
> Would anyone be kind enough to give me some pointers to route packets
> from a specific ip on my subnet via the tun0 OpenVPN interface, and
> all other hosts out the default route of the main routing table
> (192.168.1.1 on br0)?
>
> i.e. 192.168.1.2-9 -> via br0, and 192.168.1.200 -> via tun0
>
> I have created the tables:
>
> mkdir /etc/iproute2
> echo 201 table1 >> /etc/iproute2/rt_tables
> ip rule add from 192.168.1.200/32 table table1
>
> But i am really stuck from here. I tried adding default routes in the
> table1 but all traffic stops at this point (i am pinging from the host
> 192.168.1.200 out onto the net, it works as soon as this command below
> is entered it times out):
All you can infer from this test is that the ping program receives no
replies with the advanced routing setup. This does not necessary mean
that the echo requests are not sent correctly. Maybe the problem is on
the reverse path. Have you traced the traffic at each virtual and
physical interface on each hop ?
> root@OpenWrt:~# ip route list table table1
> default via 10.19.0.5 dev tun0
Seems fine to me.
> With OpenVPN setup to push the redirect-gateway option, all works well
> with the routing table and the box acts as a router sending everything
> through it (table shown below - this works fine apart from everyone is
> routed through it).
So we can reasonably believe that the routing at the other end of the
VPN is ok. Check that the source validation by reversed path is disabled
for the VPN tun0 (/proc/sys/net/ipv4/conf/tun0/rp_filter=0 or
/proc/sys/net/ipv4/conf/all/rp_filter=0). This is often needed because
the validation check does not take the advanced routing rules into account.