DEV Community

Cover image for Setting up an IPv6 only VM
laurencet
laurencet

Posted on

Setting up an IPv6 only VM

Too many applications are still using IPv4 only, which is a shame as IPv6 was standardised ~28 years ago.
If you want to check if your application is IPv6 ready, best thing is to have a server or docker/podman network which is IPv6 only. I'm showing how to set up both variants here.

Setting up RedHat 10 for IPv6 only

Note

Root access is, of course, required for all these commands. The following examples use eth0 network interface. Use nmcli con show to list down the network interfaces and adapt the commands accordingly.

First step is enabling IPv6:

# enable ipv6
 sysctl -w net.ipv6.conf.all.disable_ipv6=0
 echo "net.ipv6.conf.all.disable_ipv6=0" | tee /etc/sysctl.d/99-ipv6-enable.conf
# sync to network manager
for DEVICE in $(nmcli con show | grep -v ^NAME | awk '{print $NF}') ; do
  nmcli connection reload $DEVICE
  nmcli dev reapply $DEVICE
done 
nmcli con mod eth0 ipv6.method auto
nmcli con down eth0 && nmcli con up eth0
Enter fullscreen mode Exit fullscreen mode

nmcli command is required for all network interfaces, so if you also have eth1, just copy and paste the last two lines for eth1.

Now we need to disable IPv4. Note down the inet6-Address of your network interface. This command shows the IPv6 addresses and filters to globally or site-locally routable addresses only:

 ip -6 addr show scope global
Enter fullscreen mode Exit fullscreen mode

Now log out and log in via IPv6-Channel, e.g :

ssh -6 root@<ipv6-address>
Enter fullscreen mode Exit fullscreen mode

This is necessary, because when you now disable IPv4 you will loose connectivity to the VM if you are logged in via IPv4 connection.

Disable IPv4:

nmcli connection modify eth0 ipv4.method disabled
nmcli con down eth0 && nmcli con up eth0
Enter fullscreen mode Exit fullscreen mode

Again execute the same commands for all other network interfaces.
That's it. Now the VM should be using IPv6 for communication only. You can start testing your application.

Setting up an IPv6 podman network

If your application is available as docker image, you can instead create a docker/podman network with IPv6 only for testing. Therefore you can simply create an IPv6 podman network by specifying an IPv6 subnet when creating the network:

podman network create --subnet fd00:dead:beef::/64 --gateway fd00:dead:beef::1 ipv6net
Enter fullscreen mode Exit fullscreen mode

Containers started in this network will now get IP addresses starting at fd00:dead:beef::2.

Note

In these examples, I am using the subnet fd00:dead:beef::. This is a private IP address range, comparable to the 192.168.x.x ranges in IPv4. You can freely choose any fd00::/8 prefix for your own use.

Use the command podman network inspect <network> to verify the network that has been created:

podman network inspect ipv6net
[
    {
      "name": "ipv6net",
      "id": "37862e16959562d864468dbe251f6a870901bad81981271b179eb8505a93a37c",
      "driver": "bridge",
      "network_interface": "podman1",
      "created": "2026-08-13T03:25:57.396115356-04:00",
      "subnets": [
           {
                "subnet": "fd00:dead:beef::/64",
                "gateway": "fd00:dead:beef::1"
           }
      ],
      "ipv6_enabled": true,
      "internal": false,
      "dns_enabled": true,
      "ipam_options": {
           "driver": "host-local"
      },
      "containers": {}
    }
]
Enter fullscreen mode Exit fullscreen mode

Podman also knows the option --ipv6, which is actually a dualstack option and will create a network with both IPv4 and IPv6 addresses.

podman network create --ipv6 --subnet fd00:dead:beef::/64 --gateway fd00:dead:beef::1 dualstacknet
podman network inspect dualstacknet
[
    {
      "name": "dualstacknet",
      "id": "94269793c55dd03532287da92e7f73430c9da323f4a949a7bf70b64649158ca0",
      "driver": "bridge",
      "network_interface": "podman1",
      "created": "2026-06-26T03:21:49.382382629-04:00",
      "subnets": [
           {
                "subnet": "fd00:dead:beef::/64",
                "gateway": "fd00:dead:beef::1"
           },
           {
                "subnet": "10.89.0.0/24",
                "gateway": "10.89.0.1"
           }
      ],
      "ipv6_enabled": true,
      "internal": false,
      "dns_enabled": true,
      "ipam_options": {
           "driver": "host-local"
      },
      "containers": {}
    }
]
Enter fullscreen mode Exit fullscreen mode

Podman's DNS plugin (aardvark-dns) listens on both IPv4 and IPv6 so Podman's built-in DNS should work in this network and container-to-container DNS by name should now be available.

Now you can run containers in this network and start testing. Make sure to use the --network parameter when starting containers, to ensure the network is used. Have fun!

Top comments (0)