Hey,
I'm trying to set up some Policy Based Routing so I can forward traffic from eth0-127.0.0.1:xxxx to tunX
For example, if I want to forward traffic from an application, like a browser/game/irc-client, through tun0, I could set the network settings to go through 127.0.0.1:9000, and if I want them to go through tun1 (a second client/connection), I could set the network settings to go through 127.0.0.1:9001. Or if I want it to go through eth0, I don't assign any network settings...
This is my first attempt at using PBR, so any direction, explanation and examples is a great help.
Here's my config file.
client
ping 5
proto tcp
dev tun
resolv-retry infinite
nobind
auth-user-pass ./auth.txt
route-nopull
remote xxx.xxx.xxx.xxx 443
persist-key
persist-tun
ns-cert-type server
verb 5
ping-exit 90
##Certificate Files Below
The output of route -n before OpenVPN is started:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
The output of route -n while OpenVPN is running:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
10.200.0.0 0.0.0.0 255.255.252.0 U 0 0 0 tun0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0