CentOS 7.x lxc container networking

From Notes_Wiki

Home > CentOS > CentOS 7.x > Virtualization > Lxc > CentOS 7.x lxc container networking

To configure lxc container networking, we can use software bridges on the host. For creating desired network using software bridges refer to CentOS 7.x Managing virtual networks using libvirt virsh command

Once network bridge is available to configure lxc container to use the desired bridge use following steps:

  1. Ensure that container is stopped
  2. Edit /var/lib/lxc/<container-name>/config file
  3. Update 'lxc.network.link' value to desired bridge name
  4. Start container and verify
    Note that if the network requires static IP addressing then appropriate guest network configuration must be done.


Update default lxc container bridge

To make a specific network-bridge default for all new containers edit '/etc/lxc/default.conf' and update value of 'lxc.network.link' in this file appropriately.


Home > CentOS > CentOS 7.x > Virtualization > Lxc > CentOS 7.x lxc container networking