首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不适用于一个网络接口的Debian IPv6配置

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

Server Fault用户
提问于 2019-12-18 03:36:04
回答 1查看 543关注 0票数 1

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

代码语言:javascript
运行
复制
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..。

代码语言:javascript
运行
复制
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..。

代码语言:javascript
运行
复制
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 -a值为wlan0和eth0..。

代码语言:javascript
运行
复制
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值..。

代码语言:javascript
运行
复制
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中设置。

EN

回答 1

Server Fault用户

发布于 2019-12-18 07:07:39

如果inet设置在ifupdown中失败,它们将阻止应用inet6设置。

当eth0第一次被提出来时,wlan0可能还没有并且没有IP配置。因此,通过wlan0 0‘S IP路由的额外设置(甚至可能不需要)不起作用。这使得eth0无法被提出来(从逻辑上:从ifupdown的角度来看)。它实际上是提出来的),而inet6节并没有通过。

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

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/995969

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档