arp cache 업데이트 시간을 줄이려 합니다.

swunk의 이미지

sysctl 로 확인을 해보니 관련 타이머가 한 서너개(gc_timer1....) 정도 나오는데요...

지금 현재는 arp 캐쉬가 5분 이상 지속되는것 같습니다. arp -d ,옵션으로 지워도 상태가 incomplete 상태로 나오고 proc 값에는 계속 연결되어 있는 것으로 나오는데요... arp 캐쉬에서 element 가 지워지는 시간 즉, stale 상태로 빨리 전이시키고자 합니다.

어느 값을 변경하면 될까요 ?

커널 코드를 바꿔서 재 콤파일 하는 방법 말고 sysctl 값을 이용해서 변경할 수 있는 방법이 있을것 같은데요...

고수님들의 답변 부탁드립니다.

wariua의 이미지

man arp(7) wrote:
SYSCTLS

gc_interval
How frequently the garbage collector for neighbour entries should attempt to run. Defaults to 30 seconds.

gc_stale_time
Determines how often to check for stale neighbour entries. When a neighbour entry is considered stale it is resolved again before sending data to it. Defaults to 60 seconds.

gc_thresh1
...


net.ipv4.neigh.[default|lo|eth0|...].gc_stale_time 항목을 건드려 주시면 되지 않을까 합니다. 흠... 그런데 5분이란 건 좀 이상하군요-

$PWD `date`