2025年6月2日星期一

甲骨文VPS,无法获取到IPV6地址

 折腾了好几个小时,无论如何IPV6都无法通信。

面板已经分配了IPV6 , 配置子网,默认路由,但是VPS上总是无法获取到IPV6的地址。

手动配置IPV6地址也无法通信,耗费了半天时间,最后偶然想起来,放行546,547端口竟然一下子就成功了,这个iptables真是坑死我了。


# 清空规则

sudo ip6tables -F

sudo ip6tables -X


# 设置默认策略(DROP)

sudo ip6tables -P INPUT DROP

sudo ip6tables -P FORWARD DROP

sudo ip6tables -P OUTPUT ACCEPT


# 本地回环

sudo ip6tables -A INPUT -i lo -j ACCEPT


# 允许已建立连接的数据流

sudo ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT


# ICMPv6 必须全部放行

sudo ip6tables -A INPUT -p ipv6-icmp -j ACCEPT

sudo ip6tables -A OUTPUT -p ipv6-icmp -j ACCEPT


# DHCPv6(服务器端口 547,客户端端口 546)

sudo ip6tables -A INPUT -p udp --dport 546 --sport 547 -j ACCEPT

sudo ip6tables -A OUTPUT -p udp --dport 547 --sport 546 -j ACCEPT


# SSH、HTTP、HTTPS、其他自定义端口

sudo ip6tables -A INPUT -p tcp --dport 22 -j ACCEPT

sudo ip6tables -A INPUT -p tcp --dport 80 -j ACCEPT

sudo ip6tables -A INPUT -p tcp --dport 443 -j ACCEPT


# 确认是否放行成功
sudo ip6tables -L INPUT -n --line-numbers

# 保存防火墙配置
sudo netfilter-persistent save

# 申请IP吧,一下子就成功了
dhclient -v -6 enp0s6


没有评论:

发表评论

XG-040G-XX SuPassword 解密工具

 买了新光猫 XG-040G-TF ,  所以写了一个 SuPassword 解密工具, 以备不时之需 . 点击下载