netstat 명령어에 대해 질문드립니다..

esllo의 이미지

리눅스 환경입니다..^^

ICMP 메세지 통계치를 확인하려고 netstat를 이용중입니다.

그런데.. netstat -s 를 치면, icmp뿐만 아니라, TCP, UDP 머 이런것들도.. 다 나오더군요

그런데.. Icmp항목만 볼수 있는 방법 없을까요??

grep 으로 확인하려 해도; 마땅한 검색열 문자가 없구요;

head tail로는 만약 상 하위 항목이 늘어났을경우 맞지가 않구요;

icmp통계치만 볼수 있는 옵션이나,, 아님 방법 알고 계시면 조언 부탁드립니다..

h2cl의 이미지

netstat -s 할때 ICMP가 들어간 문자열만 원하신다면
netstat -s | grep ICMP 하시면 될텐데요?

esllo의 이미지

Ip:
    727277 total packets received
    43 with invalid addresses
    0 forwarded
    0 incoming packets discarded
    727234 incoming packets delivered
    676408 requests sent out
Icmp:
    6 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 6
    6 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 6
IcmpMsg:
        InType3: 6
        OutType3: 6
Tcp:
    18 active connections openings
    10 passive connection openings
    0 failed connection attempts
    0 connection resets received
    5 connections established
    294171 segments received
    250049 segments send out
    9 segments retransmited
    0 bad segments received.
    0 resets sent

보시는 바와 같이 ICMP항목에 ICMP가 전부 포함이 되어있지가 않습니다 ㅜㅠ;;;
h2cl의 이미지

netstat -s | grep -A 9 Icmp
이렇게 하시면 될듯합니다.
저도 지금 맨파일 찾아보니 이렇게 설명이 되어 있네요..

esllo의 이미지

이런방법이 있었군요..ㅋ
감사합니다.. 많은 도움이 되었습니다..^^