Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Last active March 22, 2018 16:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeoffWilliams/a65d09cab22f7a5e289e to your computer and use it in GitHub Desktop.
Save GeoffWilliams/a65d09cab22f7a5e289e to your computer and use it in GitHub Desktop.
transparent proxy rules for openwrt and squid
#
# Shell commands to run on router to enable transparent proxying
#
uci add firewall redirect
uci set firewall.@redirect[0].name='Transparent Proxy Redirect'
uci set firewall.@redirect[0].src=lan
uci set firewall.@redirect[0].proto=tcp
uci set firewall.@redirect[0].dest_port=3128
uci set firewall.@redirect[0].src_dport=80
uci set firewall.@redirect[0].src_dip='!192.168.15.1'
uci set firewall.@redirect[0].dest_ip=192.168.15.1
uci set firewall.@redirect[0].target='DNAT'
uci commit firewall
/etc/init.d/firewall restart
@diogosimao
Copy link

Hi!
Would you tell me why did you change from .src=lan to .src=wan and why .src_dip instead of .src_ip ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment