If I want to attach the network interface to the LXC we can specify it in the lxc config file as
lxc.network.type=phys
lxc.network.link=eth3
lxc.network.name=eth1
or we can run the below command as part of lxc hook to attach it during lxc-start
# on the host:
pid=$(lxc-info -pHn foobar)
ip link set dev eth3 netns $pid name eth1
Now I am looking for the option of removing or detaching the above attached phys interface from the container back to the host and how can I achieve it? I could not find anything in 'ip link help' option so far.