Autor Tópico: Re: iptables  (Lida 2138 vezes)

Offline rodrigo.miguel

  • Usuário Ubuntu
  • *
  • Mensagens: 720
    • Ver perfil
    • LinuxUserVlog
Re: iptables
« Online: 08 de Fevereiro de 2009, 11:48 »
Alguém pode me dar uma luz?  ;D

Estou tentando utilizar o gnome-lokkit para criar um firewall básico. Mas parece que não surte efeito...

Vou deixar aqui a configuração do iptables para análise.

Inicialmente estava assim:

Código: [Selecionar]
ubuntu@ubuntu-laptop:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination   
     


Depois de rodar o comando gnome-lokkit (e colocando baixa segurança), ficou assim:

Código: [Selecionar]
ubuntu@ubuntu-laptop:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Lokkit-0-50-INPUT (0 references)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere            udp spts:bootps:bootpc dpts:bootps:bootpc
ACCEPT     udp  --  anywhere             anywhere            udp spts:bootps:bootpc dpts:bootps:bootpc
ACCEPT     all  --  anywhere             anywhere           
REJECT     tcp  --  anywhere             anywhere            tcp dpts:0:1023 flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere            tcp dpt:nfs flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp dpts:0:1023 reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp dpt:nfs reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere            tcp dpts:x11:6009 flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     tcp  --  anywhere             anywhere            tcp dpt:font-service flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable

Como faço pra saber se a configuração acima está funcionando???
Tentei configurar para alta segurança para ver se bloqueava o DHCP e o aMSN (apenas para testar) e não surtiu efeito...

Para alta segurança fica assim (sem efeito aparente):

Código: [Selecionar]
ubuntu@ubuntu-laptop:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Lokkit-0-50-INPUT (0 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     udp  --  10.1.1.1             anywhere            udp spt:domain
REJECT     tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp reject-with icmp-port-unreachable

Se utilizo o seguinte comando o iptables bloqueia tudo (o que indica que está ativo):

Código: [Selecionar]
iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat && iptables -F -t mangle && iptables -X -t mangle && iptables -t filter -P INPUT DROP && iptables -t filter -P OUTPUT DROP && iptables -t filter -P FORWARD DROP
Estou usando este comando para voltar o iptables para o estado original, desbloqueando tudo:

Código: [Selecionar]
iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat && iptables -F -t mangle && iptables -X -t mangle && iptables -t filter -P INPUT ACCEPT && iptables -t filter -P OUTPUT ACCEPT && iptables -t filter -P FORWARD ACCEPT

Como faço para que as configurações geradas pelo gnome-lokkit tenham efeito???


« Última modificação: 08 de Fevereiro de 2009, 11:52 por rodrigo.miguel »

Offline clcampos

  • Administrador
  • Usuário Ubuntu
  • *****
  • Mensagens: 10.790
  • .:: User Linux #439596 ::.
    • Ver perfil
Re: iptables
« Resposta #1 Online: 08 de Fevereiro de 2009, 16:51 »
Mensagem duplicada.

Tópico trancado.
Cristiano/Timóteo - MG
.: Como Fazer Perguntas de Forma Inteligente :.                
Com dúvida? pesquise!