Autor Tópico: Criar um script inicializavel do iptables  (Lida 5419 vezes)

Offline Rafaeln

  • Usuário Ubuntu
  • *
  • Mensagens: 4
    • Ver perfil
Criar um script inicializavel do iptables
« Online: 13 de Dezembro de 2012, 11:51 »
Pessoal bom dia !

Gostaria da ajuda de vocês pra montar um script do meu iptables, porque toda vez que reinicio o servidor tenho que digitar as regras novamente.

Seguem minha regras:

SERVIDOR 1:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:190
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:19022

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:190
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:19022

SERVIDOR 2:

 Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:19022
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             172.18.0.80
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ssh
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh

ps* tambem não sei o comando para excluir essas regras repetidas, se alguem puder me ajudar...

Att

Rafael

Offline irtigor

  • Equipe Ubuntu
  • Usuário Ubuntu
  • *****
  • Mensagens: 4.344
  • Delete, delete, delete!
    • Ver perfil