Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4506
  • Last Modified:

A command/application to print the ARP cache timeout for arp entry

hi,
I need to get the arp cache (arp table) entry timeout.

arp -a command in console doesn't give me that info.
I checked the arp man and --help , no help there :)

I know its possible to change this timeout, but I want to understand how to check (besides actual measuring :)

Thanks.
0
muhalok
Asked:
muhalok
1 Solution
 
wesly_chenCommented:
Hi,

# egrep . /proc/sys/net/ipv4/neigh/eth0/*
...
/proc/sys/net/ipv4/neigh/eth0/gc_stale_time:60     <=== default 1 minute
...
---http://www.uwsg.iu.edu/hypermail/linux/net/0012.2/0035.html ---
   An ARP entry is a candidate to be removed gc_stale_time seconds after last used.
Garbage collection runs every gc_interval seconds which is when the entry can be deleted.
However, an ARP cache entry will not be removed while there is a reference to it such as
route cache entry. The ARP cache entry will move from reachable to stale state in the normal
time but stays stale until the route cache entry is removed.
The route cache may keep an entry for several minutes even with no traffic or sessions to that
address. So after the route cache entry is removed, the reference to the ARP cache entry goes away.
Then next time ARP cache garbage collection runs the entry will be removed.
-----
The other useful command:
# ip -s neigh list

Regards,

Wesly
0
 
muhalokAuthor Commented:
Thanks - exactly what I needed.
Also: Thanks for the additional note about routing cache.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now