Difference between revisions of "CentOS 7.x lxc container networking"

From Notes_Wiki
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x_lxc|CentOS 7.x lxc</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x virtualization|Virtualization]] > [[CentOS 7.x lxc|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]]
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]]
Line 11: Line 10:
#:Note that if the network requires static IP addressing then appropriate guest network configuration must be done.
#: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.
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.
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x virtualization|Virtualization]] > [[CentOS 7.x lxc|Lxc]] > [[CentOS 7.x lxc container networking]]

Latest revision as of 09:00, 25 August 2022

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