I deploy baremetal with KVM Pod Setups. Then I snap install LXD then configure LXD using my preseed file.
Create a LXD Container using the lxdbr0 network.
can ping google
can ping router
can’t access local networks
Move LXD to an internal network bridge
can ping google
can ping router
can access everything on local network
I’m not an IP Tables expert but I think there’s an IP Tables rule that might be defaulting all traffic to virbr0 so this is why lxdbr0 containers can’t access anything on the local LAN, only outside into the internet.
I’m not sure how to fix this if the baremetal is installed through MAAS.
I don’t have this problem if I manually install Ubuntu on the baremetal, manually install libvirt and do a LXD Preeseed init.
default via 192.168.143.1 dev br-eno1 proto static
10.138.254.0/24 dev lxdbr0 proto kernel scope link src 10.138.254.1
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
192.168.141.0/24 dev br-eno2.21 proto kernel scope link src 192.168.141.54
192.168.142.0/24 dev br-eno3 proto kernel scope link src 192.168.142.51
192.168.143.0/24 dev br-eno1 proto kernel scope link src 192.168.143.80
192.168.144.0/24 dev br-eno2.24 proto kernel scope link src 192.168.144.33
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N LIBVIRT_FWI
-N LIBVIRT_FWO
-N LIBVIRT_FWX
-N LIBVIRT_INP
-N LIBVIRT_OUT
-A INPUT -i lxdbr0 -p icmp -m icmp --icmp-type 12 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -i lxdbr0 -p icmp -m icmp --icmp-type 11 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -i lxdbr0 -p icmp -m icmp --icmp-type 3 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -i lxdbr0 -p tcp -m tcp --dport 53 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -i lxdbr0 -p udp -m udp --dport 53 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -i lxdbr0 -p udp -m udp --dport 67 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A INPUT -j LIBVIRT_INP
-A FORWARD -o lxdbr0 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A FORWARD -i lxdbr0 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A FORWARD -j LIBVIRT_FWX
-A FORWARD -j LIBVIRT_FWI
-A FORWARD -j LIBVIRT_FWO
-A OUTPUT -o lxdbr0 -p icmp -m icmp --icmp-type 12 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -o lxdbr0 -p icmp -m icmp --icmp-type 11 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -o lxdbr0 -p icmp -m icmp --icmp-type 3 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -o lxdbr0 -p tcp -m tcp --sport 53 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -o lxdbr0 -p udp -m udp --sport 53 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -o lxdbr0 -p udp -m udp --sport 67 -m comment --comment "generated for LXD network lxdbr0" -j ACCEPT
-A OUTPUT -j LIBVIRT_OUT
-A LIBVIRT_FWI -d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A LIBVIRT_FWI -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A LIBVIRT_FWO -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A LIBVIRT_FWO -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A LIBVIRT_FWX -i virbr0 -o virbr0 -j ACCEPT
-A LIBVIRT_INP -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A LIBVIRT_INP -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A LIBVIRT_INP -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A LIBVIRT_INP -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A LIBVIRT_OUT -o virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A LIBVIRT_OUT -o virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A LIBVIRT_OUT -o virbr0 -p udp -m udp --dport 68 -j ACCEPT
-A LIBVIRT_OUT -o virbr0 -p tcp -m tcp --dport 68 -j ACCEPT
Inside the Container
ip route
default via 10.138.254.1 dev eth0 proto dhcp src 10.138.254.61 metric 100
10.138.254.0/24 dev eth0 proto kernel scope link src 10.138.254.61
10.138.254.1 dev eth0 proto dhcp scope link src 10.138.254.61 metric 100
How does your home network return traffic to that range, did you add a route to your router or are you using NAT for traffic from that bridge to external?
I have the routes defined on the router too. I know it works because the manual installedUbuntu machines have Libvirt and LXD running inside. LXCs on lxdbr0 can get to the Internal and External network. KVMs on virbr0 can also get to the Internal and External network.
The MAAS deployed machines with LXD in lxdbr0 can’t get to the internal networks, if I move the LXC Container to the bridged network on the internal LAN then it can get into the internal and external networks.
when you say you can’t access the local network, do you mean the network:
192.168.143.0/24
can you ping 192.168.143.80 (which looks like the address of your host machine)?
have you tried using tcpdump to see where the traffic is dying? e.g. tcpdump -n -i *interface* icmp and host *a.b.c.d* can help you isolate where the pings are disappearing. Set interface to e.g. lxdbr0, then br-eno1, and also try without specifying the interface, that way you can try to see where the traffic is being dropped.
Also, do you have any nat rules? : iptables -S -t nat