Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables e ICMP (TYPE=3 CODE=1)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Spanish
View previous topic :: View next topic  
Author Message
opotonil
l33t
l33t


Joined: 17 Jun 2005
Posts: 801
Location: 127.0.0.1

PostPosted: Sun Jun 24, 2007 11:15 am    Post subject: iptables e ICMP (TYPE=3 CODE=1) Reply with quote

Hola,

me estoy encontrando los siguientes mensajes en los logs:
Quote:

Jun 24 12:20:50 laptop Bad ICMP traffic:IN= OUT=lo SRC=192.168.1.249 DST=192.168.1.249 LEN=88 TOS=0x00 PREC=0xC0 TTL=64 ID=30509 PROTO=ICMP TYPE=3 CODE=1 [SRC=192.168.1.249 DST=192.168.1.253 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=56654 DF PROTO=TCP SPT=3254 DPT=631 WINDOW=5840 RES=0x00 SYN URGP=0 ]


la cuestion es que si no me equivoco el "ICMP TYPE=3" es "Destination Unreachable" que lo tengo permitido en mi iptables (basado en http://www.gentoo.org/doc/es/security/security-handbook.xml?part=1&chap=12#doc_chap5), os pego las partes que me parece que estan relacionadas a ver si alguien ve que puede estar mal:
Code:

# Setting default rule to drop
$IPTABLES -P INPUT   DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT  DROP

# Creating icmp chain
$IPTABLES -N allow-icmp
$IPTABLES -F allow-icmp
$IPTABLES -A allow-icmp -m state --state NEW -p icmp --icmp-type time-exceeded -j ACCEPT
$IPTABLES -A allow-icmp -m state --state NEW -p icmp --icmp-type destination-unreachable -j ACCEPT
$IPTABLES -A allow-icmp -p icmp -j LOG --log-prefix "Bad ICMP traffic:"
$IPTABLES -A allow-icmp -p icmp -j DROP

# Creating states chain
$IPTABLES -N allow-connection
$IPTABLES -F allow-connection
$IPTABLES -A allow-connection -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A allow-connection -j DROP

# Applying chains to INPUT
$IPTABLES -A INPUT -m state --state INVALID -j DROP
$IPTABLES -A INPUT -p icmp -j allow-icmp
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -j allow-connection

# Applying chains to FORWARD"
$IPTABLES -A FORWARD -m state --state INVALID -j DROP
$IPTABLES -A FORWARD -p icmp -j allow-icmp
$IPTABLES -A FORWARD -o lo -j ACCEPT
$IPTABLES -A FORWARD -j allow-connection

# Applying chains to OUTPUT"
$IPTABLES -A OUTPUT -m state --state INVALID -j DROP
$IPTABLES -A OUTPUT -p icmp -j allow-icmp
$IPTABLES -A OUTPUT -o lo -j ACCEPT
$IPTABLES -A OUTPUT -j allow-connection


No se si me faltara alguna opcion del kernel, despues de repasarlo 20 veces es lo unico que se me ocurre, pero en principio el modulo "xt_state" lo tengo cargado.

Muchas gracias y salu2.
Back to top
View user's profile Send private message
Cereza
Guru
Guru


Joined: 14 Apr 2006
Posts: 428

PostPosted: Sun Jun 24, 2007 11:35 am    Post subject: Reply with quote

Pues por si te sirve, https://forums.gentoo.org/viewtopic-t-565693-highlight-chain+target+match.html aquí hablan sobre los módulos del kernel relacionados con iptables, resumiendo:

x_tables ip_tables iptable-filter ipt_REJECT xt_tcpudp nf_conntrack nf_conntrack_ipv4 xt_state
Back to top
View user's profile Send private message
opotonil
l33t
l33t


Joined: 17 Jun 2005
Posts: 801
Location: 127.0.0.1

PostPosted: Sun Jun 24, 2007 12:00 pm    Post subject: Reply with quote

Pues en principio los tengo todos cargados:
Code:

xt_limit                2112  9
ipt_LOG                 5824  7
xt_tcpudp               3008  48
nf_conntrack_ipv4       7496  7
xt_state                1984  7
nf_conntrack           43848  2 nf_conntrack_ipv4,xt_state
iptable_filter          2240  1
ip_tables               9672  1 iptable_filter
x_tables               11268  5 xt_limit,ipt_LOG,xt_tcpudp,xt_state,ip_tables

menos el "ipt_REJECT" que en principio no lo uso (no tengo ingun "-j REJECT") pero probare a incluirlo...

Muchas gracias y salu2.

-------------------------- EDITADO --------------------------
Pues puede que si sea el ipt_REJECT, segun pone la ayuda del kernel:
Quote:

The REJECT target allows a filtering rule to specify that an ICMP
error should be issued in response to an incoming packet, rather
than silently being dropped.

no lo termino de entender pero parece que esta relacionado asi que lo incluyo como modulo a ver si hay suerte.
Back to top
View user's profile Send private message
opotonil
l33t
l33t


Joined: 17 Jun 2005
Posts: 801
Location: 127.0.0.1

PostPosted: Fri Jun 29, 2007 9:19 am    Post subject: Reply with quote

Pues no era cosa del REJECT.

No se si estare equivocado pero que yo sepa el REJECT es lo mismo que el DROP con la diferencia de que DROP rechaza los paquetes como si no hubiera nada y el REJECT los rechaza igualmente pero "diciendo" que esta hay pero cerrado.

¿alguna idea?

Muchas gracias y salu2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum