파일에서 트래픽 샘플링 출력 수집
트래픽 샘플링 결과를 /var/tmp 디렉토리의 파일로 구성합니다. 샘플링된 패킷을 파일에 수집하려면 계층 수준에서 문을 포함합니다file.[edit forwarding-options sampling output]
[edit forwarding-options sampling family family-name output] file <disable> filename filename <files number> <size bytes> <stamp | no-stamp > <world-readable | no-world-readable>;
활성 플로우를 내보내기 전의 기간을 구성하려면 계층 수준에서 문을 포함합니다flow-active-timeout.[edit forwarding-options sampling output family (inet | inet6 | mpls)]
[edit forwarding-options sampling family (inet | inet6 | mpls) output] flow-active-timeout seconds;
플로우가 비활성으로 간주되기 전의 기간을 구성하려면 계층 수준에서 문을 [edit forwarding-options sampling output] 포함합니다flow-inactive-timeout.
[edit forwarding-options sampling family (inet | inet6 | mpls) output] flow-inactive-timeout seconds;
모니터링되는 정보를 전송하는 인터페이스를 구성하려면 계층 수준에서 명령문을 포함합니다interface.[edit forwarding-options sampling output]
[edit forwarding-options sampling family (inet | inet6 | mpls) output] interface interface-name { engine-id number; engine-type number; source-address address; }
이 기능은 버전 9 템플릿 형식에서 지원되지 않습니다. 버전 9를 사용하여 수집된 트래픽 플로우를 서버로 보내야 합니다. 자세한 내용은 Cisco Systems NetFlow Services Export Version 9 Format의 트래픽 샘플링 출력 수집을 참조하십시오.
트래픽 샘플링 출력 형식
트래픽 샘플링 출력은 ASCII 텍스트 파일에 저장됩니다. 다음은 /var/tmp 디렉토리의 파일에 저장되는 트래픽 샘플링 출력의 예입니다. 출력 파일의 각 줄에는 샘플링된 패킷 하나에 대한 정보가 포함되어 있습니다. 선택적으로 각 줄에 대한 타임스탬프를 표시할 수 있습니다.
열 머리글은 1000개의 패킷으로 구성된 각 그룹 후에 반복됩니다.
# Apr 7 15:48:50
Time Dest Src Dest Src Proto TOS Pkt Intf IP TCP
addr addr port port len num frag flags
Apr 7 15:48:54 192.168.9.194 192.168.9.195 0 0 1 0x0 84 8 0x0 0x0
Apr 7 15:48:55 192.168.9.194 192.168.9.195 0 0 1 0x0 84 8 0x0 0x0
Apr 7 15:48:56 192.168.9.194 192.168.9.195 0 0 1 0x0 84 8 0x0 0x0
Apr 7 15:48:57 192.168.9.194 192.168.9.195 0 0 1 0x0 84 8 0x0 0x0
Apr 7 15:48:58 192.168.9.194 192.168.9.195 0 0 1 0x0 84 8 0x0 0x0
출력에는 다음 필드가 포함됩니다.
Time(시간) - 패킷이 수신된 시간(구성에 문을 포함하는
stamp경우에만 표시됨)Dest addr—패킷의 대상 IP 주소
Src addr—패킷의 소스 IP 주소
Dest port—대상 주소에 대한 TCP(Transmission Control Protocol) 또는 UDP(User Datagram Protocol) 포트
Src 포트 - 소스 주소의 TCP 또는 UDP 포트
Proto—패킷의 프로토콜 유형
TOS - IP 헤더의 서비스 유형(ToS) 필드 내용
Pkt len - 샘플링된 패킷의 길이(바이트)
Intf num - 샘플링된 논리 인터페이스를 식별하는 고유 번호
IP frag—IP 프래그먼트 번호(해당되는 경우)
TCP 플래그 - IP 헤더에서 발견된 모든 TCP 플래그
my-sample 파일에 대한 타임스탬프 옵션을 설정하려면 다음을 입력합니다.
[edit forwarding-options sampling family (inet | inet6 | mpls) output file] user@host# set filename my-sample files 5 size 2m world-readable stamp;
타임스탬프 옵션을 전환할 때마다 새 헤더가 파일에 포함됩니다. 스탬프 옵션을 설정하면 시간 필드가 표시됩니다.
# Apr 7 15:48:50 # Time Dest Src Dest Src Proto TOS Pkt Intf IP TCP # addr addr port port len num frag flags # Feb 1 20:31:21 # Dest Src Dest Src Proto TOS Pkt Intf IP TCP # addr addr port port len num frag flags