리눅스_명령어_Life

netstat

netstat - Print network connections, routing tables, interface statistics, masquerade connec- tions, and multicast memberships

네트워크 연결상황을 볼수 있는 명령어

root@localhost ~ []> netstat -anl

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address               Foreign Address             State      

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN   

 

 

ssh 포트가 Listen 되어 있는지 확인할때는 아래 처럼 사용합니다.

 

root@localhost ~ []> netstat -anl | grep 22

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN    

 

 


netstat -anp | grep EST
tcp        0     52 192.168.56.101:22           192.168.56.1:49919          ESTABLISHED 2297/sshd

 

 

 

 

옵션들:

 

        -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

 

 

댓글

댓글 본문
작성자
비밀번호
버전 관리
Frank
현재 버전
선택 버전
graphittie 자세히 보기