Routing Traffic around OPENVPN

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
dlalias2k1
OpenVpn Newbie
Posts: 1
Joined: Fri May 23, 2014 7:57 pm

Routing Traffic around OPENVPN

Post by dlalias2k1 » Fri May 23, 2014 8:00 pm

I'm connecting my machine to a remote openvpn server. The connection is established and the server (which I don't have control over) routes all traffic over the tunnel.


I'd like to exclude some traffic to not travel over the tunnel. In my research, it seems like people have accomplished this with iptables rules.


Here's what I've cobbled together from other resources but yet it doesn't seem to be working as expected.


Here's my list of Ip related commands I'm currently testing:
#$ Ran once: echo "10 custom_table" >> /etc/iproute2/rt_tables

ip route add default table custom_table via 192.168.1.1
ip rule add fwmark 0x1 table custom_table
ip route flush cache​
iptables -t mangle -I PREROUTING -p tcp -m multiport --dport 80,443 -j MARK --set-mark 0x1




testing by:
curl ifconfig.me
Returns the ip that is the same as traceroute, which is over the tunnel.


I think I'm missing something simple. I'm inexperienced at iptables, so any assistance would be appreciated.
I'd like Https, HTPS, SSH to route over the unencrypted route.


Thanks!

rainbow6
OpenVPN Power User
Posts: 54
Joined: Mon Aug 29, 2011 1:01 pm

Re: Routing Traffic around OPENVPN

Post by rainbow6 » Tue May 27, 2014 3:04 am

You need to talk to your vpn provider as the routing is push by the server.

Post Reply