본문 바로가기
IT/방화벽

Fortigate packet sniffer

by JGSHIN 2025. 2. 16.
SMALL

 

## Fortigate에서 장애처리 자수 사용하는 명령어

 

## 기본 명령어 형식

 

 diagnose sniffer packet <interface> <Filter> <level> <count> <tsformat>

 

 interface : any 또는 특정 Interface 지정 (ex. Port1, wan1등등)

 

Filter : ICMP, TCP, UDP, Port, Subnet, host 여러조건들을 and 또는 or 조건으로 filter 걸어서 In/Out packet 확인

 

Level : 이미지 참조

 

 

## 1-6까지 사용 가능하나, 1 입력할 경우 ip headers sniffer내용에 표시

일반적으로 많이 사용하는건 4번을 많이 사용하여 IP Headers Port names 확인

 

Count : 해당 packet 몇번 남길건지 생략도 있다 / 생략 취소하기 전까지 계속 남김

 

Tsformat : a I 옵션이 있는데 a UTC time, I Fortigate 설정된 Time 시간이 표시되어 sniffer 표시

 

 

## 예시 : diagnose sniffer packet any 'icmp and host 8.8.8.8' 4

 

이렇게 filter 걸어서 sniffer 경우 해당 fortigate 모든 Interface 통과하는 icmp packet 탐지 물론 8.8.8.8 IP 대해서만

 

## FILTER 걸어 Fortifate In/Out 되는 packet 확인 가능.

 

## 예시2 : 1.1.1.0/24 네트워크와 2.2.2.0/24 네트워크에 관련된 패킷

# diagnose sniffer packet any ‘net 1.1.1.0/24 and net 2.2.2.0/24’ 4 0 l

 

## 예시 3 : 출발지가 1.1.1.0/24 네트워크이고, 목적지가 2.2.2.0/24 네트워크에 관련된 패킷

# diagnose sniffer packet any ‘src net 1.1.1.0/24 and dst net 2.2.2.0/24’ 4 0 l

 

## 예시 4 : 출발지가 1.1.1.0/24 네트워크이고, 목적지가 2.2.2.0/24 네트워크에 관련되고 ICMP인 패킷

# diagnose sniffer packet any ‘src net 1.1.1.0/24 and dst net 2.2.2.0/24 and icmp’ 4 0 l

 

 

 

 

## PC to PC Packet Sniffer

Packet sniffer 통해 PC1에서의 Packet FortiGate Port1까지 도착하는지 확인 도착했다면 Port2 통해 PC2 보내졌는지 확인

내보낸 Packet 대한 응답이 Port2 통해 들어 오는지 들어온 응답이 Port1 통해 나갔는지 확인

 

## 기본 형식

 diagnose sniffer packet any "host <PC1> and host <PC2>"

 

## 예시2 : diagnose sniffer packet any "host 192.168.150.10 and host 192.168.150.53"

 

 

## Routing Table 확인

FortiGate 라우팅 설정과 Port1, Port2 인터페이스 IP NetMask 설정이 올바르게 되었는지 확인

 

# get router info routing-table all

 

## ARPT 테이블 확인

 

# get sys arp

 

 

## Debug flow

FortiGate 내부에서 Drop 되는지 Debug 통해 확인

 

 

diag debug enable diag debug flow filter add <PC1>   or    diag debug flow filter add <PC2> diag debug flow show console enable diag debug flow trace start 100          <== this will display 100 packets for this flow diag debug enable

 

 

## 차단 경우 아래 처럼 디버그 결과가 표시된다.

 

id=20085 trace_id=319 func=resolve_ip_tuple_fast line=2825 msg="vd-root received a packet(proto=6, 192.168.129.136:2854->192.168.96.153:1863) from port3."

id=20085 trace_id=319 func=resolve_ip_tuple line=2924 msg="allocate a new session-013004ac"

id=20085 trace_id=319 func=vf_ip4_route_input line=1597 msg="find a route: gw-192.168.150.129 via port1"

id=20085 trace_id=319 func=fw_forward_handler line=248 msg=" Denied by forward policy check"

 

## 차단된 경우 표시되는 error Message  설명

 

 

“Denied by forward policy check” : 방화벽 정책이 없거나 deny 정책이 적용됨

“Denied by end point ip filter check” : ip address 격리 조치된 경우 차단됨

exceeded shaper limit, drop” : Traffic shapping 설정으로 제한이 걸려 drop 된 경우

Reverse path check fail, drop” : 라우팅 관련하여 source IP가 잘못된 인터페이스로 들어온 경우(RPF check)

“Iprope_in_check() check failed, drop : source 혹은 destination IP가 FortiGate가 가진 IP에 대한 drop 인 경우. 위 다이어그램처럼 PC1, PC2의 IP가 FortiGate가 가질수 없는 IP라면, 해당 IP를 VIP 또는 IP Pool에서 사용하는지 확인 할 것.

 

 

 

 

LIST
📧 이메일 문의
by @ 2025 JGSHIN