Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using iptables I am trying to reject packets (I want to return an ICMP message).

iptables -A FORWARD [...] -j REJECT --reject-with icmp-port-unreach

The packets are dropped but using tcpdump I can see no ICMP. What gives ? Am I doing something wrong ? Do I have to flip some sysctl or anything ?

Kernel is: 2.6.32-5-openvz-686

Please don't suggest "use DROP instead of REJECT".

share|improve this question
    
Are outgoing icmp packets allowed in your iptables rules? –  Silent-Bob Sep 9 '11 at 23:35

2 Answers 2

Are you sure the packets in question have matched your rule to reject? Do you see the counter associated with that rule being incremented when you look at the verbose output (iptables --list --verbose)?

Have you tried disabling all the other iptables rules aside from that one to make sure that no other rules are interfering?

share|improve this answer

Are you sure you are hitting the FORWARD chain? You can add a rule to log all the matching packets.

 iptables -I FORWARD [...] -j LOG --log-prefix "FORWARDED"

If you after adding that rule you cannot see anything on /var/log/messages you probable are using the wrong chain (INPUT instead of FORWARD?) or the wrong conditions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.