Openstack allows you to create networks addressed with IPv6. SkyHiGh is configured with global routable IPv6 prefixes, and this article is about to explain how you can create a virtual network with global routable IPv6 addresses.
THE IPV6 IMPLEMENTATION IN OPENSTACK NEWTON IS A BIT BUGGED. THIS MIGHT WORK, OR IT MIGHT NOT. UNFORTUNATLEY.
Using the web interface
Unfortunatley this is currently only possible using the command line clients.
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:
$ openstack network create DemoNet $ openstack subnet create --subnet-range 192.168.1.0/24 --network DemoNet DemoNet-v4 $ openstack router create DemoRouter $ neutron router-gateway-set DemoRouter ext-net $ 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.
To create a IPv6 subnet named "DemoNet-v6" attached to the network "DemoNet", you would use the following command:
$ openstack subnet create --ip-version 6 --ipv6-ra-mode slaac --ipv6-address-mode slaac --use-default-subnet-pool --network DemoNet DemoNet-v6 +------------------------+--------------------------------------+ | Field | Value | +------------------------+--------------------------------------+ | allocation_pools | ::2-::ffff:ffff:ffff:ffff | | cidr | ::/64 | ... | name | DemoNet-v6 | | network_id | b3f3d1c6-5e1c-49a0-8a3c-4f706745fac9 | ... | subnetpool_id | prefix_delegation | | updated_at | 2017-08-10T08:20:26Z | | use_default_subnetpool | True | +------------------------+--------------------------------------+
At this point you have an IPv6 subnet which is addressed using a temporary IPv6 prefix as a placeholder until the subnet gets a proper IPv6 prefix assigned.
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 would request to get an IPv6 prefix to assign to the subnet.
WARNING: DUE TO AN OPENSTACK BUG, ONLY ONE IPV6 SUBNET CAN BE CONNECTED TO EACH VIRTUAL ROUTER.
$ openstack router add subnet DemoRouter DemoNet-v6
Verify the configuration
After connecting the IPv6 subnet to an external router, and giving the prefix-delegation some time (a minute or so) to do its work, you could verify that a global unique prefix is delegated to your subnet:
eigilo@access:~$ openstack subnet show DemoNet-v6 +-------------------+--------------------------------------------------------------+ | Field | Value | +-------------------+--------------------------------------------------------------+ | allocation_pools | 2001:700:1d00:e88a::2-2001:700:1d00:e88a:ffff:ffff:ffff:ffff | | cidr | 2001:700:1d00:e88a::/64 | ... | gateway_ip | 2001:700:1d00:e88a::1 | | host_routes | | | id | 7b242c30-40e2-4727-83d7-18e5bbe18a8a | | ip_version | 6 | | ipv6_address_mode | slaac | | ipv6_ra_mode | slaac | | name | DemoNet-v6 | ... +-------------------+--------------------------------------------------------------+
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'):
$ 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. Please see the section "IPv6 address prefixes" to see what prefixes which entities are using. If you miss some organisations here; please ask and we will try to figure out their address ranges.
IPv6 address prefixes
This section covers which IPv6 addresses certain organizations are using; to help you create proper IPv6 access group rules.
NTNU:
- 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
Norwegian ISP's:
This list covers some norwegian ISP's. Are you missing one, let us know and we will add it.
- Uninett:
- 2001:700::/32
- Altibox:
- 2a00:14d8::/29
- 2a00:ce60::/32
- 2a00:dec0::/32
- 2a00:fd00::/32
- 2a01:798::/29
- Eidsiva:
2a02:a18::/32
- Get
2a02:fe0::/29'
- Lynet:
- 2a00:c440::/29
- Netcom:
- 2001:2020::/32
- 2001:2021::/32
- Nextgentel:
- 2a03:96e0::/33
- 2a04:980::/29
- Powertech:
- 2001:840::/29
- 2a00:be40::/32
- 2a00:be44::/32
- Signal:
- 2a00:e08::/32
2a00:5d40::/32
- Telenor:
- 2001:4600::/24
- 2a00:6e80::/32
- 2a02:1400::/26
- 2a02:2120::/30
- 2a02:2580::/32
- 2a02:2640::/32
- 2a02:7720::/32
- 2a02:f300::/29
- 2a07:c40::/29
- 2a0a:2180::/29
Other ISP's:
- Nordunet:
2001:948::/32