dhcpcd ipv6 在日志中过度添加/删除路由

dhcpcd ipv6 在日志中过度添加/删除路由

这与路由器广告有关。目前,我ipv6rs从配置中删除并手动添加路由。有没有更好的方法来消除过多的日志?

Apr 22 16:53:39 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:39 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:42 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:42 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:45 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:45 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:49 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:49 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:53 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:53 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:56 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:53:56 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:00 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:00 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:04 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:04 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:07 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:07 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:10 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:10 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:13 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:13 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:16 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:16 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:20 prince dhcpcd[2358]: eth1: adding default route via fe80::201:5cff:fe63:c046
Apr 22 16:54:20 prince dhcpcd[2358]: eth1: removing default route via fe80::201:5cff:fe63:c046

当前配置如下:

hostname
duid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
noipv6rs
interface eth1
#  ipv6rs
#  ipv6ra_own_default
  iaid 1
  ia_pd 1/::/64 eth2/0/64

答案1

当 dhcpcd 停止时,它不会像预期的那样清除自己添加的路由。但是,一旦 dhcpcd 重新启动并获取 dhcp,它将尝试再次添加路由,并会因为重复而删除自己的路由,但仍会将该路由标记为未添加。

解决方案(在修复此行为之前)是监视添加/删除的日志,然后删除它尝试添加的路由。在上述情况下:

sudo ip -6 route del default via fe80::201:5cff:fe63:c046 dev eth1

一旦完成后,dhcpcd 将重新添加路由并且保持安静。

答案2

sudo ip -6 route del default via fe80::201:5cff:fe63:c046 dev eth1 

(没有第二条路线)为我解决了这个问题。我的操作系统是 Debian 8 Jessie

相关内容