Question: Interface renaming with physical networking

Hi forum,

I currently use lxc 3.0.1 and have the options
lxc.net.0.type=phys
lxc.net.0.link=wlo1
lxc.net.0.name=wlan0
in my container config. So I am using the host-interface wlo1 and rename it to wlan0
in my container. When I stop the container, the interface is handed back to
the host namespace, but is still named wlan0. Which option do I have to add in my config,
so the container changes the name of the interface back to wlo1 again, when it is being destroyed?

Thanks in advance for helping.

Hi,

This is a known issue unfortunately.

This got partially fixed for live-detaching here: https://github.com/lxc/lxc/pull/3107/commits/e4103cf63f3e24667680544303e7c7230b3d508c

However stop-time rename in LXC still exists as an issue. It is on my list to look at though :slight_smile:

If you want it to not change names in the short term the best/only thing to do is to set the .name property to the same as it is on the host, i.e wl01 so its the same inside the container.

Thanks
Tom

I’ve logged the issue here https://github.com/lxc/lxc/issues/3131 where you can track it if you like.