I'm locking down the egress of my Linux box, making OUTPUT chain default deny.
My wireguard peers are from the subnet 10.1.0.0/16
. Originally I thought I can just -A OUTPUT -d 10.1.0.0/16 -j ACCEPT
, and while that is needed, it is not sufficient in itself.
As confirmed by tracing, the physical UDP connection to the wireguard peer also needs allowing, which makes sense on second thought.
Now, I could go on and manually allow the wireguard port of the peer endpoints. But I wonder if there's some more automatic mechanism, that would relate the physical UDP packets to the already allowed tunnel packet, and automatically allow it?