That's just a simple rule on your firewall. I don't understand why you think you need to do this though.
Anyway, apart from this possibly impractical usecase, it just seems like an interesting problem.
I'll just go with a standard bridge + ip/nftables setup then. Thanks for the input.