Skip to content

Instantly share code, notes, and snippets.

@ccampo133
Created October 17, 2017 22:18
Show Gist options
  • Save ccampo133/755b45e966dc736f71137e049ed5f0c8 to your computer and use it in GitHub Desktop.
Save ccampo133/755b45e966dc736f71137e049ed5f0c8 to your computer and use it in GitHub Desktop.
iptables -t mangle -A PREROUTING -j ACCEPT -p tcp -m multiport --dports 80,443 -s ! 192.168.1.134
iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp -m multiport --dports 80,443
ip rule add fwmark 3 table 2
ip route add default via 192.168.1.139 dev br0 table 2
# 192.168.1.134 is the source I want to redirect, 192.168.1.139 is the proxy, and iptables was run on the router (192.168.1.1). The proxy was listening on port 80.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment