netstat 

네트워크 상태 확인 명령어 



네트워크 상태 확인 

> netstat -a 



UDP: IPv4
   Local Address        Remote Address      State
-------------------- -------------------- ----------
      *.sunrpc                            Idle
      *.*                                 Unbound
      *.32771                             Idle
      *.*                                 Unbound

... 

 

TCP: IPv4
   Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State
-------------------- -------------------- ----- ------ ----- ------ -----------

      *.ssh                *.*                0      0 49152      0 LISTEN
      *.32774              *.*                0      0 49152      0 LISTEN
      *.32775              *.*                0      0 49152      0 LISTEN
localhost.smtp             *.*                0      0 49152      0 LISTEN
localhost.submission       *.*                0      0 49152      0 LISTEN
Solaris10.ssh        192.168.111.1.62503  524800     51 49640      0 ESTABLISHED
localhost.5999             *.*                0      0 49152      0 LISTEN

... 

 

겁나 많이 나옴.. 

 



라우팅 테이블 확인 

> netstat -rn 


Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
-------------------- -------------------- ----- ----- ---------- ---------
default                 192.168.111.2        UG        1          0
127.0.0.1               127.0.0.1              UH        2         90 lo0
192.168.111.0         192.168.111.201    U         3        523 net0

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use    If
--------------------------- --------------------------- ----- --- ------- -----
::1                         ::1                         UH      2      28 lo0
fe80::/10                   fe80::20c:29ff:fe42:e21e    U       2       0 net0


Flags


U : UP 

G : gateway 



인/아웃/에러 패킷을 확인하는 명령어 옵션 

> netstat -i 2 5 

2 : 2초 간견 

5 : 5번 출력 

첫 줄 무시 


    input   net0      output       input  (Total)    output
packets errs  packets errs  colls  packets errs  packets errs  colls
1773    0     807     0     0      1822    0     856     0     0
1       0     1       0     0      1       0     1       0     0
2       0     2       0     0      2       0     2       0     0
1       0     1       0     0      1       0     1       0     0
1       0     1       0     0      1       0     1       0     0


colls : 충돌 , 높으면 네트워크가 바쁘다, 대역폭을 늘려줘야 함. 

블로그 이미지

나무뚱이

,