[shell] netstat

usage: netstat [-veenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}
      netstat [-vnNcaeol] [<Socket> ...]
      netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]

       -r, --route                display routing table
       -I, --interfaces=[<Iface>] display interface table for <Iface>
       -i, --interfaces           display interface table
       -g, --groups               display multicast group memberships
       -s, --statistics           display networking statistics (like SNMP)
       -M, --masquerade           display masqueraded connections

       -v, --verbose              be verbose
       -n, --numeric              don't resolve names
       --numeric-hosts            don't resolve host names
       --numeric-ports            don't resolve port names
       --numeric-users            don't resolve user names
       -N, --symbolic             resolve hardware names
       -e, --extend               display other/more information
       -p, --programs             display PID/Program name for sockets
       -c, --continuous           continuous listing

       -l, --listening            display listening server sockets
       -a, --all, --listening     display all sockets (default: connected)
       -o, --timers               display timers
       -F, --fib                  display Forwarding Information Base (default)
       -C, --cache                display routing cache instead of FIB
       -T, --notrim               stop trimming long addresses
       -Z, --context              display SELinux security context for sockets

예제(라우팅 정보 출력)

[root /]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.62.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
211.174.62.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
0.0.0.0         211.174.62.1    0.0.0.0         UG        0 0          0 eth0

예제( Listen 정보 출력)

[root /]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address           State       PID/Program name
tcp        0      0 0.0.0.0:49444               0.0.0.0:*                 LISTEN      2297/rpc.statd
tcp        0      0 0.0.0.0:873                 0.0.0.0:*                 LISTEN      2604/xinetd
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                 LISTEN      2928/mysqld
tcp        0      0 0.0.0.0:29998               0.0.0.0:*                 LISTEN      -
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                 LISTEN      2272/portmap
tcp        0      0 127.0.0.1:631               0.0.0.0:*                 LISTEN      2570/cupsd
tcp        0      0 :::80                       :::*                      LISTEN      5999/httpd
tcp        0      0 :::22                       :::*                      LISTEN      2588/sshd
tcp        0      0 :::443                      :::*                      LISTEN      5999/httpd
2014/01/22 00:00 2014/01/22 00:00
태그 : , ,
글 걸기 주소 : 이 글에는 트랙백을 보낼 수 없습니다