Pascal Hambourg <boite-a-(E-Mail Removed)> wrote:
> Hello,
> Clifford Kite a crit :
>>
>>>iptables -A INPUT -s 127.0.0.1 -p icmp -j DROP
>>
>> Wrong table.
> I guess you mean "wrong chain".
Right, I failed to "Count two, think blue."
>> Try
>>
>> iptables -I OUTPUT -p icmp -s 127.0.0.1 -j DROP
> Why ? Packets sent through the loopback interface have to traverse both
> OUTPUT and INPUT chains, and therefore may be dropped in either chain.
My reason is found in man iptables, search for locally. Backed up by
a test which showed this rule worked in that it prevented a ping from
being sent.
Also this appears to me as not a case of "through" the loopback interface,
the packets were _originated_ by the host (locally). That doesn't seem
to mean they must be considered input or output except by designation.
The man pages said output and output appeared to work while input didn't.
> To the OP : the proper way to match packets on the loopback interface is
> to use -i|-o lo, not -s|-d. As you understood, traffic on this interface
> may use any local address as source and destination (don't forget the
> whole 127.0.0.0/8 block).
You're right that using -i lo works, and silently, i.e., without the
"ping: sendmsg: Operation not permitted" message produced by my
suggestion. Since that qualifies as drop, I concede - again.
Regards-
--
Clifford Kite
/* The wealth of a nation is created by the productive labor of its
* citizens. */