Skip to content

IPv6 in CLI

This guide describes how to create an IPv6 or dual-stack network using the OpenStack CLI.

Prerequisites

  • Application Credentials (cloud.yaml) configured (see Tools).
  • IPv6 is currently limited to Region 2 (ch-ge1).

Create a Router

openstack router create test-router1 --external-gateway public

Show Available IPv6 Subnet Pool

openstack subnet pool list --share | grep tenant-subnet-pool-v6

Create a Network

openstack network create test-network1

DUAL-STACK: Create IPv4 Subnet (skip for IPv6 only)

openstack subnet create test-subnet1-ipv4 \
    --network test-network1 \
    --subnet-range 10.11.12.0/24

DUAL-STACK: Attach IPv4 Subnet to Router (skip for IPv6 only)

openstack router add subnet test-router1 test-subnet1-ipv4

Create IPv6 Subnet

openstack subnet create test-subnet1-ipv6 \
    --network test-network1 \
    --ip-version 6 \
    --subnet-pool external-subnet-pool-v6 \
    --prefix-length 64 \
    --ipv6-ra-mode dhcpv6-stateless \
    --ipv6-address-mode dhcpv6-stateless

Attach IPv6 Subnet to Router

openstack router add subnet test-router1 test-subnet1-ipv6

OPTIONAL: Create Security Group and Rules

SECURITY_GROUP=test-secgroup
openstack security group create ${SECURITY_GROUP}

DUAL-STACK: Allow IPv4 access (skip for IPv6 only)

openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol icmp --ingress --remote-ip 0.0.0.0/0
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol icmp --egress --remote-ip 0.0.0.0/0
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol tcp --dst-port 22 --remote-ip 0.0.0.0/0
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol tcp --dst-port 80 --remote-ip 0.0.0.0/0

Allow IPv6 access

openstack security group rule create ${SECURITY_GROUP} --ethertype IPv6 --protocol ipv6-icmp --ingress --remote-ip "::/0"
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv6 --protocol ipv6-icmp --egress --remote-ip "::/0"
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv6 --protocol tcp --dst-port 22 --remote-ip "::/0"
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv6 --protocol tcp --dst-port 80 --remote-ip "::/0"

Create Test VM

SERVER_ID=test-vm1-test
openstack server create ${SERVER_ID} \
    --flavor m1.small \
    --image "Ubuntu 24.04" \
    --network test-network1 \
    --key-name test-key \
    --security-group ${SECURITY_GROUP}

DUAL-STACK: Assign IPv4 Floating IP (skip for IPv6 only)

FLOATING_IP=$(openstack floating ip create public -c floating_ip_address -f value)
openstack server add floating ip ${SERVER_ID} ${FLOATING_IP}

Show IP Addresses

openstack server show ${SERVER_ID} -c addresses