My netplan config yaml on the host
network:
version: 2
renderer: networkd
ethernets:
enp1s0:
dhcp4: false
bridges:
br0:
interfaces:
- enp1s0
dhcp4: true
routes:
- to: default
via: 10.0.0.1
nameservers:
search: [ap.local]
addresses: [10.0.0.10, 1.1.1.1]
Creating a new container will work and allows the DHCP offer/lease from the network the host is attached to into the container but there is no default route added inside the container.
The results of ip route show from inside the container
10.0.0.0/21 dev eth0 proto kernel scope link src 10.0.0.198 metric 100
10.0.0.10 dev eth0 proto dhcp scope link src 10.0.0.198 metric 100
Instead of manually running the command to add the route for the default gateway to each container when they’re being created, is there something I can set to allow the DHCP lease to create the route automatically?
Probably a stupid question but my Google-Fu is failing me at the moment.
Thanks in advance to anyone who helps