Computer Networking Fundamentals For Developers, DevOps, and Platform Engineers
When using lxc launch to create and start a container, the container will typically obtain its IP address via DHCP from the LXC host's default network bridge, which is often lxcbr0. The DHCP server responsible for assigning these IPs is usually dnsmasq, which is managed by lxc-net on the host system.
Google: lxc launch dhcp location
https://www.google.com/search?q=lxc+launch+dhcp+location
Host-level DHCP configuration:
Container-level network configuration:
-- Inside the LXC container, the network configuration, including whether to use DHCP, is handled by the container's own operating system. This is typically configured in files like /etc/network/interfaces (for Debian/Ubuntu) or via tools like netctl (for Arch Linux).
-- When lxc launch creates a container, it usually sets up the container's network interface (e.g., eth0) to obtain an IP address via DHCP by default, leveraging the host's lxcbr0 bridge.
Connecting an LXC container to a br0 bridge allows the container to participate directly in the host's local area network (LAN), similar to a physical machine. This provides direct network access to and from the container without network address translation (NAT) or port forwarding, making it appear as an autonomous host on the network.
Creating the br0 bridge on the host:
This involves configuring the host's network settings to create a bridge interface (e.g., br0) and attaching the physical network interface (e.g., eth0 or enpXsY) to it. The IP configuration of the physical interface is then moved to the br0 bridge.
Configuring the LXC container to use the br0 bridge:
This involves modifying the container's network configuration or profile to specify br0 as its parent bridge. For LXD, this is done using commands like
lxc config device add <container_name> eth0 nic nictype=bridged parent=br0.
In the context of LXC (Linux Containers), a "parent bridge" refers to a virtual network bridge on the host system that LXC containers connect to for network connectivity.
google: how to create lxc.network.link = br0
https://www.google.com/search?q=how+to+create+lxc.network.link+%3D+br0
ls /etc/NetworkManager/
https://forums.linuxmint.com/viewtopic.php?t=329441
lxc.container.config(5)
lxc.container.config(5) [network]
OSI model (Wikipedia)
Internet protocol suite (Wikipedia)
Project configuration (Canonical LXD)