Popular blog tags

vultr vps:How to enable IPv6 Address on a Vultr instance?

Published

How to enable IPv6 Address on a Vultr instance?

IPv6 is not enabled by default when creating a new Vultr instance.

Now, let’s see how our Support Engineers enable IPv6 on Vultr instances. IPv6 can be enabled on an existing Vultr instance or a new Vultr instance. Let’s see both cases in detail.

vultr vps主机配置IPV6详细教程

必要条件

1.你购买域名的服务商提供IPV6地址解析

2.你的VPS主机拥有IPV6地址

3.你安装的操作系统开启了IPV6

3.系统中安装的nginx版本支持IPV6地址

vultr vps配置IPV6地址

Enable IPv6

Server Information->IPv6->Settings->Assign IPv6 Network

IPv6 is currently available for this server, but a subnet has not yet been assigned.

choice Assign IPv6 Network

Assign IPv6 Network Address?
Assigning an IPv6 network will reboot your VPS. Are you sure you want to continue?

reboot

ping -6 2001:19f0:b001:5b8:5400:02ff:fea0:1719

output

# ping -6 2001:19f0:b001:5b8:5400:02ff:fea0:1719
PING 2001:19f0:b001:5b8:5400:02ff:fea0:1719(2001:19f0:b001:5b8:5400:02ff:fea0:1719) 56 data bytes
64 bytes from 2001:19f0:b001:5b8:5400:02ff:fea0:1719: icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from 2001:19f0:b001:5b8:5400:02ff:fea0:1719: icmp_seq=2 ttl=64 time=0.040 ms

检查系统是否拥有的IPv6地址

打开终端控制台

ipconfig

输出

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 155.138.136.167 netmask 255.255.254.0 broadcast 155.138.137.255 inet6 2001:19f0:b001:5b8:5400:2ff:fea0:1719 prefixlen 64 scopeid 0x0<global> inet6 fe80::5400:2ff:fea0:1719 prefixlen 64 scopeid 0x20<link> ether 56:00:02:a0:17:19 txqueuelen 1000 (Ethernet) RX packets 5955 bytes 688411 (688.4 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 5562 bytes 795323 (795.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 300 bytes 124789 (124.7 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 300 bytes 124789 (124.7 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

nginx

1.找到nginx的安装路径

where is nginx

输出

nginx: /usr/sbin/nginx /usr/lib/nginx

/etc/nginx

/usr/share/nginx

/usr/share/man/man8/nginx.8.gz

用./nginx -V 查看已安装的模块,查看是否支持IPV6的模块已安装

nginx -V

输出

如果有--with-ipv6,则表示已安装此模块,否则需要重新编译安装。

3.查看nginx是否监听IPV6地址

sudo netstat -tulpan | grep nginx

输出:

~# sudo netstat -tulpan | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      22596/nginx: master 
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      22596/nginx: master 
tcp6       0      0 :::80                   :::*                    LISTEN      22596/nginx: master