Unable to open /dev/pf device inside the jail

Kristof Provost kp at freebsd.org
Sun Dec 16 11:15:55 UTC 2018


On 2018-12-16 01:23:21 (+0100), Hubert Hauser <atypical at autisticstory.net> wrote:
> I'm trying to set TransPort setting in the torproxy jail but when I try
> to start Tor inside the jail I'm giving errors:
> 
> |root at torproxy:~ # service tor restart Stopping tor. Waiting for PIDS:
> 95355. Starting tor. Dec 16 00:23:07.760 [notice] Tor 0.3.4.9
> (git-4ac3ccf2863b86e7) running on FreeBSD with Libevent 2.1.8-stable,
> OpenSSL 1.0.2o-freebsd, Zlib 1.2.11, Liblzma 5.2.3, and Libzstd 1.3.5.
> Dec 16 00:23:07.760 [notice] Tor can't help you if you use it wrong!
> Learn how to be safe at
> https://www.torproject.org/download/download#warning Dec 16 00:23:07.760
> [notice] Read configuration file "/usr/local/etc/tor/torrc". Dec 16
> 00:23:07.774 [notice] Scheduler type KISTLite has been enabled. Dec 16
> 00:23:07.774 [notice] Opening Socks listener on 127.0.1.1:9050 Dec 16
> 00:23:07.774 [notice] Opening DNS listener on 127.0.1.1:9053 Dec 16
> 00:23:07.774 [notice] Opening Transparent pf/netfilter listener on
> 127.0.0.1:9040 Dec 16 00:23:07.774 [warn] open("/dev/pf") failed: No
> such file or directory Dec 16 00:23:07.774 [notice] Closing
> partially-constructed Socks listener on 127.0.1.1:9050 Dec 16
> 00:23:07.774 [notice] Closing partially-constructed DNS listener on
> 127.0.1.1:9053 Dec 16 00:23:07.774 [notice] Closing
> partially-constructed Transparent pf/netfilter listener on
> 127.0.0.1:9040 Dec 16 00:23:07.775 [warn] Failed to parse/validate
> config: Unable to open /dev/pf for transparent proxy. Dec 16
> 00:23:07.775 [err] Reading config failed--see warnings above.
> /usr/local/etc/rc.d/tor: WARNING: failed to start tor|
> 
> I've created this jail using ezjail-admin tool. Could anyone tell me why
> I'm unable to change host pf settings and how can I do it inside the jail?
> 
Assuming that you've got a vnet jail that is possible, but you'll need
to tweak your devfs configuration to give the jail the pf device node.

I edited /etc/defaults/devfs.rules to add 'add path pf unhide' to the
'[devfsrules_jail=4]' section.
It's probably cleaner to do that in /etc/devfs.rules though.

Regards,
Kristof


More information about the freebsd-hackers mailing list