Starting incus container results in no network inside the container

Hi folks.

https://nixos.wiki/wiki/Incus

i am trying to follow this wiki entry above. it seems i have no network when i create the container. I confirmed can create a shell inside the container but once inside i cant ping anywhere … can anyone suggest what is happening please ?

Here is what i did :

  incus launch images:ubuntu/23.10 ub00 \
    --profile default \
    -c security.nesting=true

 -→ incus profile show default 
config: {}
description: Default Incus profile
devices:
  eth0:
    name: eth0
    network: incusbr0
    type: nic
  root:
    path: /
    pool: store00
    type: disk
name: default
used_by: []

 -→ ifconfig 
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.10  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::7210:e505:ae22:ca8a  prefixlen 64  scopeid 0x20<link>
        ether 04:42:1a:f1:ee:4f  txqueuelen 1000  (Ethernet)
        RX packets 334937  bytes 431382673 (411.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 149980  bytes 12970338 (12.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

incusbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.252.113.1  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fd42:b8d8:ec7c:c832::1  prefixlen 64  scopeid 0x0<global>
        ether 00:16:3e:b8:9e:a9  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 237  bytes 19838 (19.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 237  bytes 19838 (19.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Apparently, this is due to a conflict between NixOS firewall rules and Incus.

See this No Internet on Initial Setup; Instructions Unclear · Issue #525 · lxc/incus · GitHub and Incus on NixOS with tailscale on the side - no internet access for the containers - Incus - Linux Containers Forum for more details.

The recommended solution is to add your incus interface to networking.firewall.trustedInterfaces.

1 Like