Sysctl net.ipv4.ip_forward not getting applied on boot (container)

I noticed an “issue” today, i setup wireguard and couldn’t get the incoming connection to access the networking, and i had forwarding enabled so i couldn’t figure out what the issue was.

Then i tried sysctl -p (which i had done before but had rebooted in-between) and then i started to work.
So i then rebooted again to see if it still worked, but no, i had to again do sysctl -p.

eventually i found that you could set it in the config of the container which seems to make it persist,
think it was something like.

lxc set config instance lxd.raw

the nic that the container is connected to is a bridge, so the container gets an ip from the network just like the host, if that plays a role.

Is this working as intended or am i just missing something?
Cause i kind of expect setting the sysctl in the container to do what it does,
except if it needs some special privileges of course.