Hi,
My LXD dev server:
Ubuntu 20.04
LXD 4.3
My netplan:
network:
version: 2
renderer: networkd
ethernets:
enp0s25:
dhcp4: no
bridges:
brvlan:
dhcp4: no
addresses:
- 192.168.10.11/24
gateway4: 192.168.10.1
nameservers:
addresses:
- 192.168.10.1
interfaces:
- enp0s25
I create a lanprofile
profile
config: {}
description: conf for eth on lan dhcp
devices:
eth0:
nictype: bridged
parent: lxdbr0
type: nic
eth1:
nictype: bridged
parent: brvlan
type: nic
root:
path: /
pool: data
type: disk
name: lanprofile
I use Terraform to create lxd container. But same problem when I create manually.
lxc launch ubuntu:focal -p lanprofile
Result, my lxc list
:
+----------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| novel-moose | RUNNING | 192.168.10.75 (eth0) | fd42:ec75:4e34:1f56:216:3eff:fe0a:6e27 (eth1) | CONTAINER | 0 |
+----------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
This is strange.
- No two Interfaces in IPv4
- I didn’t request IPv6 for eth1
I need to manually change netplan in container by:
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp6: false
eth1:
dhcp4: true
dhcp6: false
And after restart container, my lxc list
:
+----------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| novel-moose | RUNNING | 192.168.10.75 (eth0) | fd42:ec75:4e34:1f56:216:3eff:fe0a:6e27 (eth1) | CONTAINER | 0 |
| | | 10.180.203.56 (eth1) | | | |
+----------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
But I don’t understand.
Why eth0 have an ip like 192.168.x.x
and eth1 10.180.x.x
In my lanprofile, it’s the reverse configuration!
And why IPv6 stay?
Is it possible to launched a new container with two interface up?
Another thing. When I started lxd server, my first netplan was with dhcp IP on brvlan, but each time I launched new container, IP from brvlan changes. strange again.
Can you help me?
Thanks