For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/bare-metal-cloud/vps/configuring-ipv6.md.
  • English

Configuring IPv6 on a VPS

View as Markdown
Info

This article is about Primary IPv6 configuration on a public interface. You can also configure Additional IP addresses on your VPS using this guide.

Warning

NOTE: OVHcloud provides services for which you are responsible for their configuration and management. You are therefore responsible for their proper functioning.

This tutorial is designed to help you as much as possible with common tasks. If you are having difficulty performing these actions, please contact a specialized service provider. OVHcloud cannot provide you with technical support in this regard.

 

Requirements

 

Instructions

The following sections contain configurations for the distributions we currently offer, as well as the most commonly used distributions/operating systems. The first step is always to log in to your server via SSH or a GUI login session (RDP for a Windows VPS). The examples below presume you are logged in as a user with elevated permissions (Administrator/sudo).

Warning

NOTE: On the recent Linux operating systems we offer for VPS, the IPv6 address is configured by default. If this is the case, you don't need to configure it. Please check your operating system's configuration file before making any changes.

Please take note of the following terminology that will be used in code examples and instructions of the guide sections below:

TermDescriptionExample
YOUR_IPV6The IPv6 address assigned to your service2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyyy
IPv6_PREFIXThe prefix (or netmask) of your IPv6 block, usually 1282001:xxxx:xxxx:xxxx::/128
IPv6_GATEWAYThe gateway of your IPv6 block2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:zzzz

 

Step 1: Retrieve the necessary network information

The first step is to identify the IPv6 address and the IPv6 gateway assigned to your server. There are two ways of doing this:

Via OVHcloud Control Panel
Via OVHcloud API

Log into the OVHcloud Control Panel and navigate to your VPS via the Bare Metal Cloud and Virtual private servers menus.

The IPv6 address and the IPv6 gateway assigned to your server will appear in the IP panel of the Home tab. Once you have copied them, continue with applying the IPv6 configuration.

Home tab - Configuring ipv6

 

Step 2: Apply the IPv6 configuration

Once you have gathered the necessary information for the IPv6 configuration, log in to your VPS via SSH. If you require assistance, please refer to this guide: How to get started with SSH connections.

There are several ways to apply the IPv6 configuration. Use whichever method best suits your situation and requirements:

  • Non-persistent application
  • Persistent application on Debian and its derivatives
  • Persistent application on Red Hat and its derivatives
  • Persistent application on Fedora 42 and later
  • Persistent application on Windows Server
Warning

NOTE: VPS LE instances have two interfaces by default. The IPv6 configuration might need to be applied to a different interface, e.g., eth1. You can confirm which interface is used with the command: ip addr.

If this is the case for you, the command may look like this:

ip addr add YOUR_IPV6/IPV6_PREFIX dev eth1
ip -6 route add IPV6_GATEWAY dev eth1
ip -6 route add default via IPV6_GATEWAY dev eth1
Non-persistent
Persistent(Debian, etc.)
Persistent(Red Hat, etc.)
Persistent(Fedora 42+)
Persistent(Windows)

Non-persistent application

Warning

NOTE: This configuration will be lost after a restart of your VPS (non-persistent configuration).

Connect to your server via SSH and enter the following commands. Take care to tailor these with:

  • the network information, retrieved in the previous step (YOUR_IPV6, IPV6_PREFIX, and IPV6_GATEWAY)
  • the network interface (if your server is not using eth0)
ip addr add YOUR_IPV6/IPV6_PREFIX dev eth0
ip -6 route add IPV6_GATEWAY dev eth0
ip -6 route add default via IPV6_GATEWAY dev eth0

 

Step 3: Verify the configuration and test the connection

To verify that the configuration is functional, there are several possible commands, depending on the operating system.

  • For a GNU/Linux-based system, here are two examples for the eth0 interface (to be adapted if necessary):

    ip -6 addr show eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
        inet6 2001:xxxx:xxxx:xxxx:xxxx:xxxx:zzzz/128 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::f816:3eff:fec0:c336/64 scope link
           valid_lft forever preferred_lft forever
    ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr ab:cd:ef:gf:ij:kl
              inet addr:aa.bb.cc.dd  Bcast:aa.bb.cc.ee  Mask:255.255.255.255
              inet6 addr: 2001:xxxx:xxxx:xxxx:xxxx:xxxx:zzzz/128 Scope:Global
              inet6 addr: fe80::f816:3eff:fec0:c336/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              [...]

    To test the connection, you can use the following command:

    ping6 proof.ovh.us
  • For a Windows-based system, use the following command:

    ipconfig
    
    Windows IP Configuration
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . : openstacklocal
       IPv6 Address. . . . . . . . . . . : 2001:xxxx:xxxx:xxxx::zzzz
       Link-local IPv6 Address . . . . . : fe80::d928:7a00:5ba6:951b%3
       IPv4 Address. . . . . . . . . . . : 51.xxx.xxx.xxx
       Subnet Mask . . . . . . . . . . . : 255.255.255.255
       Default Gateway . . . . . . . . . : 2001:xxxx:xxxx:xxxx::y
                                           51.xxx.xxx.y

    To test the connection, you can use the following command:

    ping -6 proof.ovh.us

You can also test the connection to another remote server. However, it is necessary for IPv6 to be active on the remote server for this operation to work.

Info

If, despite these changes, IPv6 does not seem to work on your server, it is possible (in rare cases) that you will have to carry out additional modifications. In such cases, try the following steps:

  • Depending on the operating system, try to change the prefix (or netmask) of your IP address from /128 to /64. This will include the IPv6 gateway in your subnet.
  • In addition to restarting the network service, it may be necessary to reboot your server to finalize your IPv6 configuration.
  • In Windows, verify that the firewall allows ICMP requests for IPv6.

 

Step 4: Disable Cloud-init network management (optional)

Info

This step does not apply to Windows-based systems.

Cloud-init is a package installed by default on a VPS. It functions as a framework to run a script after initially creating your server or rebooting it. The mechanics in place allow the underlying OpenStack infrastructure to inject scripts into the Cloud-init environment and, therefore, the server configuration.

Depending on the operating system, Cloud-init will manage: the network, the hostname, the resolv.conf file, or the automatic partitioning of the hard disk, in case of an upgrade.

In the case of newer distributions (such as CentOS, Debian 9, Ubuntu 16.x, and later), the default configuration of Cloud-init might sometimes automatically reset the network configuration when the server starts up.

This is relevant for specific use cases in which it is recommended to avoid the reset by disabling automatic network management in Cloud-init. To do this, use the following command to create a file /etc/cloud/cloud.cfg.d/98-disable-network-config.cfg with the value network: {config: disabled}:

sudo echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/98-disable-network-config.cfg
Warning

NOTE: It might be necessary to reboot the server for the change to take effect.

To return to automatic management of your network by Cloud-init, delete the newly created file or move it to another directory.

 

Go further

Browse all the Virtual Private Servers guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about VPS on the OVHcloud US website.