So, you have an extra physical interface and you want to have it used exclusively by a specific container (coincidentally running Ubuntu 14.04).
If the network interface on the host is enx00, then to make it available exclusively to the container router1, you need to run:
lxc config device add router1 enx00 nic nictype=physical parent=enx00 name=enx00
Here is the breakdown,
lxc config device add, to add a device
router1, to the container called
enx00, this is the name that LXD will use for this device. Can change if you wish.
nic, it’s a NIC (network interface)
nictype=physical, this does the whole work. It’s a physical interface, and the whole interface goes into the container. Read the LXD documentation on NICs for more.
parent=enx00, this is important to use the correct interface on the host.
name=enx00, that is the name of the interface inside the container. You can obviously change it.
You can add a physical NIC to a container even if the container is already running. It will appear instantaneously.
In the container, you can view the new network interface with
The interface by default is down, and you need to bring it up yourself (i.e.
sudo ifconfig enx00 up).