netstat

通信してるかどうかを確認するコマンド

StatでESTABLISHEDがあるのが通信しているもの サーバ止めたりする時に確認しよう

[code lang=text] [asteltk2-234-26965 ] $ sudo netstat -lanput Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0: LISTEN 13015/nginx
tcp 0 0 0.0.0.0:2002 0.0.0.0:
LISTEN 1214/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0: LISTEN 1456/master
tcp 0 0 0.0.0.0:443 0.0.0.0:
LISTEN 13015/nginx
tcp 0 0 127.0.0.1:2812 0.0.0.0: LISTEN 11034/monit
tcp 0 0 160.16.117.219:2002 210.148.42.54:62629 ESTABLISHED 18641/sshd
tcp 0 0 ::ffff:0.0.0.0:25565 :::
LISTEN 2842/java
tcp 0 0 :::3306 ::: LISTEN 23198/mysqld
tcp 0 0 :::2002 :::
LISTEN 1214/sshd
tcp 0 0 ::1:25 ::: LISTEN 1456/master
udp 0 0 160.16.117.219:123 0.0.0.0:
1256/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0: 1256/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:
1256/ntpd
udp 0 0 2001:e42:102:1534:160:16:123 ::: 1256/ntpd
udp 0 0 fe80::9ea3:baff:fe01:eff:123 :::
1256/ntpd
udp 0 0 ::1:123 ::: 1256/ntpd
udp 0 0 :::123 :::
1256/ntpd
[/code]