So, I want to some custom stuff for my home network. To do these things I need a NAT Bridge, a DNS server and a DHCP Server. I want to run these on LXC but thus far I have been unable to do so, and I’m out of ideas on how to do it. I’ve been searching all over google for an answer, but I can’t seem to find it.
In any case I know you can set up a bridge with lxc network create
and that basically sets up a dns server and dhcp server with dnsmasq.
I used netplan to configure myself a bridge like this:
network:
version: 2
renderer: networkd
bridges:
vbr0:
addresses:
- 172.25.0.1/24
I’ve added a lxc container’s interface to my bridge by doing this: lxc config device add app eth0 nic nictype=bridged parent=vbr0 name=eth0
Then I try to add a static ip with this command: lxc config device set app eth0 ipv4.address 198.168.0.4
However, it doesn’t add any IPs to my container and just fails to do anything.
I’m not sure where to go from here or if lxc containers will only accept ips from managed bridges. I’m also not sure what to do with my iptables. I only want to allow devices hooked to my home network to access this lxc network.
I would appreciate it someone could help me.
EDIT: I’m using Ubuntu 20.04.