Setting network speed limits on container doesn't work (Invalid device option "limits.ingress")

I have a container that I would like to limit limits on the upload and download speeds. My container was set up with the default profile, to which I appended another profile called “macvlan” to configure networking using macvlan.

I read that I should be able to limits network speeds with (eth0 is the network adapter name in my macvlan profile).

lxc profile device set macvlan eth0 limits.ingress 100Mbit 
lxc profile device set macvlan eth0 limits.egress 100Mbit 

When I do so, I get the message

Error: Device validation failed for “eth0”: Invalid device option “limits.ingress”

(and the same for limits.egress). I can’t seem to find anything about this online. Why doesn’t this work?

Macvlan devices don’t support limits I’m afraid.

See Instances | LXD

Well that explains things. I’ll see if I can find other ways to limit speeds. I tried wondershaper inside my container but that didn’t work either.