Notes commandes ss netstat et autres

Voir :

nstat

hping2

Voir aussi :

tcpdump

Wireshark

syntaxe BPF Berkeley Packet Filter

CLOSE-WAIT

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

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 0 0
UDP 2 2 0
TCP 10 7 3
INET 12 9 3
FRAG 0 0 0

Commande netstat

Voir /proc/net/netstat

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

ss -s