add LXC config for shared bridge

This commit is contained in:
Max Erenberg 2021-06-12 22:25:48 -04:00
parent 141d609108
commit b3cc8f933f
1 changed files with 9 additions and 4 deletions

View File

@ -116,10 +116,15 @@ iface lxcbr0 inet dhcp
Replace enp1s0 by the name of the default interface in the VM.
Then, restart the VM.
If default interface is not `eth0` then update `roles/network_setup/templates/interfaces.j2` and `dns/templates/dnsmasq.conf.j2`
Once you have restarted the VM, take note of its IP address on lxcbr0,
and write it to the variable `host_ipv4_addr` in the `hosts` file.
Now open `/etc/lxc/default.conf` and make sure it looks like the following:
```
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
```
(The hwaddr can be different.) This will ensure that new containers
have this configuration by default.
## Creating the LXC containers
Start a root shell with `sudo -s`.