SHARE
TWEET

Untitled

a guest Jan 21st, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #CLOSED:无连接是活动的或正在进行  
  2. #LISTEN:服务器在等待进入呼叫  
  3. #SYN_RECV:一个连接请求已经到达,等待确认  
  4. #SYN_SENT:应用已经开始,打开一个连接  
  5. #ESTABLISHED:正常数据传输状态  
  6. #FIN_WAIT1:应用说它已经完成  
  7. #FIN_WAIT2:另一边已同意释放  
  8. #ITMED_WAIT:等待所有分组死掉  
  9. #CLOSING:两边同时尝试关闭  
  10. #TIME_WAIT:另一边已初始化一个释放  
  11. #LAST_ACK:等待所有分组死掉
  12.  
  13. # 查看连接的各状态数量
  14. netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  15.  
  16. # 修改网络参数
  17. vi /etc/sysctl.conf  
  18.  
  19. net.ipv4.tcp_syncookies = 1  
  20. net.ipv4.tcp_tw_reuse=1 #让TIME_WAIT状态可以重用,这样即使TIME_WAIT占满了所有端口,也不会拒绝新的请求造成障碍 默认是0  
  21. net.ipv4.tcp_tw_recycle=1 #让TIME_WAIT尽快回收 默认0  
  22. net.ipv4.tcp_fin_timeout=30  
  23.  
  24. # 让修改生效
  25. /sbin/sysctl -p
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top