I have set up a separate routing table (tovpn)
#echo 200 tovpn >> /etc/iproute2/rt_tables
Now I assign routes to it.
Where 10.0.0.1 is the tun2 P-t-P and 10.0.0.2 is the inet
#ip route add 10.0.0.1 dev tun2 table tovpn #ip route add default via 10.0.0.2 dev tun2 table tovpn
Some network 172.20.20.0/24 has traffic forwarded to the table
#ip rule add from 172.22.22.0/24 table tovpn #iptables -t nat -A POSTROUTING -s 172.22.22.0/24 -o tun2 -j MASQUERADE
Great, everything works.
How do I specify traffic additional traffic to pass through the tunnel by specifying the host ip?
The following does not work, if I would like to route, for example, traffic to 220.127.116.11 over the tunnel.
#ip rule add to 18.104.22.168/32 table tovpn
#ip rule add to 22.214.171.124/32 lookup tovpn
Any assistance would be greatly appreciated, thank you.