1. Use cases of Abiquo IPv6
There are two main use cases for IPv6 in Abiquo: Automatic generation of IPv6 address and Manual entry of IPv6 address. These two use cases are distinguished in Abiquo by the strict parameter. When strict = true, Abiquo enforces EUI-64 IP address generation.
Abiquo automatically generates IPv6 address | |
---|---|
Description |
|
Strict network? | Network parameter strict = true |
Router advertisement |
|
DHCPv6 |
|
Placeholder IPs |
|
User may manually enter IPv6 address | |
---|---|
Description |
|
Strict network? | Network parameter strict = false |
Router advertisement |
|
DHCPv6 |
|
Automatic IPv6 |
|
2. Preparation for Abiquo IPv6
2.1. Router advertisement system for all networks
When you create networks in Abiquo 2.6.2, you must configure the networks in your router advertisement system. For unmanaged networks, you would usually configure your virtual machines to receive their IP addresses from this system.
In effect, with strict networks where the allocation of EUI64 addresses is enforced, the addresses that will be assigned by the router advertisement system based on the MAC are predictable. So the address generated and displayed in Abiquo should be the same as the one allocated by the router advertisement system. This means that the DHCP is not necessary for strict networks
2.2. DHCP v6 service
Configure a DHCPv6 service for non-strict private, external and public networks. The DHCPv6 service is integrated as a remote service in your Abiquo datacenters. In Abiquo 2.6.2, you cannot set up this service while you are creating a datacenter; you must add the service to your new datacenter using the GUI or the API.
Add DHCP v6 via API
To add a DHCPv6 remote service, modify the following API request for your system and run it. Note that the remote service type is "DHCPv6".
curl --verbose -X POST -u admin:xabiquo -H "Content-type: application/vnd.abiquo.remoteservice+json" \ http://example.com/api/admin/datacenters/1/remoteservices \ -d '{ "status": 1, "type": "DHCPv6", "uri": "omapi://dhcpv6.example.com:7911" }'
3. Configure IP address generation
When you create a network, use the strict option to configure manual or automatic address generation. If you set strict to true, then Abiquo will automatically generate EUI64 IP addresses and you will not be able to manually generate them. To be able to manually generate IP addresses, set the strict option to false, or omit the parameter. If you do not set the strict option, the default value is false.
4. Create a network under IPv6
Use API requests to create IPv6 networks. Remember that you must also configure the networks in your router advertisement system.
Creating an IPv6 network via the API is similar to creating an IPv4 network but there are some changes to the network DTO, as shown in the following table.
Parameter | New | Change | Range | Description |
---|---|---|---|---|
address | Network address in IPv6 format. When creating a strict private network, you cannot supply the network address because Abiquo creates a ULA network. | |||
primaryDNS | Primary DNS in IPv6 format | |||
gateway | Not used by IPv6, all values entered will be ignored | |||
mask | 64, 56, 48 | IPv6 Network mask | ||
ipv6 | true, false | Create an IPv6 network | ||
strict | true, false | If false, allow manual IP entry. If no value is supplied, strict is false |
4.1. Create IPv6 external network request
Modify the following script and use it to create an IPv6 external network.
#!/bin/bash curl --verbose -X POST 'http://example.com/api/admin/datacenters/1/network/' \ -H "Accept: application/vnd.abiquo.vlan+json" \ -H "Content-type: application/vnd.abiquo.vlan+json" \ -u abidocs:abidocs \ -d '{ "address": "fd:0:0:1::", "dhcpOptions": {}, "gateway": "fd:0:0:1::1", "ipv6": "true", "links": [ { "href": "http://localhost/api/admin/datacenters/1/networkservicetypes/1", "rel": "networkservicetype" }, { "href": "http://localhost/api/admin/enterprises/7", "rel": "enterprise" } ], "mask": 64, "name": "ipv6-ext-abidocs", "primaryDNS": "fd:0:0:1::1", "strict": "false", "sufixDNS": "example.com", "tag": 2, "type": "EXTERNAL" }'
When the network is created successfully, the API should return the network in response. For example
{ "address": "fd:0:0:1::", "dhcpOptions": {}, "gateway": "?", "id": 96, "ipv6": true, "links": [ { "href": "http://example.com:80/api/admin/datacenters/1", "rel": "datacenter", "title": "API datacenter", "type": "application/vnd.abiquo.datacenter+json" }, { "href": "http://example.com:80/api/admin/datacenters/1/network/96", "rel": "edit", "title": "ipv6-ext-01", "type": "application/vnd.abiquo.vlan+json" }, { "href": "http://example.com:80/api/admin/datacenters/1/networkservicetypes", "rel": "networkservicetypes", "title": "network services types", "type": "application/vnd.abiquo.networkservicetypes+json" }, { "href": "http://example.com:80/api/admin/datacenters/1/networkservicetypes/1", "rel": "networkservicetype", "title": "Service Network", "type": "application/vnd.abiquo.vlan+json" }, { "href": "http://example.com:80/api/admin/enterprises/7/limits/7/externalnetworks/96/ips", "rel": "ips", "title": "external ips", "type": "application/vnd.abiquo.externalips+json" }, { "href": "http://example.com:80/api/admin/datacenters/1/network/96/ips", "rel": "infrastructureips", "title": "public ips", "type": "application/vnd.abiquo.externalips+json" }, { "href": "http://example.com:80/api/admin/enterprises/7", "rel": "enterprise", "title": "Abidocs", "type": "application/vnd.abiquo.enterprise+json" } ], "mask": 64, "name": "ipv6-ext-01", "primaryDNS": "fd:0:0:1::1", "sufixDNS": "example.com", "tag": 2, "type": "EXTERNAL", "unmanaged": false }
4.2. Create IPv6 public network request
Modify the following script and use it to create an IPv6 public network.
#!/bin/bash curl --verbose -X POST 'http://localhost/api/admin/datacenters/1/network/' \ -H "Accept: application/vnd.abiquo.vlan+json" \ -H "Content-type: application/vnd.abiquo.vlan+json" \ -u admin:xabiquo \ -d '{ "address": "fd:0:0:5::", "dhcpOptions": {}, "gateway": "fd:0:0:5::1", "ipv6": "true", "links": [ { "href": "http://localhost/api/admin/datacenters/1/networkservicetypes/1", "rel": "networkservicetype" } ], "mask": 64, "name": "ipv6-pub", "primaryDNS": "fd:0:0:5::1", "strict": "false", "sufixDNS": "example.com", "tag": 5, "type": "PUBLIC" }'
4.3. Create IPv6 unmanaged network request
Modify the following script and use it to create an IPv6 unmanaged network.
#!/bin/bash curl --verbose -X POST 'http://localhost/api/admin/datacenters/1/network/' \ -H "Accept: application/vnd.abiquo.vlan+json" \ -H "Content-type: application/vnd.abiquo.vlan+json" \ -u admin:xabiquo \ -d '{ "address": "fd:0:0:3::", "dhcpOptions": {}, "gateway": "fd:0:0:3::1", "ipv6": "true", "links": [ { "href": "http://localhost/api/admin/datacenters/1/networkservicetypes/1", "rel": "networkservicetype" }, { "href": "http://localhost/api/admin/enterprises/1", "rel": "enterprise" } ], "mask": 64, "name": "ipv6-unm", "primaryDNS": "fd:0:0:3::1", "strict": "false", "sufixDNS": "abiquo.com", "tag": 3, "type": "UNMANAGED", "unmanaged": "true" }'
5. IPs in IPv6 networks
The following DTO is an example of an IP in an IPv6 external network. As you can see:
there is a new field for "ipv6", which is set to "true"
the IP address is in IPv6 format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <externalips> <link rel="first" href="http://example.com:80/api/admin/datacenters/1/network/32/ips?limit=25&by=ip"/> <link rel="last" href="http://example.com:80/api/admin/datacenters/1/network/32/ips?startwith=0&limit=25&by=ip"/> <totalSize>1</totalSize> <externalip> <link title="ipv6-ext" rel="externalnetwork" type="application/vnd.abiquo.vlan+xml" href="http://example.com:80/api/admin/datacenters/1/network/32"/> <link title="ivan_enterprise" rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://example.com:80/api/admin/enterprises/2"/> <link title="fd::1:de94:e2bb:ae5d:6d48" rel="self" type="application/vnd.abiquo.externalip+xml" href="http://example.com:80/api/admin/datacenters/1/network/32/ips/3486"/> <id>3486</id> <ip>fd::1:de94:e2bb:ae5d:6d48</ip> <networkName>ipv6-ext</networkName> <ipv6>true</ipv6> <available>true</available> <quarantine>false</quarantine> </externalip> </externalips>
5.1. Create an IP with a manually entered address
For a non-strict network, you can create an IP and manually enter the address, as opposed to using one automatically generated by Abiquo. You cannot create IPs for unmanaged networks.
The following scripts create IPs on the different networks: using the datacenter networks link for public and external networks, and virtual datacenter and private networks link.
5.1.1. Enter IPv6 address for non-strict private networks
Modify the following script for your platform to create an IP with a manually assigned address for non-strict private network. Run the script and enter the network ID and the IP address.
#!/bin/bash curl --verbose -X POST -u admin:xabiquo -H 'Content-type: application/vnd.abiquo.privateip+json' -H 'Accept: application/vnd.abiquo.privateip+json' 'http://localhost:80/api/cloud/virtualdatacenters/1/privatenetworks/'$1'/ips' -d '{ { "ip": "'$2'", "ipv6": "true", "networkName": "ipv6" }'
5.1.2. Enter IPv6 address for non-strict public and external networks
Modify the following script for your platform to create an IP with a manually assigned address for non-strict public and external networks. Run the script and enter the network ID and IP address.
#!/bin/bash curl --verbose -X POST -u admin:xabiquo -H 'Content-type: application/vnd.abiquo.publicip+json' -H 'Accept: application/vnd.abiquo.publicip+json' 'http://example.com:80/api/admin/datacenters/1/network/'$1'/ips' -d '{ "available": "true", "ip": "'$2'", "ipv6": "true", "networkName": "ipv6" }'
5.2. Create an IP with an automatically generated address
For a strict network you must use automatically generated IP addresses in EUI-64 format. For a non-strict network, you can choose to create an IP with an automatically generated IP. If the network is private, an EUI-64 address will be generated. If the network is public or external, a random IP address will be created.
To create an IP with an automatically generated address, post an IP DTO without the IP value set.
5.2.1. Automatically generated address for private networks
Modify this script for your platform to create a randomly generated IP for non-strict private networks. Run the script and enter the network ID. Abiquo will create and return a valid EUI-64 IP.
#!/bin/bash curl --verbose -X POST -u admin:xabiquo -H 'Content-type: application/vnd.abiquo.privateip+json' -H 'Accept: application/vnd.abiquo.privateip+json' 'http://localhost:80/api/cloud/virtualdatacenters/1/privatenetworks/'$1'/ips' -d '{ "ip": "'$2'", "ipv6": "true", "networkName": "ipv6" }'
5.2.2. Automatically generated address for public and external networks
Modify this script to create a randomly generated IP for non-strict public and external. Run the script and enter the network ID. Abiquo will create and return a random IPv6 address.
#!/bin/bash curl --verbose -X POST -u admin:xabiquo \ -H 'Content-type: application/vnd.abiquo.publicip+json' \ -H 'Accept: application/vnd.abiquo.publicip+json' \ 'http://example.com:80/api/admin/datacenters/1/network/'$1'/ips' \ -d '{ "available": "true", "ipv6": "true", "networkName": "ipv6" }'
5.2.2.1. Placeholder IPs for strict external or public networks
If you generate an IP for a strict external or public network before the virtual machine is configured in the hypervisor, Abiquo will use a placeholder IP, with an ip value of "?".
You can add the placeholder IP to a virtual machine and the real EUI64 IP address will be generated when the configuration is updated in the hypervisor.
The following DTO is an example of placeholder IP.
{ "available": true, "id": 4831, "ip": "?", "ipv6": true, "links": [ { "href": "http://example.com:80/api/admin/datacenters/1/network/56", "rel": "externalnetwork", "title": "ipv6-ext-abidocs", "type": "application/vnd.abiquo.vlan+json" }, { "href": "http://example.com:80/api/admin/enterprises/7", "rel": "enterprise", "title": "Abidocs", "type": "application/vnd.abiquo.enterprise+json" }, { "href": "http://example.com:80/api/admin/datacenters/1/network/56/ips/4831", "rel": "self", "title": "?", "type": "application/vnd.abiquo.externalip+json" } ], "networkName": "ipv6-ext-abidocs" }