Outils pour utilisateurs

Outils du site


tech:notes_commandes_ss_netstat_et_autres

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tech:notes_commandes_ss_netstat_et_autres [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:notes_commandes_ss_netstat_et_autres [2025/03/24 16:18] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Réseau Sniff Packet}}
 +
 +
 +
 +# Notes commandes ss netstat et autres
 +
 +Voir : 
 +* nstat
 +* hping2
 +
 +Voir aussi :
 +* [[Notes tcpdump|tcpdump]]
 +* [[Notes analyse de paquets réseau avec Wireshark|Wireshark]]
 +* syntaxe BPF Berkeley Packet Filter
 +
 +
 +## CLOSE-WAIT
 +
 +~~~bash
 +ss --tcp state CLOSE-WAIT
 +ss --tcp state CLOSE-WAIT --kill
 +~~~
 +
 +''/proc/sys/net/ipv4/tcp_keepalive_time''
 +
 +Voir :
 +* http://www4.cs.fau.de/Projects/JX/Projects/TCP/tcpstate.html
 +* https://qastack.fr/ubuntu/538443/whats-the-difference-between-port-status-listening-time-wait-close-wait
 +* https://www.thegeekdiary.com/high-number-of-connections-is-close_wait-state-in-netstat-command-output/
 +* https://lafibre.info/tcpip/time_wait/
 +* https://blog.cloudflare.com/this-is-strictly-a-violation-of-the-tcp-specification/
 +
 +
 +## Commande ss
 +
 +~~~bash
 +ss -tn -4 state established not src 127.0.0.1
 +ss -n -t src :5455
 +~~~
 +
 +~~~
 +# ss -s
 +Total: 281 (kernel 3060)
 +TCP:   10 (estab 4, closed 0, orphaned 0, synrecv 0, timewait 0/0), ports 0
 +
 +Transport Total     IP        IPv6
 +*         3060      -         -
 +RAW                       0
 +UDP                       0
 +TCP       10        7         3
 +INET      12        9         3
 +FRAG      0                 0
 +~~~
 +
 +
 +## Commande netstat
 +
 +Voir ''/proc/net/netstat''
 +
 +~~~bash
 +netstat -nat |sed '2d' | awk '{print $6}' | sort | uniq -c | sort -n
 +~~~
 +
 +~~~
 +      1 Foreign
 +      4 SYN_RECV
 +     12 LISTEN
 +    131 ESTABLISHED
 +    191 CLOSE_WAIT
 +    270 TIME_WAIT
 +~~~
 +
 +Source: https://www.skyminds.net/serveur-dedie-reduire-les-connexions-time_wait-des-sockets-et-optimiser-tcp/
 +
 +C'est l'équivalent de
 +~~~bash
 +ss -s
 +~~~
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki