Skip to content

Instantly share code, notes, and snippets.

Created Sep 29, 2016
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment