Disable IPv6 address on certain containers

It’s important to show the full picture. Here’s me creating the noipv6 network (as described by @abiosoft), then launching a container.
The container gets an IPv6 address but Incus is not aware of it.
Try the same steps and post if you get some different result.

$ incus network create noipv6 ipv6.address=none
Network noipv6 created
$ incus network show noipv6
config:
  ipv4.address: 10.248.131.1/24
  ipv4.nat: "true"
  ipv6.address: none
description: ""
name: noipv6
type: bridge
used_by: []
managed: true
status: Created
locations:
- none
project: default
$ incus launch images:alpine/edge alpine --network=noipv6
Launching alpine
$ incus shell alpine
alpine:~# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:16:17:18:19:20  
          inet addr:10.248.131.31  Bcast:10.248.131.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe1f:9bac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:827 (827.0 B)  TX bytes:1312 (1.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

alpine:~# 
$ incus list alpine
+--------+---------+----------------------+------+-----------+-----------+
|  NAME  |  STATE  |         IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+--------+---------+----------------------+------+-----------+-----------+
| alpine | RUNNING | 10.248.131.31 (eth0) |      | CONTAINER | 0         |
+--------+---------+----------------------+------+-----------+-----------+
$ 

What is weird though, is that two such containers can ping each other over the IPv6 link-local address. :thinking:

$ incus launch images:alpine/edge alpine1 --network=noipv6
Launching alpine1
$ incus launch images:alpine/edge alpine2 --network=noipv6
Launching alpine2
$ incus exec alpine1 -- ip -6 addr show eth0
35: eth0@if36: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 state UP qlen 1000
    inet6 fe80::216:3eff:fea5:6202/64 scope link 
       valid_lft forever preferred_lft forever
$ incus exec alpine2 -- ip -6 addr show eth0
33: eth0@if34: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 state UP qlen 1000
    inet6 fe80::216:3eff:fe15:9fd/64 scope link 
       valid_lft forever preferred_lft forever
$ incus exec alpine1 -- ping -6 -c 3 fe80::216:3eff:fe15:9fd
PING fe80::216:3eff:fe15:9fd (fe80::216:3eff:fe15:9fd): 56 data bytes
64 bytes from fe80::216:3eff:fe15:9fd: seq=0 ttl=64 time=0.101 ms
64 bytes from fe80::216:3eff:fe15:9fd: seq=1 ttl=64 time=0.059 ms
64 bytes from fe80::216:3eff:fe15:9fd: seq=2 ttl=64 time=0.072 ms

--- fe80::216:3eff:fe15:9fd ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.059/0.077/0.101 ms
$