[lxc-users] LXC Containers and Bridge Networking in Arch Linux

Fajar A. Nugraha list at fajar.net
Wed Jan 4 07:32:23 UTC 2017


On Tue, Jan 3, 2017 at 8:21 PM, Saurabh Deshpande <
saurabh.n.deshpande at gmail.com> wrote:

> Hello Guys,
>
>
> I am trying to set up LXC on Arch Linux with systemd-networkd for
> networking.
> I see that the bridge can be set up to either use DHCP or a static IP but
> we lose a static IP set on actual connected nic (eth0).
> Can someone please tell me if it is possible to achieve below.
> eth0 / ens192 : This should have its own static IP address for connecting
> and managing the host.
> br0 / lxcbr0 : This should have it's own subnet so that all subsequent
> guests will have a IP from the alloted range.
>
>
Do you mean "eth0 and br0 should be in the same network (which has an
external DHCP server, managed by someone else), but eth0 has static ip
address, and br0 manage dynamic ip range for lxc guest"?

If yes -> short answer: not possible. Not really lxc-specific, but generic
TCP/IP networking.

If no -> describe what you want in more detail. Using ASCII art and dummy
IP addresses (e.g. 10.0.0.1, etc) often helps.

The usual scenarios are:
(1) let lxc manage its own bridge, using a private network that exists only
on that host (the default setup). Create NAT for each service in the
container that you need to access from outside the host

(2) create a bridge with host's eth0 as slave, put containers there as
well. The containers will then behave (frm networking perspective) just
like any other host on that network (e.g. it can get dynamic IP address
from whatever-dhcp-server on that network)

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170104/c6e9376b/attachment.html>


More information about the lxc-users mailing list