旁路由做了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(v6把-4改成-6就行了):
ip -4 neigh show nud all | wc -l
旁路由默认情况下只用ipv4,可得:

308……比较接近当前设置的极限了,这还是低峰时期呢,高峰期丢包更是频繁一点……
临时修改:
sysctl -w net.ipv4.neigh.default.gc_thresh1=2048<br>sysctl -w net.ipv4.neigh.default.gc_thresh2=4096<br>sysctl -w net.ipv4.neigh.default.gc_thresh3=8192<br>sysctl -w net.ipv6.neigh.default.gc_thresh1=2048<br>sysctl -w net.ipv6.neigh.default.gc_thresh2=4096<br>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
文章评论