---
title: "Prepare a VM guest OS for IPv6"
description: "Prepare a guest OS image for IPv6 connectivity on Calico Open Source OpenStack VMs by configuring DHCPv6 client behavior and accepting router advertisements."
product: "Calico Open Source"
version: "3.32 (latest)"
section: "Networking"
canonical_url: "https://docs.tigera.io/calico/latest/networking/openstack/ipv6"
---

# Prepare a VM guest OS for IPv6

## Big picture

Prepare a VM guest OS for IPv6.

## How to

OpenStack (not Calico) controls whether a VM gets IPv4, IPv6, or both addresses. Calico simply honors the addresses that OpenStack specifies. The following extra steps are required for **IPv6 only** and **dual stack** deployments -- so the guest OS can learn its IPv6 address (if assigned by OpenStack).

1. Verify that the guest VM image meets these requirements for IPv6 connectivity.

   - When booting up, the VM must issue a DHCPv6 request for each of its interfaces, so that it can learn the IPv6 addresses that OpenStack allocates for it. If the VM uses the widely-deployed **DHCP client from ISC**, it must have a fix/workaround for [this known issue](https://kb.isc.org/docs/aa-01141).
   - The VM must be configured to accept router advertisements.

   Although not all common cloud images meet these requirements yet, it is easy to remedy by launching an image, making appropriate changes to its configuration files, taking a snapshot, and then using the snapshot thereafter instead of the original image.

   For example, starting from an **Ubuntu cloud image**, the following changes meet the requirements listed.

   - In `/etc/network/interfaces.d/eth0.cfg`, add:

     ```bash
     iface eth0 inet6 dhcp
             accept_ra 1
     ```

   - In `/sbin/dhclient-script`, add at the start of the script:

     ```bash
     `new_ip6_prefixlen=128`
     ```

   - In `/etc/sysctl.d`, create a file named `30-eth0-rs-delay.conf` with contents:

     ```bash
     `net.ipv6.conf.eth0.router_solicitation_delay = 10`
     ```

   For **CentOS**, these additions to a cloud-init script have been reported to be effective:

   runcmd:

   - `sed -i -e '$a'"IPV6INIT=yes" /etc/sysconfig/network-scripts/ifcfg-eth0`
   - `sed -i -e '$a'"DHCPV6C=yes" /etc/sysconfig/network-scripts/ifcfg-eth0`
   - `sed -i '/PATH/i\new_ip6_prefixlen=128' /sbin/dhclient-script`
   - `systemctl restart network`

2. Configure IPv6 support in Calico by defining IPv6 subnet(s) with either one or both types of addressing:

   DHCPv6 address provisioning subnet:

   - The IPv6 address range that you want your VMs to use
   - DHCP enabled
   - IPv6 address mode set to DHCPv6 stateful

   SLAAC address provisioning subnet: (avoids DHCPv6 leases, but requires a /64 range)

   - The /64 IPv6 address range that you want your VMs to use
   - DHCP enabled
   - IPv6 address mode set to use SLAAC
   - IPv6 router advertisement mode set to SLAAC

   We suggest that you initially configure both IPv4 and IPv6 subnets in each network. This allows handling VM images that support only IPv4 alongside those that support both IPv4 and IPv6, and allows a VM to be accessed over IPv4 in case this is needed to troubleshoot any issues with its IPv6 configuration. In principle, though, we are not aware of any problems with configuring and using IPv6-only networks in OpenStack.
