---
title: Configuring IPv6 on virtual machines with ESXi
description: This page explains how to configure IPv6 on virtual machines with ESXi
tags: esxi virtual-machine ubuntu
products:
  - dedibox
dates:
  validation: 2025-05-12
  posted: 2022-02-24
  validation_frequency: 12
difficulty: beginner
usecase:
  - resource-management
ecosystem:
  - third-party
---
import Requirements from '@macros/iam/requirements.mdx'


<Message type="important">
  Due to VMware's acquisition by Broadcom, the free edition of **VMware vSphere Hypervisor is no longer available** on the VMware website. For more details, check out [the EOL of free vSphere Hypervisor](https://knowledge.broadcom.com/external/article?legacyId=2107518). Please note that the following content is provided as-is, without any guarantee of functionality
  We suggest considering alternative hypervisors such as Proxmox. You can learn how to [deploy virtual machines with Proxmox on Scaleway Dedibox](/tutorials/configure-failover-proxmox/).
</Message>

This tutorial explains how to configure IPv6 on virtual machines on ESXi hypervisors.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
- A [Dedibox](https://www.scaleway.com/en/dedibox/) running ESXi 6.5 or later
- Enabled [SLAAC](/dedibox-ipv6/how-to/enable-ipv6-slaac/) for your Dedibox
- [Requested an IPv6 prefix](/dedibox-ipv6/how-to/request-prefix/)
- Installed a virtual machine running Ubuntu 20.04 or later and [configured a failover IPv4](/dedibox-ip-failover/how-to/configure-network-virtual-machine/#ubuntu) on it

1. Log into your virtual machine using [SSH](/dedibox/how-to/connect-to-server/#connecting-via-ssh).
2. Run the command `ip a` to display your current network configuration. The command returns an output as follows:
    ```
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
    2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:50:56:01:fa:b9 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet your.fail.over.ip/32 scope global ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe01:fab9/64 scope link
       valid_lft forever preferred_lft forever
    ```
    Take note of the following information from the output above:
    * The name of the network interface (here `ens160`)
    * The local IPv6 of your VM (here `fe80::250:56ff:fe01:fab9/64`)
3. Open the file `/etc/dhcp/dhclient6.conf` in a text editor and edit it as shown below. Then save the file and quit the text editor.
    ```
    interface "ens160" {
        send dhcp6.client-id DUID;
    }
    ```
    <Message type="important">
      Edit the name of the internet interface to one of your VMs and replace `DUID` with the [DUID of your prefix](/dedibox-ipv6/how-to/request-prefix/).
    </Message>
4. Open the file `/etc/systemd/system/dhclient.service` in a text editor and edit it as shown below. Then save and exit the editor.
    ```
    [Unit]
    Description=dhclient for sending DUID IPv6
    After=network-online.target
    Wants=network-online.target

    [Service]
    Restart=always
    RestartSec=10
    Type=forking
    ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient6.conf -6 -P -v eno1
    ExecStop=/sbin/dhclient -x -pf /var/run/dhclient6.pid

    [Install]
    WantedBy=network.target
    ```
5. Enable the service to start automatically after each reboot of the machine. Then start the service manually for the first time.
    ```
    systemctl enable dhclient.service
    systemctl start dhclient.service
    ```
6. Verify that the service is running with the following command:
    ```
    systemctl status dhclient.service
    ```
    The command above returns an output as follows:
    ```
        ● dhclient.service - dhclient for sending DUID IPv6
        Loaded: loaded (/etc/systemd/system/dhclient.service; enabled; vendor pres>
        Active: active (running) since Thu 2022-02-24 12:18:03 UTC; 27min ago
      Main PID: 5342 (dhclient)
        Tasks: 4 (limit: 4627)
        Memory: 1.6M
        CPU: 23ms
        CGroup: /system.slice/dhclient.service
                └─5342 /sbin/dhclient -cf /etc/dhcp/dhclient6.conf -6 -P -v ens160
    ```
7. Edit your [Netplan](https://netplan.io/) configuration file (probably located at `/etc/netplan/01-netcfg.yaml`) and edit it as follows:
    ```
    network:
    version: 2
    renderer: networkd
    ethernets:
      ens18:
        dhcp4: false
        dhcp6: false
        addresses:
        - FAILOVER_IP/32
        - IP_FROM_YOUR_PREFIX/SUBNET
        gateway4: 62.210.0.1
        gateway6: LOCAL_IPv6
        nameservers:
            addresses: [ "51.159.47.28", "51.159.47.26" ] # Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performances (https://www.scaleway.com/en/docs/account/reference-content/scaleway-network-information/#dns-cache-servers-and-ntp-servers)

        routes:
          - to: 0.0.0.0/0
            via: 62.210.0.1
            on-link: true
          - to: "::/0"
            via: "LOCAL_IPv6"
            on-link: true
        nameservers:
            addresses: [ "51.159.47.28", "51.159.47.26" ] # Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performances (https://www.scaleway.com/en/docs/account/reference-content/scaleway-network-information/#dns-cache-servers-and-ntp-servers/)
        accept-ra: no  # Disable Router Advertisements to ignore SLAAC
    ```
8. Apply the new network configuration with the following command:
    ```
    netplan apply
    ```

   You now have configured the IP address, but the IPv6 connectivity is not working yet.
9. Find the gateway for your prefix by running the following command:
    ```
    ip -6 route
    ```
    The command returns an output as follows:
    ```
    ::1 dev lo proto kernel metric 256 pref medium
    YOUR_IPv6_PREFIX/SUBNETMASK dev ens160 proto kernel metric 256 pref medium
    fe80::/64 dev ens160 proto kernel metric 256 pref medium
    default via fe80::7a0c:f0ff:fedf:254d dev ens160 proto static metric 1024 onlink pref medium
    ```

    Take note of the default gateway (here `fe80::7a0c:f0ff:fedf:254d`).
10. Edit your Netplan configuration file again and modify it as follows:
    ```
    gateway6: DEFAULT_GATEWAY
    - to: "::/0"
        via: "DEFAULT_GATEWAY"
        on-link: true
    ```
    <Message type="note">
      Remember to replace `DEFAULT_GATEWAY` with the default gateway found in the previous step.
    </Message>
11. Reload your network configuration for the last time:
    ```
    netplan apply
    ```

You have now IPv6 connectivity for your virtual machine. You can test it by running a ping6: `ping ipv6.google.com`.