ipv4: Neighbour table overflow


I was noticing the below error message in /var/log/messages. I also noticed that my linux DHCP server was not serving leases. Again, I modified the sysctl file to fix the issue.

Problem:
Jun 21 07:56:03 localhost kernel: [36050.926734] ipv4: Neighbour table overflow.
Jun 21 07:56:03 localhost kernel: [36050.930354] ipv4: Neighbour table overflow.
Jun 21 08:01:02 localhost kernel: [36349.592127] ipv4: Neighbour table overflow.

Solution:
1. Edit /etc/sysctl.conf
 vi /etc/sysctl.conf2. Change to have the following values

net.ipv4.neigh.default.gc_thresh1 = 8192
net.ipv4.neigh.default.gc_thresh2 = 16384
net.ipv4.neigh.default.gc_thresh3 = 16384

2. To load new changes type the following command:

  sysctl -p

What are these 3 parameters?

These parameters are defined in the Linux Kernel Code in /include/net/neighbour.h as integer, which suggests that maximal accepted value is (2^32 - 1)

gc_thresh1 - The minimum number of entries to keep in the ARP cache.

gc_thresh2 - The soft maximum number of entries to keep in the ARP cache. 

gc_thresh3 - The hard maximum number of entries to keep in the ARP cache. 



No buffer space available

I was noticing the below error message when I try to ping or telnet/ssh from my Linux machine. I also noticed similar error messages in /var/log/messages.

I modified the sysctl file to fix the issue.


Problem:
---------
May 29 16:27:01 localhost dhcpd: icmp_echorequest 155.1.19.178: No buffer space available
May 29 16:27:01 localhost kernel: [11032.635447] ipv4: Neighbour table overflow.

Solution:
---------
1. Edit /etc/sysctl.conf

 vi /etc/sysctl.conf

2. Change to have the following values

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.neigh.default.gc_thresh1 = 4096
net.ipv4.neigh.default.gc_thresh2 = 8192
net.ipv4.neigh.default.gc_thresh3 = 8192
net.ipv4.neigh.default.base_reachable_time = 86400
net.ipv4.neigh.default.gc_stale_time = 86400

3. To load new changes type the following command:

  sysctl -p