문] 11.x 에서 fin_wait_2 timer 를 설정하려면 ?
답] 11.x 는 TCP/IP 가 Streams TCP/IP 로 module 이 변경되어 있기 때문에
특별히 kernel에 TCP/IP 관련 변수들을 가지고 있지 않습니다.
다만 주기적으로 FIN_WAIT_2 상태에 빠진 port 를 삭제해줘야 합니다.
다음의 script 로 fin_wait_2 에 빠진 script 를 삭제할 수 있습니다.
#!/usr/bin/ksh
#
# "flush_stale_finw2" -- Wolffman 6/2/98
#
# Script to flush stale FIN_WAIT_2 sockets.
# Script execution with the "-f" option results in
# HP machine sending TCP RST along with clean release
# and freeing of associated connection resources.
# (Essentially, returning kernel memory back for reuse.)
#
# Suggestion: invoke via "cron" job during off hours
#
#
#
# Usage: flush_stale_finw2 # To list sockets in FIN_WAIT_2state
# flush_stale_finw2 -f # To actually force theirremoval
#
#
if test "$1" = "-f"
then
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2 |
awk '{ printf "ndd -set /dev/tcp tcp_discon 0x%s\n", $1 }' > /tmp/finw2
/sbin/chmod 700 /tmp/finw2
/usr/bin/ksh -x /tmp/finw2
/sbin/rm /tmp/finw2
else
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2
fi
답] 11.x 는 TCP/IP 가 Streams TCP/IP 로 module 이 변경되어 있기 때문에
특별히 kernel에 TCP/IP 관련 변수들을 가지고 있지 않습니다.
다만 주기적으로 FIN_WAIT_2 상태에 빠진 port 를 삭제해줘야 합니다.
다음의 script 로 fin_wait_2 에 빠진 script 를 삭제할 수 있습니다.
#!/usr/bin/ksh
#
# "flush_stale_finw2" -- Wolffman 6/2/98
#
# Script to flush stale FIN_WAIT_2 sockets.
# Script execution with the "-f" option results in
# HP machine sending TCP RST along with clean release
# and freeing of associated connection resources.
# (Essentially, returning kernel memory back for reuse.)
#
# Suggestion: invoke via "cron" job during off hours
#
#
#
# Usage: flush_stale_finw2 # To list sockets in FIN_WAIT_2state
# flush_stale_finw2 -f # To actually force theirremoval
#
#
if test "$1" = "-f"
then
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2 |
awk '{ printf "ndd -set /dev/tcp tcp_discon 0x%s\n", $1 }' > /tmp/finw2
/sbin/chmod 700 /tmp/finw2
/usr/bin/ksh -x /tmp/finw2
/sbin/rm /tmp/finw2
else
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2
fi