设置neigh的值

编辑/etc/sysctl.conf文件

# vi /etc/sysctl.conf

根据实际情况进行调整

# 设置垃圾回收间隔
net.ipv4.neigh.default.gc_interval = 3600
 
# 设置缓存超时时间
net.ipv4.neigh.default.gc_stale_time = 3600
 
# 设置DNS arp的阈值
net.ipv4.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_thresh2 = 1024
net.ipv4.neigh.default.gc_thresh1 = 256

重新加载,使设置生效。

# sysctl -p

解决方案

需要增加内核的ARP缓存大小。

相关的内核变量有:

net.ipv4.neigh.default.gc_thresh1
net.ipv4.neigh.default.gc_thresh2
net.ipv4.neigh.default.gc_thresh3

查看当前的内核变量值

# sysctl net.ipv4.neigh.default.gc_thresh1
# sysctl net.ipv4.neigh.default.gc_thresh2
# sysctl net.ipv4.neigh.default.gc_thresh3

输出示例:

net.ipv4.neigh.default.gc_thresh1 = 128
net.ipv4.neigh.default.gc_thresh2 = 512
net.ipv4.neigh.default.gc_thresh3 = 1024
Linux kernel: Neighbour table overflow.

问题

在Debian/CentOS/RHEL/Fedora/Ubuntu Linux中的

/var/log/messages日志文件文件报错:

kernel: Neighbour table overflow.

日期:2019-11-20 08:52:42 来源:oir作者:oir