Skip to content

Instantly share code, notes, and snippets.

@elico
Created Sep 29, 2016
Embed
What would you like to do?
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