A container cannot access your Ethernet adapter directly. It requires a bridge between the Virtual Ethernet and the actual Ethernet. Recent Ubuntu distributions create an Ethernet bridge automatically when you install the lxc package. Debian and Fedora may require that you manually create the bridge. To create a bridge on Fedora, use the libvirt package to create a virtual bridge first:
# systemctl start libvirtd
Then, edit /etc/lxc/default.conf to reference virbr0 instead of lxcbr0:
lxc.network_link = virbr0
If you've already created a container, edit the config file for that container as well.
To create a bridge on Debian systems, you must edit the network configuration and the container configuration files.
Edit /etc/lxc/default.conf. Comment out the default empty network and add a definition for the lxc bridge:
# lxc.network.type = empty
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flage = up`
Next, create the networking bridge:
# systemctl enable lxc-net
# systemctl start lxc-net
Containers created after these steps are performed will have networking enabled. Network support can be added to the existing containers by adding the lxc.network lines to the container's config file.