From owner-freebsd-questions@freebsd.org Tue May 31 22:00:33 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1280B561DE for ; Tue, 31 May 2016 22:00:33 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A20441C4C for ; Tue, 31 May 2016 22:00:33 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: by mail-yw0-x22c.google.com with SMTP id o16so1098909ywd.2 for ; Tue, 31 May 2016 15:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenebras-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=5eEeYaQHHzdnEh2yBLb9cmtTrO6FBySjCz8m/uDCcDY=; b=dSMGIRHeh/G/qx5YGA8cSZYZl9H7aR3yYzyhMEU/7gw/dcRjjKNROd2g2BozbnYUxl 9tNzbJxJaGK0xhi8F+IibayM9MAmY2sI3jFN8Vdow7Tx1XDUsIm6OlBnW42ns/V0zt4W HxKunWQT9AvNYISALlSvAITZXDjwQBGafZ2mO6tA2xMxQGGoJJLUiTkIo/lym8KVto06 6VNTDksqAkyudJVs5dCEsABosNbgDkYuFI2v/JPS6Z7WNjXT3Zi+zCGdscF1HkOsxL2N YIH5MU7v1u1w9B6khsh6SUanjfmCtR0NWArM5tTp0Qy6iTSzw4zdyje/Bm18723RZ/kA CGAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5eEeYaQHHzdnEh2yBLb9cmtTrO6FBySjCz8m/uDCcDY=; b=jYmxQKpQPmLUo1lgRpl7ykPO2ejyJoWQdwDf0UxS2YgzvyrOiVIbZf9TYL973a/nan MrKTaL5UzI+DDSFCd1D990DyJ2mtNW+t+6VyHymYph6wzfGWOCn49cnumjlPtqTLivOx LRuWFrqvavO3k0cvdnrn13NfCyHumQhk/yMNwE176bIoAII22MOOTFK8SwM7Zfu0LMnz KjBnUythdXAJRMpbFy/TDYnci/PhkkBQxGVnq/Ku2B5WTkGT24mv9t+LsheE529esIUf vh5kXOgACYZ+1wIEIqxd72yuqaAd/4uxOv2oa/NBKCIiH83X75grozvRVpNIQpZKCpwr raVw== X-Gm-Message-State: ALyK8tLDZ6fSPH+u6BEUX8cbLBRMuPBD618WhXwX+4lmVFV7W58SwIcFNcyllpbkekYBiTwUberTuk/aD015iG23 MIME-Version: 1.0 X-Received: by 10.129.73.208 with SMTP id w199mr254587ywa.176.1464732032704; Tue, 31 May 2016 15:00:32 -0700 (PDT) Received: by 10.37.217.132 with HTTP; Tue, 31 May 2016 15:00:32 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 May 2016 15:00:32 -0700 Message-ID: Subject: Re: Can ipfw be used to limit concurrent requests from an IP? From: Michael Sierchio To: Will Squire Cc: FreeBSD Questions Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 22:00:34 -0000 You can use dummynet pipes (and optionally queues) with a mask for this. You can specify queue size in slots. You can also make use of red/gred (see the manpage). I might choose a larger mask than 0xffffffff because a new pipe will be instantiated for each matching address. a very simple example ipfw pipe 1 config bw 800Byte/s mask src-ip 0xffffc000 ipfw add pipe 1 tcp from any to me ssh in recv $OIF setup - M On Fri, May 27, 2016 at 12:34 PM, Will Squire wrote: > > Can ipfw limit the number requests in a given amount of time from a specific IP? > > To contextualise, if an IP sends requests in high concurrency (let's say 50 a second) can ipfw either block requests the exceed a threshold for that second (lets say the threshold is 20, 30 would be blocked), or ban/deny the given IP for exceeding a threshold? > > The aim is to lessen strain under DoS attacks, specifically for HTTP. The system is using Apache and mod_evasive has been added and tested, but it is not functioning correctly. > > (P.S. The freebsd-ipfw list seems to be for development of the technology only, so asking this here. Please let me know if this isn=E2=80=99t the cas= e) > > > Thanks > > Kind regards, > > Will Squire > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " freebsd-questions-unsubscribe@freebsd.org"