p0f, bpf, and jail

Jeff Anton antonfb at hesiod.org
Fri Jul 12 16:51:22 UTC 2019

This looks like what I dealt with trying to get dhcpd running in a 
jail.  It needs raw sockets and bpf.  Jails don't get those by default.

The devices that are in a jail is setup from /etc/default/devfs.rules 
and you see there ruleset number 4 for jails.

I needed a special devfs ruleset for my jail.  So I created 
/etc/devfs.rules with the following contents:

add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide

Then in my jail.conf for this jail I added:

         devfs_ruleset = 5;

This allowed dhcpd to work in the jail!  Note that this opens a jail up 
to doing lots of bad stuff potentially, but it more about giving the 
minimum needed permissions to get dhcpd running.  It still far more 
restricted than running dhcpd outside of a jail.

Jeff Anton


Hello, I'm using FreeBSD 12 on amd64 hardware. p0f is passive os 
fingerprinting, what I'm wanting to do is determine by passively 
analyzing a connecting machines tcp stack what kind of machine it is, 
and based on that result add in an email header to the message. So, for 
example if someone connects to my system by means of an xp laptop and 
tries to send email, I'll know by that email header the type of 
connecting machine. Later down the antispam chain the antispam software 
can take an action most likely a silent drop, based on that header. 
Thanks. Dave. On 7/10/19, Ernie Luzar <luzar722 at gmail.com> wrote:

> David Mehler wrote:
>> Hello,
>> Is anyone using p0f in a jail on FreeBSD 12? I'm getting two errors
>> one about bpf not being available, the other about how the jail is
>> trying to sniff the host's network interface. The tcpdump-type
>> expression is 'tcp dst 1515'
>> Thanks.
>> Dave.
>> _______________________________________________
>> freebsd-questions at freebsd.org  mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to
>> "freebsd-questions-unsubscribe at freebsd.org"
> I see you have gotten no replies. This maybe to the lack of any details
> provided by you. You will get better results if you provide details
> about what your trying to do, what hardware you are using and what
> version of FreeBSD you are running. BY default bpf is disabled for
> jails. Have no idea what pof is.

More information about the freebsd-questions mailing list