0

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".

1
  • Are outgoing icmp packets allowed in your iptables rules?
    – Silent-Bob
    Sep 9, 2011 at 23:35

2 Answers 2

0

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?

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .