AW: How to block IP range
Spenst, Aleksej
Aleksej.Spenst at harman.com
Tue Oct 28 08:37:54 UTC 2014
Hi Adam,
> From the manpage in 10:
> Ranges of addresses are specified by using the '-' operator. For
> instance: "10.1.1.10 - 10.1.1.12" means all addresses from 10.1.1.10 to 10.1.1.12, hence addresses 10.1.1.10, 10.1.1.11, and 10.1.1.12.
It's interesting that when I write this rule in pf.conf:
block in quick on eth0 from "10.0.0.1 - 10.0.0.100" to 10.0.0.0
and load the rules then pfctl does not complain about any syntax errors.
However, if I look what rules are loaded with "pfctl -s rules" then I see only:
block drop in quick on eth0 inet from 10.0.0.1 to 10.0.0.0
So, it seems that my pfctl takes only the first address from the range and generates only 1 rule for this IP. Hmm...
Thanks,
Aleksej.
-----Ursprüngliche Nachricht-----
Von: owner-freebsd-pf at freebsd.org [mailto:owner-freebsd-pf at freebsd.org] Im Auftrag von Adam McDougall
Gesendet: Montag, 27. Oktober 2014 17:53
An: freebsd-pf at freebsd.org
Betreff: Re: How to block IP range
On 10/27/2014 12:11, Spenst, Aleksej wrote:
> Hi All,
>
> Is there any syntax to block a certain IP range?
> For example, I need to block only 100 IPs in the range:
> 10.0.0.1-10.0.0.100 I can't use the netmask like "block on eth0 from 10.0.0/24" since this will block 256 addresses.
> I don't want also to write all IPs separated by comma like "block on eth0 from {10.0.0.1,10.0.0.2,.....}" since this will generate 100 separate rules (and this is also a very long rule).
> Are there any other ways?
>
> Thank you!
> Aleksej.
>
>
>
>From the manpage in 10:
Ranges of addresses are specified by using the '-' operator. For
instance: "10.1.1.10 - 10.1.1.12" means all addresses from 10.1.1.10 to 10.1.1.12, hence addresses 10.1.1.10, 10.1.1.11, and 10.1.1.12.
_______________________________________________
freebsd-pf at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-pf
To unsubscribe, send any mail to "freebsd-pf-unsubscribe at freebsd.org"
More information about the freebsd-pf
mailing list