Zum Inhalt

IPv6 in der OpenStack CLI

Router erstellen

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

Verfügbares Tenant IPv6 Subnetz anzeigen

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

Netzwerk erstellen

openstack network create test-network1

DUAL-STACK: IPv4 Subnetz erstellen (bei nur IPv6 überspringen)

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

DUAL-STACK: IPv4 Subnetz am Router anhängen (bei nur IPv6 überspringen)

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

Verfügbares Tenant IPv6 Subnetz anzeigen

openstack subnet pool list --share | grep ":"

IPv6 Subnetz erstellen

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

IPv6 Subnetz am Router anhängen

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

OPTIONAL: Zugriff von außen erlauben

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

DUAL-STACK: Zugriff auf Floating FIP von außen erlauben (bei nur IPv6 überspringen)

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

OPTIONAL: Zugriff auf IPv6 von außen erlauben

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"

Test-VM erstellen

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: IPv4 Floating IP der VM zuweisen (bei nur IPv6 überspringen)

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

IP-Adressen anzeigen

openstack server show ${SERVER_ID} -c addresses