From Notes Wiki
Jump to: navigation, search
Home > CentOS > CentOS 7.x > CentOS 7.x virtualization > CentOS 7.x lxc > CentOS 7.x lxc container networking

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 '' 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 '' in this file appropriately.