服务器支持IPv6

这几天一直提示服务器即将过期,直到今天上班才又看了下,结果发现真的快过期了。于是就想着续费,结果算了一下一年2000多,这尼码好贵啊。问题是根本不值啊,虽然挂了好几个站。而之所以服务器变得这么贵是因为去年的时候实在受不了服务器越来越卡,直接升级配置,结果升级到现在就成了这个样子了。这就很离谱啊。

这也太离谱啦,降低支配之后还要1600.于是果断的重新开启了一台新的服务器。为了更方便的迁移数据可以直接使用现有的系统盘创建一个自定义镜像,新服务器直接使用创建的镜像启动就ok了,无需做任何的数据迁移。配置完成之后呢,发现实例支持ipv6了,于是顺便开启了一下ipv6。在he.net设置解析之后等了半天没生效,后来发现用的服务器还在阿里云。

问题是竟然没报错,这就很神奇啊。在阿里云重新添加解析之后就ok了。等了十几分钟生效之后发现AAAA记录有了,但是访问端口80不通。初步怀疑是组策略问题,组策略添加之后依然不通。通过 iptables可以看到端口是开放的。

root@hack:/home/wwwroot/h4ck# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
DROP tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT icmp -- anywhere anywhere icmp echo-request

Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:3001

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere

Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere

但是iptables对应还有v6的半天,组策略添加之后并没有自动添加相关的端口规则:

root@hack:/home/wwwroot/h4ck# ip6tables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

通过下面的命令添加策略:

ip6tables -A INPUT -p tcp --dport 80 -j ACCEPT
ip6tables -A INPUT -p tcp --dport 443 -j ACCEPT
ip6tables -A INPUT -p tcp --dport 3306 -j ACCEPT

再次查看就ok了:

root@hack:/home/wwwroot/h4ck# ip6tables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp anywhere anywhere tcp dpt:http
ACCEPT tcp anywhere anywhere tcp dpt:https
ACCEPT tcp anywhere anywhere tcp dpt:mysql

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

不过此时访问依然不通,这就神奇了,后来想起来可能是nginx监听的问题,修改nginx配置文件,去掉v6前的注释:

重启nginx,现在就ok啦。

v6地址的80端口已经在坚挺了。家里的联通是支持ipv6的可以看下解析:

直接访问也是ok的。

探测效果:

https://www.boce.com/ipv6/h4ck.org.cn

he.net的认证也升级啦:

IPv6 Certification Badge for obaby

☆版权☆

* 网站名称:obaby@mars
* 网址:https://h4ck.org.cn/
* 个性:https://oba.by/
* 本文标题: 《服务器支持IPv6》
* 本文链接:https://h4ck.org.cn/2023/02/11253
* 短链接:https://oba.by/?p=11253
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


猜你喜欢:

11 comments

  1. Level 3
    Firefox 110 Firefox 110 Windows 10 Windows 10 cn辽宁省沈阳市 联通

    很可以啊!IPV6认证 哈哈。

    我是简单暴力一点,直接套CF解析,不然IPV6的服务器,不知道怎么用。

  2.   Level 6
    Google Chrome 109 Google Chrome 109 Mac OS X 10.15 Mac OS X 10.15 cn浙江省杭州市 华数

    ipv6 除了苹果审核要用到,我还想不到哪里是需要的

    1. 公主 Queen 
      Google Chrome 102 Google Chrome 102 Mac OS X 10.15 Mac OS X 10.15 cn山东省青岛市 移动

      确实没啥太大用处,之前为了上appstore ipv6还是用的he的隧道。现在直接ipv6了,也没啥应用需要上架了。 sarcastic

  3.  Level 4
    Microsoft Edge 110 Microsoft Edge 110 Windows 10 Windows 10 cn四川省雅安市 移动

    服务器没弄过这个,都是在cdn上弄得,哈哈哈,主要是太菜

    1. 公主 Queen 
      Google Chrome 102 Google Chrome 102 Mac OS X 10.15 Mac OS X 10.15 cn山东省济南市 移动

      其实这个也没什么太大用处,就是看着花哨而已

  4.  Level 6
    Microsoft Edge 110 Microsoft Edge 110 Windows 10 Windows 10 cn北京市 移动/中国移动北京分公司

    之前也开了IPV6,但发现流量分析无法使用了,后来又给关了!

    1. 公主 Queen 
      Google Chrome 102 Google Chrome 102 Mac OS X 10.15 Mac OS X 10.15 cn山东省济南市 移动

      嗯嗯,现在家里虽然也有ipv6。但是v6的解析和映射都没做。所以目前从cdn到家里的宽带应该是走不了v6的。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注