该死的破联通,IPv6问题

整了好久的ipv6,发现只要用那么一阵子。就不能用了。我特么以为我的问题。今天发现了这个,简直气死了。IPv6还转了个IPv4。


  1    <1 毫秒   <1 毫秒   <1 毫秒 2408:8266:103:9:215:5dff:fee0:104
  2     4 ms     8 ms     4 ms  2408:8266:102::
  3     3 ms     3 ms     3 ms  2408:8001:7030::2:da
  4     *        *        *     请求超时。
  5     4 ms     6 ms     4 ms  2408:8001:7160::1:b
  6     5 ms     5 ms     4 ms  2408:8766:0:1::67
  7     4 ms     4 ms     4 ms  ::ffff:116.251.119.149
  8     4 ms     4 ms     4 ms  fd00:0:1000:3396::1
  9     *        *        *     请求超时。
 10    16 ms     5 ms     5 ms  fd10:d102:1:4418::1
 11     5 ms     5 ms     5 ms  public1.alidns.com [2400:3200::1]

导致返回的dns请求都是ipv4的,然后没有v6地址,自然就访问不了。

Ubuntu20作为路由,设置IPv6 PPPoe slaac配置例子

Dnsmasq配置如下:

enable-ra
dhcp-range=::1,constructor:eth2,ra-only,12h
except-interface=ppp0

Wide-dhcpv6配置如下:

  profile default
{
   information-only;
  
  request domain-name-servers;
  request domain-name;

  script "/etc/wide-dhcpv6/dhcp6c-script";
};
interface ppp0 {
    # Request Prefix Delegation on ppp0, and give the received prefix id 0
    send ia-pd 0;
};

# Use subnets from the prefix with id 0
id-assoc pd 0 {
        prefix ::/64 infinity;
        prefix-interface eth2 {
        sla-len 0;
        sla-id 1;
        ifid 1;
    };
};
如果有多个内网网口,配置变更如下:

profile default
{
   information-only;
  
  request domain-name-servers;
  request domain-name;

  script "/etc/wide-dhcpv6/dhcp6c-script";
};
interface ppp0 {
    # Request Prefix Delegation on ppp0, and give the received prefix id 0
    send ia-pd 0;
};

# Use subnets from the prefix with id 0
id-assoc pd 0 {
        prefix ::/64 infinity;
              prefix-interface eth1 {
        sla-len 0;
        sla-id 1;
        ifid 1;
    };        prefix-interface eth2 {
        sla-len 0;
        sla-id 1;
        ifid 1;
    };
};

sysctl.conf部分配置如下:

net.ipv6.conf.eth2.accept_ra=2
net.ipv6.conf.ppp0.accept_ra=2
net.ipv6.conf.all.use_tempaddr=0
net.ipv6.conf.default.use_tempaddr=0

service服务文件如下:

[Unit]
Description=wide-dhcpv6
Before=dnsmasq.service
After=network.target 
[Service]
ExecStart=/usr/sbin/dhcp6c -c /etc/wide-dhcpv6/dhcp6c.conf -P default -d -D -f ppp0
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

/etc/ppp/option配置文件部分如下:

+ipv6 ipv6cp-use-ipaddr