I rented a vServer on which I want to run Incus container VMs.
The vServer has assigned a single IPv4 address, but a whole /64 range of IPv6 addresses. I believe this is a common setup these days.
My idea is to use NAT for IPv4 connectivity in the containers, but assign the containers one of the plenty global IPv6 addresses that where assigned to the vServer.
However, while IPv4 connectivity within the container works fine. I can’t seem to figure out how to configure a working non-NATed IPv6 setup. My idea is that the Incus VMs use DHCP for IPv4, but I use a static configuration for IPv6.
Assume the following on the Incus Host:
/etc/systemd/network/ens3.network
[Match]
Name=ens3
[Network]
Address=202.62.237.42/22
Gateway=202.62.236.1
Address=2a03:4002:5c:cf7::1/64
Gateway=fe80::1
DNS=…
# incus network list
+----------+----------+---------+-----------------+------+-------------+---------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
+----------+----------+---------+-----------------+------+-------------+---------+---------+
| ens3 | physical | NO | | | | 0 | |
+----------+----------+---------+-----------------+------+-------------+---------+---------+
| incusbr0 | bridge | YES | 10.177.194.1/24 | none | | 2 | CREATED |
+----------+----------+---------+-----------------+------+-------------+---------+---------+
| lo | loopback | NO | | | | 0 | |
+----------+----------+---------+-----------------+------+-------------+---------+---------+
# incus ls
+--------+---------+-----------------------+------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+--------+---------+-----------------------+------+-----------+-----------+
| nujeru | RUNNING | 10.177.194.147 (eth0) | | CONTAINER | 0 |
+--------+---------+-----------------------+------+-----------+-----------+
And the following setup on the nujeru
VM:
/etc/systemd/network/eth0.network
[Match]
Name=eth0
[Network]
DHCP=ipv4
DNS=…
[DHCP]
ClientIdentifier=mac
How can I assign the nujeru
VM the global IPv6 address 2a03:4002:5c:cf7::2/64?
It seems like I can’t use the incusbr0
since it is “managed”. Hence I wonder if need to create an additional bridge.
I have tried incus network attach ens3 nujeru
to directly attach the VM to the “physical” interface of the host. This caused a new interface eth2 in the VM to show up. On this eth2 interface I’ve configured the IPv6 address 2a03:4002:5c:cf7::2/64 with fe80::1 as gateway. But this did not have the desired effect.