为什么6to4的优先顺序有所不同

我尝试使用HE的TunnelBroker服务和IANA的192.88.99.1服务,都使用以下脚本进行设置:

#!/bin/sh modprobe # replace {remote_ip} with HE endpoint or 192.88.99.1 ip tunnel add 6to4 mode sit remote {remote_ip} local 221.xxx.xxx.xxx ttl 255 ip link set 6to4 up ip addr add 200x:xxxx:xxxx::2/64 dev 6to4 # for 192.88.99.1 it is 2002:abcd:abcd::1/16 ip route add ::/0 dev 6to4 ip -f inet6 addr 

当我做curl双栈地址来查找我的ip,没有-4-6 ,使用he-ipv6 6to4会返回一个ipv6地址,使用192.88.99.1 6to4会返回ipv4地址(使用-6工作强制ipv6)

我如何强制它默认返回ipv6地址?

6to4使用192.88.99.1已被弃用 ,不应再使用。 因为源地址select机制( RFC 6724 )非常不可靠,所以如果可能的话,系统应该优先selectIPv4 over 6to4。

可以在/etc/gai.conf改变这个,但我强烈build议不要使用6to4。