I’ve installed Incus on my Ubuntu 24.04 (through system packages) and configured the following Netplan:
$ netplan status --all
Online state: online
DNS Addresses: 127.0.0.53 (stub)
DNS Search: .
● 1: lo ethernet UNKNOWN/UP (unmanaged)
MAC Address: 00:00:00:00:00:00
Addresses: 127.0.0.1/8
::1/128
● 2: enp0s31f6 ethernet UP (networkd: enp0s31f6)
MAC Address: 48:4d:7e:fb:ee:be (Intel Corporation)
Bridge: br-ex
● 3: br-ex bridge UP (networkd: br-ex)
MAC Address: 42:e5:16:42:ab:b3
Addresses: 192.168.18.100/24
fe80::40e5:16ff:fe42:abb3/64 (link)
DNS Addresses: 8.8.8.8
1.1.1.1
Routes: default via 192.168.18.1 (static)
192.168.18.0/24 from 192.168.18.100 (link)
fe80::/64 metric 256
Interfaces: enp0s31f6
● 4: br-in bridge DOWN/UP (unmanaged)
MAC Address: 00:16:3e:e3:19:d4
Addresses: 10.82.109.1/24
fd42:488d:f93d:3a76::1/64
fe80::216:3eff:fee3:19d4/64 (link)
Routes: 10.82.109.0/24 from 10.82.109.1 (link)
fd42:488d:f93d:3a76::/64 metric 256
fe80::/64 metric 256
That is, I’ve created a br-ex bridge that has the enp0s31f6 as it’s interface. This way, I can use this bridge as the network and the instances get an IP from my LAN.
The bridge created by Incus is the br-in. What I want is: instances with NIC devices eth0 and eth1 for br-in and br-ex, respectively, each one with an IP (from DHCP or set manually).
You misunderstood, he means only eth0 is preset to use dhcp. Other ports don’t have any config preset. You can manually config other network port according to the instance’s network manager’s instruction.
At the time this thread was opened there was no other option to get a second NIC working with DHCP or similar. As far as I remember this has been fixed / improved in one of the later Incus versions Default routes and multiple DHCP clients for OCI containers.
Have you tested to assign a second NIC device to an OCI if it retrieves an IP? It works for me on latest Incus 6.21 version.
I reinstalled Incus to use Zabbly repository source, and now my Incus is on version 6.21 as well. To try what you suggested I’ve created a profile with two interfaces:
For the record, I didn’t configured anything inside the container, as I expect to work “out-of-box”. Also, maybe it would be interesting to show my Netplan config itself, if something is missing:
Clean start is always good, makes it much easier to debug.
Given that you get an IPv6 means your network setup is working in general. Unfortunately IPv4 works a bit different compared to IPv6 to retrieve an IP.
Unfortunately all images provided from images.linuxcontainer.org only have the default eth0 configured to retrieve IPv4 over DHCP. You need to either add a cloud-init section to your profile or image or you go with static IPs.
One issue you are facing with two NIC’s is which one should be used for the default route. From what I remember the second one wins with default settings. So I decided to go with static IP’s on my second interface but your use case or milage might vary.
For a test try to add a static IP to the second interface: