You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

Our openstack clouds are set up with addressing-resources allowing us to assign IPv6-prefixes to openstack-internal networks. The IPv6-addresses assigned will be globally unique, and also globally reachable. The following page guides you through the steps needed to get globally routed IPv6-addresses on your openstack network.

Using the web interface

Web-interface guide is coming soon


Using the command line clients

Creating an IPv4 subnet, and give it external access

When creating a network in openstack using the cli clients; it is common to do something like so:

Create network and IPv4 subnet
$ openstack network create DemoNet
$ openstack subnet create --subnet-range 192.168.1.0/24 --network DemoNet DemoNet-v4
$ openstack router create DemoRouter
$ openstack router set --external-gateway ntnu-internal DemoRouter
$ openstack router add subnet DemoRouter DemoNet-v4

The essence is that we create a network (DemoNet), and to this network we create a subnet (DemoNet-v4) for IPv4 addresses. This subnet is using local RFC 1918 addresses. We then create a router (DemoRouter), which we use to connect the subnet to the rest of the world (ext-net). To "hide" our local addresses, the router would run NAT.

Creating an IPv6 subnet

There are one important key difference between the IPv4 and the IPv6 subnets; IPv4 uses local addresses which allows you to select whichever addresses you like while still being able to route traffic externally using NAT. In IPv6 we use global addresses; which means that each virtual network in the cloud needs unique addresses. This allows the virtual machines to get global addresses directly, and it removes the need for NAT.

As the IPv6 addresses are globally unique you cannot assign them manually; but you will need to get then assigned to you by openstack. To see if your openstack-platform have addresses for assignment you can use the following command:

Show IPv6 subnet pool
$ openstack subnet pool list
+--------------------------------------+------------------+-------------------------+
| ID                                   | Name             | Prefixes                |
+--------------------------------------+------------------+-------------------------+
| 776f3d48-f65c-40fc-8eeb-115f2d060195 | selfservice-ipv6 | 2001:700:1d00:ea00::/55 |
+--------------------------------------+------------------+-------------------------+

To create a IPv6 subnet named "DemoNet-v6" attached to the network "DemoNet" with addresses from the subnet-pool "selfservice-ipv6"  you would use the following command:

Create an IPv6 subnet
$ openstack subnet create --subnet-pool selfservice-ipv6 --ip-version 6 --ipv6-ra-mode slaac --ipv6-address-mode slaac --network DemoNet DemoNet-v6
+----------------------+-----------------------------------------------------------------------------------------------------+
| Field                | Value                                                                                               |
+----------------------+-----------------------------------------------------------------------------------------------------+
| allocation_pools     | 2001:700:1d00:ea07::2-2001:700:1d00:ea07:ffff:ffff:ffff:ffff                                        |
| cidr                 | 2001:700:1d00:ea07::/64                                                                             |
 ...
| gateway_ip           | 2001:700:1d00:ea07::1                                                                               |
 ...
| id                   | 97c4f25a-0765-4d55-918c-39b762500264                                                                |
| ip_version           | 6                                                                                                   |
| ipv6_address_mode    | slaac                                                                                               |
| ipv6_ra_mode         | slaac                                                                                               |
 ...
| name                 | DemoNet-v6                                                                                          |
| network_id           | 24722854-3af0-45f7-b562-d5c1174f51d6                                                                |
 ...
+----------------------+-----------------------------------------------------------------------------------------------------+

At this point you have an IPv6 subnet which is addressed using an assigned IPv6 prefix.

Connecting an IPv6 subnet to the world.

The IPv6 subnet is connected to the world using a router; the same way as IPv4 subnets. When an IPv6 network is connected to a router (which has an external gateway set), the router will make sure to announce the connected IPv6 subnet to the rest of the NTNU Network.

Add external routing to IPv6 subnet
$ openstack router add subnet DemoRouter DemoNet-v6

Verify the configuration

After connecting the IPv6 subnet to an external router the network should be globally reachable quite quickly. You can verify that the network is reachable by pinging the first address in the subnet:

Verify the configuration
$ ping 2001:700:1d00:ea07::1
PING 2001:700:1d00:ea07::1(2001:700:1d00:ea07::1) 56 data bytes
64 bytes from 2001:700:1d00:ea07::1: icmp_seq=1 ttl=60 time=19.9 ms

Configuring incoming access over IPv6

After an IPv6 subnet is created it is important to update the access groups if one wants to allow external access to the virtual machines over IPv6.

Allow incoming SSH

To allow any host at NTNU in Gjøvik to log in to your virtual machines over SSH you would need to add the following rule to the security-group assigned to the VM (The examples adds the rule to the group 'default'):

Allow incoming SSH
 $ openstack security group rule create --src-ip '2001:700:1d00::/48'  --dst-port 22 --ethertype IPv6 --protocol tcp default

It is important to emphasize that the IPv6 addresses are global routable. This means that they are "directly" connected to the internet. It is thus important with proper firewalling. You should therfore ONLY open what is needed trough the security groups, to the addresses needed. For example should SSH (TCP port 22) only be opened for networks which needs to log in to your VM's.

IPv6 address prefixes

NTNU uses the following IPv6 prefixes:

  • 2001:700:300::/46 - NTNU i Trondheim
  • 2001:700:b00::/48 - NTNU i Trondheim (Gamle HiST)
  • 2001:700:1d00::/48 - NTNU i Gjøvik
  • 2001:700:1200::/48 - NTNU i Ålesund
  • No labels