on v3.4-138, using PBR 192.168.1.128/25 for VPN clients:
Why can't i use this to route packets dport=995 off the VPN?
First add an iptables rule to mark specific packets:
iptables -t mangle -A PREROUTING -p tcp --dport 995 -j MARK --set-mark 0x200
iptables -t mangle -A PREROUTING -p udp --dport 995 -j MARK --set-mark 0x200
Then add a policy routing rule that matches the mark:
ip rule add fwmark 0x200 lookup main
There are other possible combinations – for example, mark all packets meant for VPN (making the existing from rule...
iptables -t mangle -A PREROUTING -p tcp --dport 995 -j MARK --set-mark 0x200
iptables -t mangle -A PREROUTING -p udp --dport 995 -j MARK --set-mark 0x200
Then add a policy routing rule that matches the mark:
ip rule add fwmark 0x200 lookup main
There are other possible combinations – for example, mark all packets meant for VPN (making the existing from rule...
Why can't i use this to route packets dport=995 off the VPN?