Sequence Number Cloning Firewall Rules

Started by mooh, November 16, 2026, 04:49:55 PM

Previous topic - Next topic
It looks like the sequence numbers of cloned rules are identical to that of the original rule. I understand that this is technically correct and it didn't cause problems for me, yet. But what other feature is there that keeps the PF evaluation order the same as the rules display in the UI? I would expect the UI to recalculate the sequence to match the place in the UI list, the same way as the sequence is recalculated when rules are moved around.

November 16, 2026, 05:12:13 PM #1 Last Edit: November 16, 2026, 05:14:53 PM by Monviech (Cedrik)
No, sequence numbers of cloned rules are +1 the old rule.

https://github.com/opnsense/core/commit/b1034efade9acfaedee95bc3e32990d21216abf0

That was recently changed (should be in 26.7.9 I think).
Hardware:
DEC740

There is also the multi rule move now you can use to reorder rules, here's a trick:

https://github.com/opnsense/core/pull/11008#issuecomment-6145426296
Hardware:
DEC740

Thanks for pointing that out. The instances with identical numbers I found had been created in the past. I only noticed it now because it only shows when the UI is in advanced mode that I had not used before.

Moving rules around is how I fixed it for me.

Yes there were some discussions about this so we tried to accomodate the sequence as best as possible, of course without any migrations happening.

Duplicate sequence is still fine too, the tie breaker is the UUID of the rule in that case (processing order).
Hardware:
DEC740