Requesting Network Setup Help - 2 networks with different access

Hello :slight_smile: I’m looking for a little help. I have had LXC running to serve (small) websites for a little while and really enjoy how cool and lightweight it is !

I’m looking to set up the following and having trouble … using Ubuntu Server as a host.

1 - Physical server and several containers that all see the physical LAN and get distinct DHCP addresses on that network.


2 - A second network allowing the physical server and the containers to communicate independent of the outside network.

Thanks in advance for any help :slight_smile:

Hi @g01d10x,
Just adding another network interface as eth1 on every containers and setup network address from 5.5.5.x should be enough I suppose.

A couple years ago I have experimenting Macvlan network. I following this guide. I don’t use this method right now. Just experimenting. But what I remember with this macvlan, (your host?) can’t connect to C1 using, or C2 using But other machines on physical LAN can connect to C1 or C2 or C3 or the host (using 192.168.1.x). Or Internet can connect to C1 or C2 with the help of “My Router” forward’s rule. I don’t recall if C1 can connect to C2 using <-> Maybe if 5.5.5.x <-> 5.5.5.x ?

In macvlan mode you cant access from containers to host, have a look at that documentation.

Hi there :slight_smile: Yes that’s my experience so far as well … the 192.168.x.x. connections don’t allow containers or the host to speak to each other, but another machine can connect in, no problem. That’s what I’m hoping to solve, but no solution yet. … I am hoping to get time to give @cemzafer’s solution a try later tonight.

By default LXD will create a private bridge called lxdbr0, which instances will connect to on eth0.

You can then also create a manual bridge, e.g. br0 (see and then add a new NIC device to the instances or profile using:

lxc config device add <instance> eth1 nic nictype=bridged parent=br0

Note: Your external network on br0 may provide DHCP, and lxdbr0 provides DHCP, so if your instances run a DHCP client on both NICs they will get 2 conflicting default gateways.

So you may want to disable DHCP on lxdbr0 or statically configure the instances with 2 NICs.