Summary: | ipfilter ipf.rules & ipnat.rules not loading when vnet jail starts | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | joeb1 | ||||
Component: | kern | Assignee: | Cy Schubert <cy> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | cy | ||||
Priority: | Normal | ||||||
Version: | 12.1-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
joeb1
2020-07-19 15:50:59 UTC
In the jail's /etc/rc.d/ipfilter, change In the jail's /etc/rc.d/ipfilter, change KEYWORD: nojail to KEYWORD: jail. Simply delete the line. Created attachment 216593 [details]
Fix
If you're into mergemaster or etcupdate, apply this patch to your src tree or directly to /etc/rc.d.
Comment on attachment 216593 [details]
Fix
I tested this by changing the files by hand inside of a vnet jail and restarted the vnet jail. The ipf.rules and ipnat.rules were auto loaded at vnet jail start time. Not using ippool so not tested.
Sure hope to see this fix included in 12.2 and 13.0 when they get published.
You did good job getting this fixed so fast. Thank you Cy.
A commit references this bug: Author: cy Date: Thu Jul 23 17:39:46 UTC 2020 New revision: 363452 URL: https://svnweb.freebsd.org/changeset/base/363452 Log: Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail. PR: 248109 Reported by: joeb1@a1poweruser.com MFC after: 2 weeks Changes: head/libexec/rc/rc.d/ipfilter head/libexec/rc/rc.d/ipmon head/libexec/rc/rc.d/ipnat head/libexec/rc/rc.d/ippool Good news I manually hand changed the ipfilter, ipmon, ipnat, ippool scripts in /etc/rc.d replacing the nojail with nojailvnet. Restarted the vnet jail and the ipmon log is now logging to the /var/log/security file in side of the vnet jail just like I wanted. Looks like the solution for this pr not only causes the ipf.rules file and ipnat.rules file to be loaded at vnet jail start time but also fixed the ipmon log problem described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248112 A commit references this bug: Author: cy Date: Sun Aug 2 04:25:14 UTC 2020 New revision: 363768 URL: https://svnweb.freebsd.org/changeset/base/363768 Log: MFC r363284-r363285, r363452, r363670 r363284: pfil_run_hooks() can be called recursively, so we have to define FASTROUTE_RECURSION in fil.c Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD r1.31 r363285: Fix incorrect byte order in ipfstat -f output. - make sure frag is initialized to 0 - initialize ipfr_p field NetBSD PR: 55137 Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD fil.c r1.32, ip_frag.c r1.8 r363452: Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail. PR: 248109 Reported by: joeb1@a1poweruser.com r363670: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. Changes: _U stable/12/ stable/12/contrib/ipfilter/iplang/iplang_y.y stable/12/contrib/ipfilter/ipsend/arp.c stable/12/contrib/ipfilter/ipsend/ipresend.c stable/12/contrib/ipfilter/ipsend/ipsend.c stable/12/contrib/ipfilter/ipsend/iptest.c stable/12/contrib/ipfilter/ipsend/iptests.c stable/12/contrib/ipfilter/ipsend/sock.c stable/12/libexec/rc/rc.d/ipfilter stable/12/libexec/rc/rc.d/ipmon stable/12/libexec/rc/rc.d/ipnat stable/12/libexec/rc/rc.d/ippool stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_frag.c fixed |