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

OpenWrt ARP缓存溢出问题解决

MuWinds2年前 (2023-08-24)运维278

旁路由做了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缓存溢出问题解决” 的相关文章

centos分区挂载磁盘

准备建个nas服务,大容量的硬盘是必不可少的。去经理那拿了块4T的硬盘,以后有需要我再加吧。硬盘硬件上的安装很简单,插两根线拧螺丝就行了。接下来说的是挂到系统先查看一下盘子是不是安装上了:fdisk -l但凡眼睛没问题的 都能找到自己那块新装的盘:连着按一个N键和三个p键就行然后格式化:m...

Zblog of Cloudflare插件

用了大约一小时的时间(包含躲着我妈写的时间)业余玩玩的插件,省的各位发完文章还得去cf purge all cachegithub项目地址:https://github.com/MuWinds/zblog_cloudflare...

Zerotier配合Nginx实现内网穿透

之前博客网站一直用的家里机器配合香港Azure做frp内网穿透,用CF CDN进行数据分发,不提frp的虚拟局域网模式在跨国数据传输时面临的数据审查和路由方向会给速度及稳定性造成非常大的影响,其可能有的内存溢出和服务重启时的持续掉线问题也是很抓狂的,在这里,使用zerotier为两机打洞连接p2p,...

CentOS Python后台运行

nohup python /data/python/server.py > python.log3 2>&1 &说明:1、1是标准输出(STDOUT)的文件描述符,2是标准错误(STDERR)的文件描述符 &nb...

CentOS设置开机启动

AIO出现了硬盘问题,重启后发现离线下载服务没有开机自启,快速给开一下:先写一个开机自启的脚本:#!/bin/sh #chkconfig: 2345 80 90 #description:aria2开机自启 aria2c --conf-path=/e...

雨云CDN清除指定文件的缓存

雨云的CDN并没有给用户清除缓存的选项,想清除缓存的话其实挺麻烦的。通过浏览器对网站的请求头我们可以看到,CDN的服务器是apache apisix通过查阅apisix有关缓存的文档,我们可以发现清除缓存的方法:https://apisix.apache.org/zh/docs/apisix/2.1...

发表评论

访客

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