美文网首页
阿里云服务器如何设置IPV6通过appstore的审核

阿里云服务器如何设置IPV6通过appstore的审核

作者: hetoo | 来源:发表于2018-07-19 02:19 被阅读0次

    苹果上架要求:要求支持IPV6only(因为阿里云主机没有IPV6only)

    确认IPV6是否开启:

    方式1:使用ifconfig查看自己的IP地址是否含有IPv6地址。

    方式2.查看服务监听的IP中是否有IPv6格式的地址。(netstat -tuln)

    开启IPV6:

    vim /etc/sysctl.conf

    vim /etc/modprobe.d/disable_ipv6.conf

    vim /etc/sysconfig/network

    至此ipv6的服务器端支持已经完成,重启服务器测试是否支持ipv6,重启后, ifconfig查看ipv6的信息,有看到有关IPV6的输出就可以

    添加ipv6隧道:

    1. 注册Tunnel broker

    https://www.tunnelbroker.net/

    注册很容易,就不讲了,注册需要邮箱验证,,gmail、163能收得到认证邮件,qq还是一样收不到

     2.创建通道“Create Regular Tunnel”

    填写云服务器ip以及选择默认的隧道节点,点击Create Tunnel创建。填写ip都,如果出现“IP is a potential tunnel endpoint.”则证明可以添加ipv6隧道,一般隧道节点系统已经默认分配,可以手动选择,大家可以在自己的云服务器上分别ping一下这些ip,选时延低的。

    3.创建ipv6隧道及路由

    到下一页面切换到Example configurations选项卡,如果你的VPS是centOS/Debian这些常见Linux的话,下拉菜单选择Linux-route2,出现了设置的命令,复制到自己的云服务器上运行。如果是“专有网络”,需要将HE配置隧道地址命令中的IPv4地址修改为ECS实例的内网地址。

    modprobe ipv6

    ip tunnel add he-ipv6 mode sit remote 【Tunnel 的 Server IPv4 Address】 local 【阿里云的内网 IPv4 地址】 ttl 255

    ip link set he-ipv6 up

    ip addr add 【IPv6】/64 dev he-ipv6

    ip route add ::/0 dev he-ipv6

    ip -f inet6 addr

    4.测试ipv6

    添加ipv6的dns服务器,在最后添加nameserver 2001:4860:4860::8888,nameserver 2001:4860:4860::8844谷歌的ipv6 dns服务器

    # vim /etc/resolv.conf

    options timeout:1attempts:1 rotate

    nameserver x.x.x.x

    nameserver x.x.x.x

    nameserver 2001:4860:4860::8888

    nameserver 2001:4860:4860::8844

    # ping6 -c 5 ipv6.google.com

    PING ipv6.google.com(tsa03s01-in-x0e.1e100.net) 56 data bytes

    bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=1 ttl=55 time=25.5 ms

    bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=2 ttl=55 time=25.5 ms

    bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=3 ttl=55 time=33.1 ms

    bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=4 ttl=55 time=25.5 ms

    bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=5 ttl=55 time=25.4 ms

    --- ipv6.google.com ping statistics ---

    packets transmitted, 5 received, 0% packet loss, time 4031ms

    rtt min/avg/max/mdev = 25.473/27.040/33.180/3.073 ms

    NGINX 配置

    1、nginx开启IPV6支持配置

    到nginx的sbin目录,cd /usr/local/nginx/sbin,执行命令./nginx -V

    若没有出现--with-ipv6,说明当前的nginx不支持ipv6,我们需要重新编译Nginx,配置里面增加--with-ipv6

    2、nginx配置ipv6监听

    listen 80;

    listen [ ipv6 ]:80;

    listen 443 ssl http2;

    listen [ipv6]:443 ssl http2;

    域名解析

    为网站域名添加AAAA解析,值填 HE 里的Client IPv6 Address,去掉最后的/64 即可。如2001:470:1f18:583::2。

    测试

    http://ipv6-test.com/validate.php在这个网址中输入你的域名就可以了,只要下面两项可以过就可以提交app审核了:

    AAAA DNS record

    IPv6 web server

    如下图所示即表示站点已支持IPv6访问。

    如果IPv6 web server出现web server is unreachable : Connection timed out,自己写一个定时脚本ping指定网址,如ping6 ipv6.baidu.com

    相关文章

      网友评论

          本文标题:阿里云服务器如何设置IPV6通过appstore的审核

          本文链接:https://www.haomeiwen.com/subject/delzpftx.html