r/opnsense • u/Hallo_5000 • 6d ago
Isolating every interface of a group
I have a larger number (150+) of interfaces in a single group.
I want traffic between those interfaces to be blocked, while allowing traffic between clients on the same interface.
Right now I have a rule (NOT quick) which allows every traffic from the group to something outside of the group and for each interface in the group I have an additional rule to allow traffic inside of that interface (PASS: i1 -> i1).
I want the same same behavior without bloating my rule table with 150 rules of the same template.
Can I somehow add a rule to a group, which allows traffic for every member with itself?
14
u/clarkn0va 6d ago
Two hosts on the same subnet will communicate directly. There's no need to create a firewall pass rule and such a rule will match no traffic.
5
u/corelabjoe 6d ago
Floating rules apply to multiple interfaces or interface groups for things like this...
However this seems like a somewhat unique design. I have not run across a use case for that many interfaces and I feel like there's likely a better way to achieve what you're trying to do.
Why so many interfaces? Even on large enterprise firewall deployments we don't have that many interfaces.... There has to be a reason?
If you explain the use case or goal better, there is likely a more optimal way to run the firewall and your ruleset that is easier to manage.
2
u/IsaacFL 6d ago
I assume you have a firewall group setup containing each of the interfaces. Just write rules in the Group. I do something similar on a smaller scale.
First you will need to have a pass rule src Group Network to dest the firewall itself for ports you want to allow ie DNS NTP.
Rule to Block src any to dest Firewall (to protect admin gui etc)
Then any rules to pass src Group Network to internal host alias you might want to allow universal access (optional).
Next a rule to block src Group Network to Group Network. (the traffic inside the interface does not need to route thru the firewall)
Finally a rule Pass src Group Network to any. ()
the pass rules are all ip version any, protocol TCP/UDP. Block rules are any any
I put stuff like ICMP in the floating rules.
1
u/SuccotashOk4084 6d ago
Floating with !RFc1918 and that should automatically block all of vlans from talking assuming that opnsense is handing out the network's and is the DHCP server