给服务器配置ipv6

0,启用ipv6 

# vim /etc/sysctl.conf

修改或添加

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0

使配置生效

# sysctl -p

1,到tunnelbroke注册一个账号

2,点击 Create Regular Tunnel

3,IPv4 Endpoint中填写你的服务器外网IP

4,在下方列表选择一个隧道服务器,一般选择香港

5,然后点击"Example Configurations"

6,选择你的服务器类型,会自动生成相应的配置

7,添加ipv6设置

# vim /etc/network/interfaces

 将第6步生成的配置添加到尾部

8,启用隧道

$ ifup he-ipv6

9,如果是https网站,则需要修改nginx配置

 添加

        listen [::]:443 ssl http2;

10,重启nginx

11,到ipv6-test网站测试是否生效




猜你喜欢

转载自blog.csdn.net/qq_40312076/article/details/80883580