Bug Reference
https://issues.apache.org/jira/browse/CLOUDSTACK-452
Branch
ipv6 branch.
References
https://cwiki.apache.org/CLOUDSTACK/ipv6-support-in-cloudstack.html
Document History
Glossary
Targets
- It's a very big task, we'd better divide it into different phases.
- Current the FS only updated to phase 1.
- No external device support in plan.
Phase 1
- Advance shared network ONLY.
1. Support advance shared network with IPv6 as their (public) IP range.
2. Support for ipnetworklist and ipaddress in DeployVMCmd command.
3. Dual stack, VM can get both IPv4 and IPv6 address from DHCP server(VR).
4. Multiple advance shared networks for one VM.
- Note:
1. No security group support.
2. No userdata/metadata or password service support.
3. Focus on KVM and XenServer in this phase.
Phase 2
Phase 3+
Feature Specifications
Phase 1: Advance shared network
Assumptions:
- The gateway of public network would generate router advisement and response to router solicitation.
- M flag("Managed address configuration") of router advisement should be set to enable stateful ip address configuration.
- User VM's DHCP client must support generate DUID type LL.
- The reason is DUID-LL(refer to http://tools.ietf.org/html/rfc3315) is the only DUID we can tell derives from the MAC address of user VM, otherwise we cannot identify the user VM using DUID.
- CIDR size must be 64 for IPv6 network.
Feature:
- Provide AAAA DNS record in the VR.
- User VM would have one link-local IPv6 address, and get one stateful IPv6 address from DHCPv6 server.
Use cases
1. Admin create a IPv6 shared network in the advanced zone using createNetwork API.
2. User create a VM attach to the IPv6 shared network created by admin.
3. The user VM would generate IPv6 link local address by itself, and get IPv6 global/site local address through DHCPv6.
Architecture and Design description
- Modify createNetwork API to support IPv6 address, along with IPv4 address(also prepare for dual-stack support).
- Hand out stateful DHCPv6 address to the VMs.
- The reason we prefer stateful address to SLAAC in phase one is due to CS need to know the client addresses, in order to manage them(e.g. programming firewall, set up user data).
- The current dnsmasq in our system vm template didn't support IPv6, we need to upgrade the system vm template.
- Newer version of dnsmasq and radvd(for later isolate network support).
- Router advertisement should be sent by public gateway in the network.
Web Services APIs
Phase 1:
- Update createNetwork API:
- New Parameters
- startipv6: String. Start of available IPv6 address. RFC 4291 compatible.
- endipv6: String. End of available IPv6 address. RFC 4291 compatible.
- ip6gateway: String. The gateway IPv6 address of the network. RFC 4291 compatible.
- ip6cidr: CIDR for IPv6 subnet. RFC 4291 compatible.
- Checking:
- if both "startIp" and "startIpv6" are valid, then the network would be in dual-stack mode.
- if "startIpv6" is true, all the following parameters must be valid:
- startIpv6, ip6gateway, ip6cidr
- networkOfferingId must indicate one network offering is advanced shared network offering without SG("DefaultSharedNetworkOffering").
- "startIpv6" and "endIpv6" must in "ip6cidr" range.
- if "ip6gateway" is valid
- It must be in the "ip6cidr" range.
- It must not contained in "startipv6"-"endipv6".
- Update deployVirtualMachine API(DeployVMCmd):
- New parameter:
- ip6Address: the ipv6 address for default vm's network
- Updated parameter:
- iptonetworklist[] now accept "ipv6" option, besides the existed "networkid" and "ip" option, used to indicate the IPv6 address of correlated network.
- Still follow the existed rule: set either iptonetworklist[], or ipaddress/ip6address/network.
- Update createVlanIpRange API:
- New parameter:
- startipv6: String. Start of available IPv6 address. RFC 4291 compatible.
- endipv6: String. End of available IPv6 address. RFC 4291 compatible.
- ip6gateway: String. The gateway IPv6 address of the network. RFC 4291 compatible.
- ip6cidr: CIDR for IPv6 subnet. RFC 4291 compatible.
- Only support adding a new IP range to the existed IPv6 network
- ip6gateway and ip6cidr must be the same as existed IPv6 network.
- Checking followed the same logic as createNetwork()
- Update CreateZoneCmd API:
- New parameter:
- ip6dns1, ip6dns2: DNS server of (potential) IPv6 network. Can be null.
API Responses
-
- For nic response(in uservm and domain router response), three more fields would be added:
- ip6address, ip6gateway, ip6cidr
- All of the three fields can be null for ipv4 network
- For vlaniprange response, the following four fields would be added:
- startipv6, endipv6, ip6gateway, ip6cidr.
- All of the these fields can be null for ipv4 network
- For DomainRouter and DataCenter response:
- ip6dns1 and ip6dns2 are added
- All these fields can be null for ipv4 network
UI flow
Default network in IPv6
- Shared network
- The concept of "Default Network" is still there in IPv6, and the "ip6Address" in deployVirtualMachine API would associate with that network. But unlike IPv4, CloudStack didn't control the routing information of IPv6 in shared network, the choice of Default Network won't affect the routing in the user VM.
Appendix
1. Get IPv6 address using DUID-LL from DHCP server
Manual configuration for dhclient 4.2+
You can also use this command to get the dhcpv6 offer from VR.
Automatic configuration for dhclient 4.1+
Add following to the dhclient configuration file to forge a DUID-LL:
cat /etc/dhcp/dhclient.conf
send dhcp6.client-id = concat(00:03:00, hardware);
2. Automatic configuration to get IPv6 from DHCP server as a part of booting up/network start *
* You need to setup dhclient automatically using DUID-LL first, refer to the configuration above.
Example of network configuration for get dhcpv6 when boot up CentOS 6.2:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=06:A0:F0:00:00:38
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=dhcp6
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=yes
DHCPV6C=yes
cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos62mgmt.lab.vmops.com
NETWORKING_IPV6=yes
IPV6_AUTOCONF=no
Example of network configuration for get dhcpv6 when boot up Ubuntu 12.10:
cat /etc/network/interfaces:
iface eth0 inet6 dhcp
autoconf 0
accept_ra 1
3. Multiple shared IPv6 network
The default route is set by the router(rack router), rather than DHCP server, which is out of CloudStack control. So we suggest user modify the configure of user VM, and set non-default NIC's accept_ra to 0 explicitly, then user VM would only get the default route from the default nic.