Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2017 09:47:30 +0100
From:      krad <kraduk@gmail.com>
To:        Ralf Mardorf <ralf.mardorf@rocketmail.com>, dave.mehler@gmail.com
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Two pf questions
Message-ID:  <CALfReyfFyj9Gh1Yy%2BzxWH1kAgq%2BkVAGPpjG92keGWAaoMLNSQg@mail.gmail.com>
In-Reply-To: <20170327171959.405bbfbb@archlinux.localdomain>
References:  <CAPORhP4JA_Jak7fL8Ko7wwoxGob=qLDzPLxtTgekoumqQJEGmA@mail.gmail.com> <20170327170941.59c84eec@archlinux.localdomain> <20170327171959.405bbfbb@archlinux.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
I didnt think you could get duplicate addresses in pf tables, so please
clarify if you are or not. (i suspect not)
The problem probably is that you are appending to you file not overwriting
it. So drop the double >
ie

pfctl -t bruteforce -T show | sort -u > /etc/pf/bruteforce

This will obviously loose the old contents of the file which you might not
want, however you could just make sure you loaded the contents of the file
into the table before you dump it

On 27 March 2017 at 16:19, Ralf Mardorf via freebsd-questions <
freebsd-questions@freebsd.org> wrote:

> On Mon, 27 Mar 2017 17:09:41 +0200, Ralf Mardorf wrote:
> >On Mon, 27 Mar 2017 10:37:49 -0400, David Mehler wrote:
> >>pfctl -t bruteforce -T show >> /etc/pf/bruteforce
> >>
> >>the problem is that I'm getting duplic addresses. The table has
> >>fifteen addresses in memory but 75 in the table there's no unique
> >>sorting, any ideas on how? I only want unique IP's in the on disk
> >>table to avoid redundant addresses
> >
> >cp /etc/pf/bruteforce /tmp/foobar.txt
> >pfctl -t bruteforce -T show >> /tmp/foobar.txt
> >sort -u /tmp/foobar.txt > /etc/pf/bruteforce
>
> PS: I don't know how your tools work, so perhaps you only need to pipe
> the "new", assuming the tools shouldn't provide their own options to do
> the same ;).
>
> pfctl -t bruteforce -T show | sort -u >> /etc/pf/bruteforce
> _______________________________________________
> 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALfReyfFyj9Gh1Yy%2BzxWH1kAgq%2BkVAGPpjG92keGWAaoMLNSQg>