I have an Ubuntu 14.04 machine that all it's outgoing traffic is through a VPN, and I'm required to make sure that HTTP and HTTPS traffic don't go through the VPN.
I've looked into static routing but it seems to handle only layer 3.
How should I approach this setting? Thanks.
Openvpn – Bypass VPN for HTTP/HTTPS traffic on Ubuntu
httpopenvpnubuntu-14.04vpn
Best Answer
In order to route packets destined to specific ports via a different default gateway you need to mark those packets using iptables and then route them via a different route table.
So, first create a new route table with default gateway your local gateway (not your VPN gateway)
Then mark the packets you need based on the destination ports.
Finally route those marked packets via the newly created route table.
I havent' tested the commands above so they may need a little tweaking.