RSS

terça-feira, 6 de abril de 2010

IPTables - Criando chains Personalizadas.

Script que permite acesso total a rede.

hostsliberados.sh 

for x in `cat /root/hostsliberados.txt`
   do
        iptables -t nat -A preHostsLiberados -s $x -j ACCEPT
        iptables -t nat -A posHostsLiberados -s $x -j MASQUERADE
   done


hostsliberados.txt (Ips que serão liberados)
192.168.0.2
192.168.0.4
192.168.0.6

Regras
iptables -t nat -N preHostsLiberados
iptables -t nat -N posHostsLiberados
/root/hostsliberados.sh

iptables -t nat -A PREROUTING -j preHostsLiberados
iptables -t nat -A POSTROUTING -j posHostsLiberados
  

Nenhum comentário:

Postar um comentário