Configure IPv6 on cPanel instances in Lightsail - Amazon Lightsail

Configure IPv6 on cPanel instances in Lightsail

All instances in Amazon Lightsail have a public and a private IPv4 address assigned to them by default. You can optionally enable IPv6 for your instances to have a public IPv6 address assigned to them. For more information, see Amazon Lightsail IP addresses and Enable or disable IPv6.

After you enable IPv6 for an instance that uses the cPanel & WHM blueprint, you must perform an additional set of steps to make the instance aware of its IPv6 address. In this guide, we show you the additional steps that you must perform for cPanel & WHM instances.

Prerequisites

Complete the following prerequisites if you haven't already:

  • Create an cPanel & WHM instance in Lightsail. For more information, see Create an instance.

  • Configure your cPanel & WHM instance. For more information, see Quick start guide: cPanel & WHM on Amazon Lightsail.

    Important

    Make sure that all software updates and required system reboots are performed before continuing with the steps in this guide.

  • Enable IPv6 for your cPanel & WHM instance. For more information, see Enable or disable IPv6.

    Note

    New cPanel & WHM instances created on or after January 12, 2021, have IPv6 enabled by default when they are created in the Lightsail console. You must complete the following steps in this guide to configure IPv6 on your instance even if IPv6 was enabled by default when you created your instance.

Configure IPv6 on a cPanel & WHM instance

Complete the following procedure to configure IPv6 on a cPanel & WHM instance in Lightsail.

  1. Sign in to the Lightsail console.

  2. Important

    The Lightsail browser-based SSH/RDP clients only accept IPv4 traffic. Use a third-party client to SSH or RDP into your instance over IPv6. For more information, see Connect to your instances.

    In the Instances section of the Lightsail home page, locate the cPanel & WHM instance that you wish to configure, and choose the browser-based SSH client icon to connect to it using SSH.

    
            Browser-based SSH client icon in the Lightsail home page.
  3. After you're connected to your instance, enter the following command to open the ifcfg-eth0 network interface configuration file using Nano.

    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
  4. Add the following lines of text to the file if they are not already there.

    IPV6INIT=yes IPV6_AUTOCONF=yes DHCPV6C=yes

    The result should look like the following example.

    
            Network interfaces configuration file on the instance.
  5. Press CTRL+C on your keyboard to exit the file.

  6. Press Y when prompted to save the modified buffer, then press Enter to save to the existing file. This saves the edits you made to the ifcfg-eth0 network interface configuration file.

  7. Close the browser-based SSH window and toggle back to the Lightsail console.

  8. In the Instances tab of the Lightsail home page, choose the actions menu (⋮) for the cPanel & WHM instance, and choose Reboot.

    
            Instance reboot option on the Lightsail home page.

    Wait a few minutes for your instance to be done rebooting before continuing to the next step.

  9. In the Instances tab of the Lightsail home page, make note of the IPv6 address assigned to your cPanel & WHM instance.

    
            Instance IPv6 address on the Lightsail home page.
  10. Open a new browser tab, and sign in to the Web Host Manager (WHM) of your cPanel & WHM instance.

  11. In the left navigation pane of the WHM console, choose Basic WebHost Manager Setup.

    
            Basic WebHost Manager Setup option in the navigation pane.
  12. In the All tab, find the text for the IPv6 address to use, then enter the IPv6 address assigned to your instance. You should have made note of the IPv6 address assigned to your instance from step 9 of this procedure.

    
            IPv6 address of the instance.
  13. Scroll to the bottom for the page and choose Save Changes.

  14. In the left navigation pane of the WHM console, choose Tweak Settings.

    
            Tweak settings option in the navigation pane.
  15. In the All tab, scroll down to find the Listen on IPv6 Addresses setting, and set it to On.

    
            Listen to IPv6 address option.
  16. Scroll to the bottom for the page and choose Save.

  17. Toggle back to the Lightsail console.

  18. In the Instances tab of the Lightsail home page, choose the actions menu (⋮) for the cPanel & WHM instance, and choose Reboot.

    
            Instance reboot option on the Lightsail home page.

    Wait a few minutes for your instance to be done rebooting before continuing to the next step.

  19. Choose the browser-based SSH client icon for the cPanel & WHM instance to connect to it using SSH.

    
            Browser-based SSH client icon in the Lightsail home page.
  20. After you're connected to your instance, enter the following command to view the IP addresses configured on your instance, and confirm that it is now recognizing its assigned IPv6 address.

    ip addr

    You will see a response similar to the following example. If your instance does recognize its IPv6 address, then you will see it listed in the response with a label of scope global as shown in this example.

    
            IPv6 configured on the instance.
  21. Enter the following command to confirm that your instance is able to ping an IPv6 address.

    ping6 ipv6.google.com -c 6

    The result should look like the following example, which confirms that your instance is able to ping IPv6 addresses.

    
            Ping6 result.