当前位置:首页 > 运维 > 正文内容

OpenWrt ARP缓存溢出问题解决

MuWind9个月前 (08-24)运维134

旁路由做了FullconeNAT之后,比特彗星测试结果还是PortStrictedFullconeNAT,同时通过dmesg进行内核诊断,我发现日志总是爆出ARP缓存溢出的错误:

[ 5352.346674] net_ratelimit: 1870 callbacks suppressed
[ 5352.346681] neighbour: arp_cache: neighbor table overflow!
[ 5352.347995] neighbour: arp_cache: neighbor table overflow!
[ 5352.348690] neighbour: arp_cache: neighbor table overflow!
[ 5352.348922] neighbour: arp_cache: neighbor table overflow!
[ 5352.349371] neighbour: arp_cache: neighbor table overflow!
[ 5352.350341] neighbour: arp_cache: neighbor table overflow!
[ 5352.351033] neighbour: arp_cache: neighbor table overflow!
[ 5352.351733] neighbour: arp_cache: neighbor table overflow!
[ 5352.352422] neighbour: arp_cache: neighbor table overflow!
[ 5352.353103] neighbour: arp_cache: neighbor table overflow!
[ 5382.685484] net_ratelimit: 2982 callbacks suppressed
[ 5382.685491] neighbour: arp_cache: neighbor table overflow!
[ 5382.686173] neighbour: arp_cache: neighbor table overflow!
[ 5382.686629] neighbour: arp_cache: neighbor table overflow!
[ 5382.687556] neighbour: arp_cache: neighbor table overflow!
[ 5382.688252] neighbour: arp_cache: neighbor table overflow!
[ 5382.688892] neighbour: arp_cache: neighbor table overflow!
[ 5382.689519] neighbour: arp_cache: neighbor table overflow!
[ 5382.690180] neighbour: arp_cache: neighbor table overflow!
[ 5382.690862] neighbour: arp_cache: neighbor table overflow!
[ 5382.691515] neighbour: arp_cache: neighbor table overflow!

openwrt的gc阈值控制分为三挡,1档表示最小可保留数量,2档表示当ARP表的数量达到此值时,GC会清理大于5s的表项,3档表示最大的可保存表项的数量,超过就会触发GC全部清理。

OpenWrt我没记错的话第三档默认为512,,再看一下现在的ARP条目:

IPv4:

ip -4 neigh show nud all | wc -l

IPv6:

ip -6 neigh show nud all | wc -l

旁路由默认情况下只用ipv4,可得:

image.png

308……比较接近当前设置的极限了,这还是低峰时期呢,高峰期丢包更是频繁一点……

临时修改:

sysctl -w net.ipv4.neigh.default.gc_thresh1=2048
sysctl -w net.ipv4.neigh.default.gc_thresh2=4096
sysctl -w net.ipv4.neigh.default.gc_thresh3=8192
sysctl -w net.ipv6.neigh.default.gc_thresh1=2048
sysctl -w net.ipv6.neigh.default.gc_thresh2=4096
sysctl -w net.ipv6.neigh.default.gc_thresh3=8192

修改/etc/sysctl.conf永久保存:

net.ipv4.neigh.default.gc_thresh1 = 2048

net.ipv4.neigh.default.gc_thresh2 = 4096

net.ipv4.neigh.default.gc_thresh3 = 8192

net.ipv6.neigh.default.gc_thresh1 = 2048

net.ipv6.neigh.default.gc_thresh2 = 4096

net.ipv6.neigh.default.gc_thresh3 = 8192

2023.9.9更新:

彻底的解决方法就是直接让openwrt做主路由……

image.png

“OpenWrt ARP缓存溢出问题解决” 的相关文章

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。