How to Enable IPv6 on CWP Centos WebPanel

by Sandy

On this tutorial I’ll show you how to enable IPv6 for your websites On CWP centos webpanel. A new Internet addressing system Internet Protocol version 6 (IPv6) is being deployed to fulfill the need for more Internet addresses.

IPv6 (Internet Protocol Version 6) is also called IPng (Internet Protocol next generation) and it is the newest version of the Internet Protocol (IP) reviewed in the IETF standards committees to replace the current version of IPv4 (Internet Protocol Version 4).

IPv6 is the successor to Internet Protocol Version 4 (IPv4). It was designed as an evolutionary upgrade to the Internet Protocol and will, in fact, coexist with the older IPv4 for some time. IPv6 is designed to allow the Internet to grow steadily, both in terms of the number of hosts connected and the total amount of data traffic transmitted.

IPv6 is often referred to as the “next generation” Internet standard and has been under development now since the mid-1990s. IPv6 was born out of concern that the demand for IP addresses would exceed the available supply.

The Benefits of IPv6

While increasing the pool of addresses is one of the most often-talked about benefit of IPv6, there are other important technological changes in IPv6 that will improve the IP protocol:

  • No more NAT (Network Address Translation)
  • Auto-configuration
  • No more private address collisions
  • Better multicast routing
  • Simpler header format
  • Simplified, more efficient routing
  • True quality of service (QoS), also called “flow labeling”
  • Built-in authentication and privacy support
  • Flexible options and extensions
  • Easier administration (say good-bye to DHCP)
  • SEO benefits

Here is the tutorial For enabling ipv6 On CWP for your websites :

To enable ipv6 you need to install nginx as reverse proxy (nginx + apache or nginx + varnish + apache), you can enable nginx from webserver option. To enable ipv6 I came with easiest way to enable it with simple one line configuration :

For testing purpose I’m using “tut.mysterydata.com”

Now our First step is to add “AAAA” DNS record which is for IPv6

you can retrieve ipv6 IP from command line via ssh :

Type this command :

ip a

out put will look like this :

********************************************
 Welcome to CWP (CentOS WebPanel) server
********************************************

CWP Wiki: http://wiki.centos-webpanel.com
CWP Forum: http://forum.centos-webpanel.com
CWP Support: http://centos-webpanel.com/support-services

[root@srv1 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/void
    inet 127.0.0.1/32 scope host venet0
    inet 109.235.69.179/32 brd 109.235.69.179 scope global venet0:0
    inet6 2a02:7b40:6deb:45b3::1/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3cff:fede:7641/128 scope link
       valid_lft forever preferred_lft forever

you can see the IPV6 IP which is highlighted/red, you need to copy and add it to your dns “AAAA”

Here is the example image how to add ipv6 you’ll also get rough idea on adding ipv6 on your main domain :

Now we’ll move to CWP and add ipv6 ip on the website, I assume you already installed nginx as reverse proxy

Step 1 :

Navigate to :

Apache Settings > Apache vHosts Template

http://server-IP:2030/admin/index.php?module=vhost_tpl

Now you’ll see two template for nginx one for port 80 and nother for ssl 443
CWP Configuration Templates for nginx_proxy_vhost and CWP Configuration Templates for nginx_proxy_vhost_ssl

Step 2 :

Edit the template and add the following :

edit CWP Configuration Templates for nginx_proxy_vhost and add below line to the template and save it see the eg below where to add it exactly :

listen [2a02:7b40:6deb:45b3::1]:80;

Final example configuration will look like this :

# Virtual host file starts here

server {
listen YOURSERVERIP:NGINXPORT;
listen [2a02:7b40:6deb:45b3::1]:80;
access_log /var/log/nginx/access.YOURDOMAIN.log;
error_log /var/log/nginx/error.YOURDOMAIN.log;
server_name YOURDOMAIN www.YOURDOMAIN;
root DOCROOT;

edit CWP Configuration Templates for nginx_proxy_vhost_ssl and add below line to the template and save it see the eg below where to add it exactly :

listen [2a02:7b40:6deb:45b3::1]:443;

Final example configuration will look like this :

# Virtual host file starts here

server {
listen YOURSERVERIP:NGINXPORT;
listen [2a02:7b40:6deb:45b3::1]:443;
access_log /var/log/nginx/access.YOURDOMAIN.log;
error_log /var/log/nginx/error.YOURDOMAIN.log;
server_name YOURDOMAIN www.YOURDOMAIN;
root DOCROOT;

Step 3 :

Then we need to add some config to /etc/sysctl.conf

nano /etc/sysctl.conf

Then add this line :

net.ipv6.ip_nonlocal_bind = 1

After adding the line save it and run this command :

sysctl -p /etc/sysctl.conf

Step 4 :

After that rebuild vhosts on “Rebuild Virtual Hosts” under “Apache Settings

That is all done, You’ve successfully enable ipv6 on CWP

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

4
Leave a Reply

avatar
2 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
SandyMehroz AnjumAmit Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Amit
Guest
Amit

why not use [:::]:80 instead of the whole ipv6 ip?

Mehroz Anjum
Guest

Please update this tutorial for version: 0.9.8.906 as options have been renamed and now i cant seem to find these two template files.