Application container attached to WireGuard interface?

Hi,

I am trying to have an instance (application container) attached to a WireGuard interface on the host, essentially to force all traffic from that instance to go through the tunnel.

I am not an expert when it comes to network namespaces, veth/bridge interfaces etc. so I would appreciate any advice for how to make this happen.

My first thought was that having the WireGuard interface on host as normal with the AllowedIPs `0.0.0.0/0, ::/0` would cause all other host traffic to go through the tunnel too since it creates routes, which I don’t want. So I thought to put this WireGuard interface into a separate namespace, but then I couldn’t figure out how to attach it to an instance from that other namespace.

Any advice is appreciated!