How to use nictype=routed (Incus 7.7)

:sweat_smile:

Greeting,
today I read the Incus 7.7 release notes and noticed the routed NIC option.
I tried configuring it, but I cannot ping the host.

Could you show me how to use nictype=routed?

Environment

  • Incus Version: Client 7.7 / Server 7.7

  • Host OS: Ubuntu 26.04

  • Container Image: images:debian/trixie

  • Host Interface (enx34298f745621):

    Plaintext

    3: enx34298f745621: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
        link/ether 34:29:8f:74:56:21 brd ff:ff:ff:ff:ff:ff
        inet 10.1.1.12/24 brd 10.1.1.255 scope global dynamic noprefixroute enx34298f745621
           valid_lft 84062sec preferred_lft 84062sec
        inet6 fe80::9f54:62ac:178e:c2f5/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    
    
  • Host sysctl:

    Plaintext

    net.ipv4.ip_forward = 1
    net.ipv4.conf.enx34298f745621.forwarding = 1
    net.ipv4.conf.enx34298f745621.proxy_arp = 1
    
    

What I Tested

  • Created container d4 (incus init images:debian/trixie d4) and attached a routed NIC on enx34298f745621 with ipv4.address=10.1.1.11.

  • Expected DHCP conflict on the container side, so I configured static IP/route inside the container instead of relying on DHCP.

  • However, ping between the container and the host still does not work.

Question

  • How can I properly use and configure nictype=routed in Incus 7.7 so that host-to-container and external communication works reliably? What am I missing in my host, NIC, or container network configuration?

For good communication, I used AI Power.
Thanks for your effort.

You’ll want to check for any firewalling configured on your system. For traffic headed out of your system, unless you have those addresses routed to your host already, you’ll probably need to configure some NAT.

but can not ping the host

Maybe also hairpin?

Thanks for your guidance!
I checked the firewall and traced the packets as you suggested:

sudo ufw status
상태: 비활성

sudo iptables -S FORWARD
-P FORWARD ACCEPT
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-FORWARD
-A FORWARD -j LIBVIRT_FWX
-A FORWARD -j LIBVIRT_FWI
-A FORWARD -j LIBVIRT_FWO

sudo nft list ruleset
sudo tcpdump -i vethcec81413 -n icmp

Then, it can ping to host and gateway.

incus exec d4 -- ping -c 2 10.1.1.2
PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
64 bytes from 10.1.1.2: icmp_seq=1 ttl=254 time=0.924 ms
64 bytes from 10.1.1.2: icmp_seq=2 ttl=254 time=0.985 ms

incus exec d4 -- ping -c 2 10.1.1.12
PING 10.1.1.12 (10.1.1.12) 56(84) bytes of data.
64 bytes from 10.1.1.12: icmp_seq=1 ttl=64 time=0.093 ms
64 bytes from 10.1.1.12: icmp_seq=2 ttl=64 time=0.031 ms

:sweat_smile:

Thanks again for your help!
Through this troubleshooting,
I gained a clearer picture of how containers communicate with the outside network."

hairpin also I will check. Thanks~~~