Bug 259840

Summary: pf: matching both receive and xmit interface in single rule
Product: Base System Reporter: Ozkan KIRIK <ozkan.kirik>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People    
Priority: ---    
Version: 12.2-STABLE   
Hardware: Any   
OS: Any   

Description Ozkan KIRIK 2021-11-15 04:09:29 UTC
I'm looking for a solution to match a traffic received on igb0 and xmit on igb1.
According to man page, ipfw(8) supports this syntax:

ipfw add deny ip from any to any out recv ed0 xmit ed1

     The recv interface can be tested on either incoming or outgoing
     packets, while the xmit interface can only be tested on outgoing
     packets.  So out is required (and in is invalid) whenever xmit is
     used.


I used an workaround for this requirement:
- pass quick in on igb0 all keep state (if-bound) tag rule1_IN_IGB0
- pass quick out on igb1 all tagged rule1_IN_IGB0 keep state (if-bound)


But this syntax has disadvantages:
- if tags used for NAT, one of the tags will be lost Because of pf has
only single tag support.
- reading and writing of rules become complicated

Is it possible to add support for this feature like ipfw or
alternatively is it possible to have a separate tag for nat tag?

Regards