Quote:
Originally Posted by Icovada
Thank you but your guide explains how to route a client computer's traffic on a VPN.
|
More generally, it explains how to have two default routes, and an iptables rule to choose which default route is to be used. If the rule matches, the first one (in my case the one in the tcp_tun2socks table) will be used, otherwise the second one (real_default table).
An example of how your goal can be achieved:
routing table main: has all routes, except default gateways
routing table default_direct: has default gateway via ISP's router
routing table default_vpn: has default gateway via VPN
ip rules (output of "ip rule show"):
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
40000: from all fwmark 0x100/0x100 lookup default_direct
40001: from all lookup default_vpn
iptables rules:
iptables -t mangle -A PREROUTING -i <lan_iface> -p tcp --dport 80 -j MARK --or-mark 0x100
It's really the same thing as the guide, expect with different names for routing tables and a different iptables match.