標籤:default tcp cycle html http cookies cookie time_wait netstat
http://chembo.iteye.com/blog/1503770http://www.2cto.com/os/201007/54067.html
http://blog.csdn.net/dacong/article/details/50485585
主動關閉一方會進入一個TIME_WAIT的中間狀態. 通過netstat 查看到的內容如下:
tcp 0 0 10.19.67.11:40184 10.19.67.11:7012 TIME_WAIT
tcp 0 0 10.19.67.11:39167 10.19.67.11:7012 TIME_WAIT
是 40184的連接埠主動關閉,處於TIME_WAIT狀態。
檢查一下time wait的值:
1 [[email protected] ~]# sysctl -a | grep time | grep wait2 net.netfilter.nf_conntrack_tcp_timeout_close_wait = 603 net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 1204 net.netfilter.nf_conntrack_tcp_timeout_time_wait = 1205 [[email protected] ~]#
檢查net.ipv4.tcp_tw當前值:
1 [[email protected] ~]# sysctl -a|grep net.ipv4.tcp_tw2 net.ipv4.tcp_tw_recycle = 03 net.ipv4.tcp_tw_reuse = 04 [[email protected] ~]#
修改 /etc/sysctl.conf 設定檔,新增內容。
重新生效sysctl.conf 設定檔:
1 [[email protected] ~]# sysctl -p 2 net.ipv4.ip_forward = 0 3 net.ipv4.conf.default.rp_filter = 1 4 net.ipv4.conf.default.accept_source_route = 0 5 kernel.sysrq = 0 6 kernel.core_uses_pid = 1 7 net.ipv4.tcp_syncookies = 1 8 net.bridge.bridge-nf-call-ip6tables = 0 9 net.bridge.bridge-nf-call-iptables = 010 net.bridge.bridge-nf-call-arptables = 011 net.ipv4.tcp_tw_reuse = 112 net.ipv4.tcp_tw_recycle = 1
netstat大量time_wait串連