use iptables to route only one port through vpn on all clients

Scripts with setup, destroy, and modify routing tables and firewall rulesets for client connections.

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

Post Reply
tooandrew
OpenVpn Newbie
Posts: 4
Joined: Wed Jun 10, 2015 6:51 am

use iptables to route only one port through vpn on all clients

Post by tooandrew » Fri Jun 17, 2016 1:02 am

i am running an openvpn client on a rt-ac66u using asuswrt merlin firmware. The connection is fine and all works as it should, but the gui for policy based routing only allows routing by ip address, while i want to route all traffic on port 15444 through the vpn while leaving everything else going through the wan.

i've gathered that this will require me to configure it via iptables in an ssh prompt, so i have installed entware on the router and downloaded and installed the iptables, but every guide i have found spouts a million syntax errors, save for one, and despite the lack of syntax errors on that guide, there is no change to the reported ip after following it. if someone familiar with iptables would be willing to help me it'd be greatly appreciated.

Post Reply