View extended information about network connections using netstat?

เราสามารถใช้คำสั่ง netstat ดูรายละเอียดต่างๆของ network ได้โดยใช้คำสั่งข้างล่างนี้

[root@example ~]# netstat -tuanpeeoT

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       User       Inode      PID/Program name    Timer
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN      0          3117421    -                   off (0.00/0/0)
tcp        0      0 0.0.0.0:1002                0.0.0.0:*                   LISTEN      0          3117348    12270/rpc.rquotad   off (0.00/0/0)
tcp        0      0 0.0.0.0:57071               0.0.0.0:*                   LISTEN      0          3117432    -                   off (0.00/0/0)
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      0          9850       2674/portmap        off (0.00/0/0)
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      0          13340126   3009/cupsd          off (0.00/0/0)
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      0          1011109    3115/sendmail: acce off (0.00/0/0)

tcp        0      0 0.0.0.0:762                 0.0.0.0:*                   LISTEN      0          9907       2700/rpc.statd      off (0.00/0/0)
tcp        0      0 0.0.0.0:955                 0.0.0.0:*                   LISTEN      0          9278482    21127/rpc.rquotad   off (0.00/0/0)
tcp        0      0 0.0.0.0:606                 0.0.0.0:*                   LISTEN      0          3117452    12301/rpc.mountd    off (0.00/0/0)
tcp        0      0 0.0.0.0:959                 0.0.0.0:*                   LISTEN      0          9278501    21132/rpc.mountd    off (0.00/0/0)
tcp        0      0 172.16.44.165:54971         172.16.58.1:6667            ESTABLISHED 500        16475357   6267/xchat          keepalive (6084.39/0/0)
tcp        0      0 172.16.44.165:37952         10.64.69.100:22             ESTABLISHED 0          16773865   13774/ssh           keepalive (589.62/0/0)
tcp        0      0 172.16.44.165:33008         172.16.56.179:6667          ESTABLISHED 500        16475350   6267/xchat          keepalive (6029.82/0/0)
tcp        0      0 172.16.44.165:47940         203.27.221.42:6667          ESTABLISHED 500        16475327   6267/xchat          keepalive (6058.69/0/0)
tcp        0      0 172.16.44.165:58352         140.211.166.4:6667          ESTABLISHED 500        16475334   6267/xchat          keepalive (6092.01/0/0)
tcp        0      0 172.16.44.165:52042         140.211.166.64:6667         ESTABLISHED 500        16475343   6267/xchat          keepalive (6028.85/0/0)
...,

รายละเอียด option ต่างๆที่ใช้

* t – Show TCP
* u – Show UDP
* a – Show both listening and established (outgoing) connections
* n – Do not do Domain lookups, show numerical addresses only
* p – Show the process associated with the connection
* ee – Show lots of extended attributes about the connections
* o – Show information about timers
* T – Do not trim long addresses

You May Have Missed