matching receive interface and xmit interface in single rule

From: Özkan KIRIK <ozkan.kirik_at_gmail.com>
Date: Thu, 04 Nov 2021 06:26:15 UTC
Hi,

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?

Have a nice day
Regards