LXD bridge w/ no NAT does not work

networking

(Alexander) #1

Hello
I have Ubuntu 18.04 LXD Host with one physical interface enp4s0. I set very simple file /etc/netplan/01-netcfg.yaml with the following content

network:
version: 2
renderer: networkd
ethernets:
enp4s0:
dhcp4: no
dhcp6: no

== and ==

I created LXD bridge lxdbr0 with the following configuration:

config:
bridge.driver: native
bridge.external_interfaces: enp4s0
ipv4.address: 192.168.0.77/24
ipv4.firewall: “false”
ipv4.nat: “false”
ipv6.address: none
ipv6.nat: “false”

Question:
=======
Why is LXD Host unreachable? From my remote workstation having IP address 192.168.0.101/24 I cannot ping LXD Host’s ip address 192.168.0.77.

I see on LXD Host:
#ip link show
lxdbr0: <NO-CARIER, BROADCAST,MULTICAST,UP>

Why is virtual bridge lxdbr0 down? What am I missing?

In advance, thanks for your answer
Alexander


#2

You shouldn’t use the same subnet on multiple network interfaces in the same network stack, in your case both enp4s0 and lxdbr0 are configured with IP addresses in 192.168.0.0/24.I assume.

You should choose another subnet for lxdbr0 and configure a static route to that subnet on the router with the host as gateway.

I you don’t want containers to be in a separate network then there are two solutions listed in
https://blog.ubuntu.com/2016/04/07/lxd-networking-lxdbr0-explained macvlan or adding another bridge which is bridged onto your main NIC.


(Alexander) #3

Hello Mikma

Thanks for your answer.

I do not use the same subnet on multiple network interfaces: LXD Host has its physical interface enp4s0 unconfigured w/ no ip address --and-- its virtual interface lxdbtr0 configured w/ ip address 192.168.0.77/24.

Virtual bridge lxdbr0 is enslaving physical interface enp4s0.

See my configuration files in the initial post.

It looks like virtual lxdbr0 does not use physical interface enp4s0 to communicate outside from the LXD Host.
On LXD Host I see :
#ip link show
lxdbr0: <NO-CARIER, BROADCAST,MULTICAST,UP> …

I sit at remote workstation w/ ip address 192.168.0.101/24. and problem is that from remote workstation I cannot ping LXD Host.

Alex