Skip to content

Instantly share code, notes, and snippets.

@CROSP
Last active June 15, 2020 18:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CROSP/89b88b2acd680ba0ff7326fd242bd4ce to your computer and use it in GitHub Desktop.
Save CROSP/89b88b2acd680ba0ff7326fd242bd4ce to your computer and use it in GitHub Desktop.
DD-WRT Remove rules for transparent proxifying
#!/bin/sh
PROXIFYING_MACHINE=192.168.0.145
MACHINE_TO_PROXIFY=192.168.0.113
iptables -D PREROUTING -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
iptables -D PREROUTING -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -p tcp -m multiport --dports 80,443 -j CONNMARK --save-mark
iptables -D PREROUTING -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get wan_ipaddr` -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
iptables -D PREROUTING -t mangle -s $MACHINE_TO_PROXIFY ! -d `nvram get wan_ipaddr` -p tcp -m multiport --dports 80,443 -j CONNMARK --save-mark
while ip rule delete from 0/0 to 0/0 table 13 2>/dev/null; do true; done
ip route flush table 13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment