Debian IPv6 配置不适用于一个网络接口

Debian IPv6 配置不适用于一个网络接口

因此,我有一个正在运行的 Debian Buster 系统radvd,它也有一个/etc/network/interfaces,并且由于某种原因,只有我的 wlan0 接口具有来自我分配的 /64 的 IPv6 地址,而不是 eth0 接口,尽管配置没有明显差异。

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:96:8f:f0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe96:8ff0/64 scope link 
       valid_lft forever preferred_lft forever

4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:c3:da:a5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.84.1/24 brd 192.168.84.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 2001:XXXX:XXXX:XX81::1/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fec3:daa5/64 scope link 
       valid_lft forever preferred_lft forever

这是我的radvd.cond...

interface eth0
{
        AdvSendAdvert on;
        prefix 2001:XXXX:XXXX:XX00::1/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
        };
};

interface wlan0
{
        AdvSendAdvert on;
        prefix 2001:XXXX:XXXX:XX81::1/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
        };
};

这是/etc/network/interfaces...

iface lo inet6 loopback

auto eth0

iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        dns-nameservers 192.168.1.7 192.168.1.8
        up route add -net 192.168.84.0 netmask 255.255.255.0 gw 192.168.84.1
        down route del net 192.168.84.0 netmask 255.255.255.0 gw 192.168.84.1
iface eth0 inet6 static
        address 2001:XXXX:XXXX:XX00::1/64

auto wlan0

iface wlan0 inet static
        address 192.168.84.1
        netmask 255.255.255.0
        up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
        up route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
iface wlan0 inet6 static
        address 2001:XXXX:XXXX:XX81::1/64

allow-hotplug eth1
iface eth1 inet manual

最后是sysctl -awlan0 和 eth0 的值...

net.ipv6.conf.eth0.accept_dad = 1
net.ipv6.conf.eth0.accept_ra = 1
net.ipv6.conf.eth0.accept_ra_defrtr = 1
net.ipv6.conf.eth0.accept_ra_from_local = 0
net.ipv6.conf.eth0.accept_ra_min_hop_limit = 1
net.ipv6.conf.eth0.accept_ra_mtu = 1
net.ipv6.conf.eth0.accept_ra_pinfo = 1
net.ipv6.conf.eth0.accept_ra_rt_info_max_plen = 0
net.ipv6.conf.eth0.accept_ra_rt_info_min_plen = 0
net.ipv6.conf.eth0.accept_ra_rtr_pref = 1
net.ipv6.conf.eth0.accept_redirects = 1
net.ipv6.conf.eth0.accept_source_route = 0
net.ipv6.conf.eth0.addr_gen_mode = 0
net.ipv6.conf.eth0.autoconf = 1
net.ipv6.conf.eth0.dad_transmits = 1
net.ipv6.conf.eth0.disable_ipv6 = 0
net.ipv6.conf.eth0.disable_policy = 0
net.ipv6.conf.eth0.drop_unicast_in_l2_multicast = 0
net.ipv6.conf.eth0.drop_unsolicited_na = 0
net.ipv6.conf.eth0.enhanced_dad = 1
net.ipv6.conf.eth0.force_mld_version = 0
net.ipv6.conf.eth0.force_tllao = 0
net.ipv6.conf.eth0.forwarding = 2
net.ipv6.conf.eth0.hop_limit = 64
net.ipv6.conf.eth0.ignore_routes_with_linkdown = 0
net.ipv6.conf.eth0.keep_addr_on_down = 0
net.ipv6.conf.eth0.max_addresses = 16
net.ipv6.conf.eth0.max_desync_factor = 600
net.ipv6.conf.eth0.mc_forwarding = 0
net.ipv6.conf.eth0.mldv1_unsolicited_report_interval = 10000
net.ipv6.conf.eth0.mldv2_unsolicited_report_interval = 1000
net.ipv6.conf.eth0.mtu = 1500
net.ipv6.conf.eth0.ndisc_notify = 0
net.ipv6.conf.eth0.ndisc_tclass = 0
net.ipv6.conf.eth0.proxy_ndp = 0
net.ipv6.conf.eth0.regen_max_retry = 3
net.ipv6.conf.eth0.router_probe_interval = 60
net.ipv6.conf.eth0.router_solicitation_delay = 1
net.ipv6.conf.eth0.router_solicitation_interval = 4
net.ipv6.conf.eth0.router_solicitation_max_interval = 3600
net.ipv6.conf.eth0.router_solicitations = -1
net.ipv6.conf.eth0.seg6_enabled = 0
net.ipv6.conf.eth0.suppress_frag_ndisc = 1
net.ipv6.conf.eth0.temp_prefered_lft = 86400
net.ipv6.conf.eth0.temp_valid_lft = 604800
net.ipv6.conf.eth0.use_oif_addrs_only = 0
net.ipv6.conf.eth0.use_tempaddr = 0

以下是 wlan0 接口 sysctl 值...

net.ipv6.conf.wlan0.accept_dad = 1
net.ipv6.conf.wlan0.accept_ra = 1
net.ipv6.conf.wlan0.accept_ra_defrtr = 1
net.ipv6.conf.wlan0.accept_ra_from_local = 0
net.ipv6.conf.wlan0.accept_ra_min_hop_limit = 1
net.ipv6.conf.wlan0.accept_ra_mtu = 1
net.ipv6.conf.wlan0.accept_ra_pinfo = 1
net.ipv6.conf.wlan0.accept_ra_rt_info_max_plen = 0
net.ipv6.conf.wlan0.accept_ra_rt_info_min_plen = 0
net.ipv6.conf.wlan0.accept_ra_rtr_pref = 1
net.ipv6.conf.wlan0.accept_redirects = 1
net.ipv6.conf.wlan0.accept_source_route = 0
net.ipv6.conf.wlan0.addr_gen_mode = 0
net.ipv6.conf.wlan0.autoconf = 0
net.ipv6.conf.wlan0.dad_transmits = 1
net.ipv6.conf.wlan0.disable_ipv6 = 0
net.ipv6.conf.wlan0.disable_policy = 0
net.ipv6.conf.wlan0.drop_unicast_in_l2_multicast = 0
net.ipv6.conf.wlan0.drop_unsolicited_na = 0
net.ipv6.conf.wlan0.enhanced_dad = 1
net.ipv6.conf.wlan0.force_mld_version = 0
net.ipv6.conf.wlan0.force_tllao = 0
net.ipv6.conf.wlan0.forwarding = 2
net.ipv6.conf.wlan0.hop_limit = 64
net.ipv6.conf.wlan0.ignore_routes_with_linkdown = 0
net.ipv6.conf.wlan0.keep_addr_on_down = 0
net.ipv6.conf.wlan0.max_addresses = 16
net.ipv6.conf.wlan0.max_desync_factor = 600
net.ipv6.conf.wlan0.mc_forwarding = 0
net.ipv6.conf.wlan0.mldv1_unsolicited_report_interval = 10000
net.ipv6.conf.wlan0.mldv2_unsolicited_report_interval = 1000
net.ipv6.conf.wlan0.mtu = 1500
net.ipv6.conf.wlan0.ndisc_notify = 0
net.ipv6.conf.wlan0.ndisc_tclass = 0
net.ipv6.conf.wlan0.proxy_ndp = 0
net.ipv6.conf.wlan0.regen_max_retry = 3
net.ipv6.conf.wlan0.router_probe_interval = 60
net.ipv6.conf.wlan0.router_solicitation_delay = 1
net.ipv6.conf.wlan0.router_solicitation_interval = 4
net.ipv6.conf.wlan0.router_solicitation_max_interval = 3600
net.ipv6.conf.wlan0.router_solicitations = -1
net.ipv6.conf.wlan0.seg6_enabled = 0
net.ipv6.conf.wlan0.suppress_frag_ndisc = 1
net.ipv6.conf.wlan0.temp_prefered_lft = 86400
net.ipv6.conf.wlan0.temp_valid_lft = 604800
net.ipv6.conf.wlan0.use_oif_addrs_only = 0
net.ipv6.conf.wlan0.use_tempaddr = 2

wlan0 接口看起来很相似,尽管我检查过它net.ipv6.conf.eth0.autoconf是否被设置为并且1肯定没有设置。sysctl.confsysctl.d

答案1

如果互联网设置因 ifupdown 而失败,它们将阻止inet6要应用的设置。

当 eth0 首次启动时,wlan0 可能尚未启动,也没有配置 IP。因此,通过 wlan0 的 IP 进行路由的额外(甚至可能不需要)设置不起作用。这导致 eth0 无法启动(逻辑上:从 ifupdown 的角度来看。它实际上已启动),并且 inet6 节未运行。

因此:删除所有这些额外的up route add/del条目。如果您真的不想删除它们,请在每个条目的末尾添加一个额外的|| true(或),以防止这些命令导致整个设置失败。2>/dev/null || :

相关内容