Skip to content

Instantly share code, notes, and snippets.

@elico
Created September 29, 2016 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elico/e0faadf0cc63942c5aaade808a87deef to your computer and use it in GitHub Desktop.
Save elico/e0faadf0cc63942c5aaade808a87deef to your computer and use it in GitHub Desktop.
iptables specific domains intercept bypass
#!/usr/bin/env bash
set -x
iptables -t nat -L PREROUTING |grep bypasspool
if [ "$?" -ne "0" ];then
iptables -t nat -I PREROUTING -m set --match-set bypasspool dst,src -j ACCEPT
fi
ipset create bypasspool hash:ip
while read item; do
echo $item
host -4 $item |grep "has address"|awk '{print $4}' |xargs -l1 ipset add bypasspool
done < domains-to-bypass.txt
set +x
dyn.web.whatsapp.com
www.youtube.com
www.microsoft.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment