[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bloqueo de una IP con iptables



Miguel J. Jiménez escribió:
Hola lista... Mi situación es la siguiente.. Quiero bloquear un ip específica con IPTABLES dígase X.Y.Z.T . El problema es que antes de definir la regla del bloqueo, permito el acceso a todo el mundo al puerto 80. Al hacer un "iptables -L", me sale lo siguiente:

Chain INPUT (policy DROP)

target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- 192.168.0.0/16 pitufina.108.168.192.in-addr.arpa tcp dpt:www flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 192.168.0.0/16 pitufina.108.168.192.in-addr.arpa tcp dpt:https flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 192.168.0.0/16 pitufina.108.168.192.in-addr.arpa tcp dpt:webcache flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 192.168.0.0/16 pitufina.108.168.192.in-addr.arpa tcp dpt:52673 flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- anywhere pitufina.108.168.192.in-addr.arpa tcp dpt:ssh flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 172.25.1.34 pitufina.108.168.192.in-addr.arpa tcp dpt:www flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 172.25.1.34 pitufina.108.168.192.in-addr.arpa tcp dpt:https flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT tcp -- 172.25.1.34 pitufina.108.168.192.in-addr.arpa tcp dpt:webcache flags:FIN,SYN,RST,ACK/SYN state NEW ACCEPT udp -- ouija pitufina.108.168.192.in-addr.arpa udp dpts:5004:5082 ACCEPT udp -- ouija pitufina.108.168.192.in-addr.arpa udp dpts:10000:20049 DROP all -- 192.168.102.5 pitufina.108.168.192.in-addr.arpa DROP all -- 192.168.109.25 pitufina.108.168.192.in-addr.arpa DROP all -- 192.168.102.142 pitufina.108.168.192.in-addr.arpa DROP all -- 192.168.109.169 pitufina.108.168.192.in-addr.arpa
Chain FORWARD (policy DROP)
target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere Sin embargo las IP que quiero prohibir siguen pudiendo entrar... ¿debo hacer antes el bloqueo que el permitir el tráfico al puerto 80? Gracias


Es que iptables aplica la primera regla que encuentra.

Te conviene primero bloquear la ip en cuestión y después habilitar las demás.

O sino hacer directamente una regla que abra el puerto 80 a todas las máquinas salvo la que tenga la ip prohibida.

Saludos.
--
Miguel Da Silva
Administrador de Red
Centro de Matemática - http://www.cmat.edu.uy
Facultad de Ciencias - http://www.fcien.edu.uy
Universidad de la República - http://www.rau.edu.uy



Reply to: