Every (default) IncusOS NIC is a bridge!

I felt like sharing this as it kept me occupied for a while:

My intention was to create a container or VM simply attached to IncusOS only network interface (I used to run this on NixOS, simply having a NixOS configured “br0” I used to attach to).

Web-UI doesn’t seem to allow me to select my “eno1” - I couldn’t find a way to use this - maybe I just missed it or this could be something to enhance.

Command line (incus) I struggled quite a bit because I wanted to create a bridge using “eno1”. Eventually I learned from one of the videos that IncusOS default initialization creates all network devices as bridges, so “eno1” is already a bridge I can just attach to! Would be great to have this in the documentation!

Now after the fact this is surprisingly straight forward - but this is what I would have needed to get there in minutes:

$ incus admin os system network show
WARNING: The IncusOS API and configuration is subject to change

config:
  interfaces:
  - addresses:
    - dhcp4
    - slaac
    hwaddr: de:ad:be:ef:00:01
    lldp: false
    name: eno1
    required_for_online: "no"
state:
  interfaces:
    eno1:
      addresses:
      - 192.168.1.251
      hwaddr: de:ad:be:ef:00:01
      mtu: 1500
      roles:
      - management
      - cluster
      routes:
      - to: default
        via: 192.168.1.1
      speed: "1000"
      state: routable
      stats:
        rx_bytes: 5.023584e+06
        rx_errors: 0
        tx_bytes: 776760
        tx_errors: 0
      type: interface

$ incus profile show bridged
config: {}
description: Incus bridged profile
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: eno1
    type: nic
  root:
    path: /
    pool: local
    type: disk
name: bridged

1 Like

Replying to my own post - I have since learned that I did this incorrect:

There is a tutorial part of the IncusOS Documentation describing this in more detail, see Directly attach instances to host network - IncusOS documentation

Every IncusOS NIC is a bridge - this seems to be correct!

Reason the initial NIC/bridge isn’t showing up in WebUI is the interface roles. If only installing with default seeding the NIC doesn’t get the “instances” role assigned (I think only management). Thus the WebUI correctly doesn’t display this.

To change this use

$ incus admin os system edit network

and add the full roles:

    roles:
    - management
    - instances

As an example, in my full static configuration this looks like this:

config:
  dns:
    domain: example.com
    hostname: myincusos
    nameservers:
    - 192.168.13.1
    - 192.168.13.2
  interfaces:
  - addresses:
    - 192.168.13.252/24
    hwaddr: 11:22:33:44:55:66
    lldp: false
    name: enp0s31f6
    required_for_online: "no"
    roles:
    - management
    - instances
    routes:
    - to: 0.0.0.0/0
      via: 192.168.13.1
  time:
    ntp_servers:
    - 192.168.13.1
    - 192.168.13.2
    timezone: CET

hth