Incus using the same ip range with host which has only one physical device

I have an Incus host with only one physical ethernet interface. But I need to deploy some server can be access by external network, so the default bridge not fit my need:

  • both host and the machines in incus can be access by external network
  • only one physical interface

Is there any simple way to solve this problem, thanks!

There are multiple ways todo this, some of them:

  • macvlan (simple, but vm and host can not talk to each other)
  • bridge with proxy pass through (but only for individual ports, each needs to be known)
  • incus managed / host managed bridge

Assuming you are on Incus (not IncusOS) probably easiest way todo this is to create a host managed bridge, then simply attach your containers/vms to it.

I.e. on Debian (based) distributions you can do similar to this:

auto lo
iface lo inet loopback

auto br0
  iface br0 inet static
  address 192.168.1.250/24
  gateway 192.168.1.1
  bridge_ports enp1s0
  bridge_stp off

iface enp1s0 inet manual

IMPORTANT: If you create a bridge on linux, do not assign an IP to the interface, only to the bridge.

then attach this interface (or create a profile):

incus config device add notpfsense eth0 nic nictype=bridged parent=br0

On IncusOS its easier - the device you see (i.e. eno1) actually is a bridge already.

Here some more details and discussion:

Good tutorial in the Documentation:

Many thanks. Actually I tried this before but failed, and I configed a managed bridge to do it, but still failed

the route:

default via 10.120.17.254 dev br0
0.230.17.0/24 dev br0 proto kernel scope link src 10.120.17.71

Your br0 is incus managed bridge, you should be using unmanaged bridge which is not created by incus if you want your instances to be in the same lan with host.

Thanks, It works with a unmanaged bridge