Iptables scratchpad

From thelinuxwiki
Revision as of 19:01, 25 February 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

dynamically create iptables commands which allow gentoo emerge sync and fetch

on gentoo servers

nslookup rsync.gentoo.org | grep -v "#" | grep Address |awk '{ printf "iptables -I FORWARD -p tcp -d " $2 " --dport 873 -j ACCEPT\n"}'
nslookup distfiles.gentoo.org | grep -v "#" | grep Address |awk '{ printf "iptables -I FORWARD -p tcp -d " $2 " --dport 80 -j ACCEPT\n"}'

on firewalls

nslookup rsync.gentoo.org | grep -v "#" | grep Address |awk '{ printf "iptables -I OUTPUT -p tcp -d " $2 " --dport 873 -j ACCEPT\n"}'
nslookup distfiles.gentoo.org | grep -v "#" | grep Address |awk '{ printf "iptables -I OUTPUT -p tcp -d " $2 " --dport 80 -j ACCEPT\n"}'