From: "Peter Müller" <peter.mueller@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] drop excessive ICMP ping traffic to the firewall
Date: Thu, 04 Jul 2019 18:32:00 +0000 [thread overview]
Message-ID: <8424c54e-4821-b378-c2df-a122a8c719ff@ipfire.org> (raw)
In-Reply-To: <E60A1BAD-3619-47CC-8C2C-D760AB309082@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]
Hello Michael,
> Hi,
>
>> On 4 Jul 2019, at 18:31, Peter Müller <peter.mueller(a)ipfire.org> wrote:
>>
>> pings are replied to for diagnostic reasons only. As unlimited
>> response generation may open up a (D)DoS attack surface for
>> both external and internal networks, dropping excessive traffic
>> is reasonable.
>
> IPFire won’t do this. We have this configuration in place to avoid this which also works for any other kind of ICMP message (or at least what is selected by the mask):
>
> net.ipv4.icmp_echo_ignore_broadcasts = 1
> net.ipv4.icmp_ignore_bogus_error_responses = 1
> net.ipv4.icmp_ratelimit = 1000
> net.ipv4.icmp_ratemask = 6168
>
> This is from /etc/sysctl.conf.
I was unaware of this configuration. The rate limit of 1000
might be a bit too large for home users, depending on how
many other ICMP packets need to be processed or sent.
Anyway, it's good to have these directives around. :-)
>
> So do you still want the patch?
No, thank you.
Best regards,
Peter Müller
>
> -Michael
>
>>
>> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
>> ---
>> src/initscripts/system/firewall | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall
>> index b3483a744..622d7de4e 100644
>> --- a/src/initscripts/system/firewall
>> +++ b/src/initscripts/system/firewall
>> @@ -214,10 +214,12 @@ iptables_init() {
>> iptables -N IPTVFORWARD
>> iptables -A FORWARD -j IPTVFORWARD
>>
>> - # Allow to ping the firewall.
>> + # Allow non-excessive pings to the firewall
>> iptables -N ICMPINPUT
>> iptables -A INPUT -j ICMPINPUT
>> - iptables -A ICMPINPUT -p icmp --icmp-type 8 -j ACCEPT
>> + iptables -A ICMPINPUT -p icmp --icmp-type 8 -m limit --limit 100/second -j ACCEPT
>> + iptables -A ICMPINPUT -p icmp --icmp-type 8 -m limit --limit 10/minute -j LOG --log-prefix "DROP_PINGFLOOD " -m comment --comment "DROP ping flood"
>> + iptables -A ICMPINPUT -p icmp --icmp-type 8 -j DROP
>>
>> # Accept everything on loopback
>> iptables -N LOOPBACK
>> --
>> 2.16.4
>>
>
--
The road to Hades is easy to travel.
-- Bion of Borysthenes
prev parent reply other threads:[~2019-07-04 18:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 17:31 Peter Müller
2019-07-04 18:18 ` Michael Tremer
2019-07-04 18:32 ` Peter Müller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8424c54e-4821-b378-c2df-a122a8c719ff@ipfire.org \
--to=peter.mueller@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox