반응형
SMALL
FortiGate SIP Debug
Please refer to the debugging SIP and provide us the output.
Additionally, you can run a debug flow between the src and dst IP addresses:
diag debug console timestamp enable
diag debug flow show console en
diag debug flow show function-name en
diag debug flow filter saddr
diag debug flow filter daddr
diag debug en
diag debug flow trace start 200
Once the debugs are collected, you can disable all the above with:
diag debug appl sip 0
diag debug flow filter clear
diag debug flow trace stop
diag debug disable
diag debug reset
 
 
 
 
 
 
반응형
LIST

'업무이야기 > Security' 카테고리의 다른 글

Juniper SRX(방화벽) 패스워드 초기화  (5) 2024.10.24
DeepFinder (웹방화벽)  (6) 2024.10.23
SRX IPSec Tunnel Sample  (0) 2023.05.02
AhnLab Network Solutions  (0) 2022.11.21
FortiGate FSSO 설정  (0) 2022.08.10
반응형
SMALL
[FortiGate의 자주 쓰는 debug 명령]
 
1. diagnose debug flow
 
diag debug flow 명령은 FortiGate 의 inbound->outbound 트래픽의 flow를 확인할 수 있습니다.
 
filter, show, trace 3가지로 구성
 
FGT82C3109600076 # diagnose debug flow filter addr 122.49.65.221
 
FGT82C3109600076 # diagnose debug flow show console enable
show trace messages on console
 
FGT82C3109600076 # diagnose debug flow trace start 10
 
FGT82C3109600076 # id=36870 trace_id=21 msg="vd-root received a packet(proto=1, 122.49.65.222:1024->122.49.67.40:8) from port2."
id=36870 trace_id=21 msg="Find an existing session, id-0004a929, original direction"
id=36870 trace_id=22 msg="vd-root received a packet(proto=1, 122.49.67.40:1024->122.49.65.222:0) from local."
 
2. diagnose sniffer packet
 
FGT82C3109600076 # diagnose sniffer packet any "icmp" 4
 
문법
# diag sniffer packet <interface> <'filter'> <verbose> <count> <a>
 
<interface> can be an Interface name or "any" for all Interfaces.
<'filter'> is a very powerful filter functionality which will be described in more detail.
<verbose> means the level of verbosity as described already.
<count> the number of packets the sniffer reads before stopping. '0'이면 무한수행.
<a> absolute timestamps를 화면에 출력(하지만 반드시 <count> 가 있을때만 유효) defailt는 Relative timstamps이므로, 상대적인 시간만 나옴.
 
<verbose>
1: print header of packets
2: print header and data from ip of packets
3: print header and data from ethernet of packets (if available)
4: print header of packets with interface name
5: print header and data from ip of packets with interface name
6: print header and data from ethernet of packets (if available) with intf name
 
diagnose sniffer packet any "" 4 0 a
 
패킷 스니퍼
- ICMP확인
dia sniff packet port3 icmp 100
- TCP SYN 100개 확인
dia sniff packet port3 'tcp[13]==2' 100 0 a
- TCP SYN & SYN ACK 100개 확인
dia sniff packet port3 'tcp[13]&2==2' 100
 
3. NP2 ASIC accelerate enable/disable
 
FG3K6A3407600192 (global) # diagnose npu np2 fastpath
e2prom View E2PROM data
fastpath Configure fastpath
fastpath-sniffer Configure fastpath sniffer by port
list Display all NP2 devices
performance View NP2 performance
register View NP2 registers
status View NP2 device status
 
FG3K6A3407600192 (global) # diagnose npu np2 fastpath disable 0
 
4. NP4 ASIC accelerate enable/disable
 
# diagnose npu np4 fastpath disable 0
 
주의1) NP4 Fast Path disabled. Please clear session to clear existing path.
 
주의2) traffic log는 session is expired 되어야 기록됨.
 
설정법 .
 
==================================================================
 
diag debug flow filter <name> <value>
 
- 디버그 흐름추적 필터 추가 <필터옵션> <필터값/없으면any>
 
diag debug flow show console enable
 
- 디버그 내용 접속화면에 표시
 
diag debug flow show function-name enable
 
- 디버그 흐름추적시 사용된 함수이름 표시
 
diag debug flow trace start <repeat number>
 
- 디버그 흐름추적을 할 갯 수
 
diag debug enable
 
- 디버그 시작
 
==================================================================
예제 1. (외부와의 통신 디버깅)
 
인터페이스의 출발지, 세션의 종류, 적용된 정책, 적용된 vdom, 적용된 라우팅 등을 많은 정보를 볼 수 있음.
 
==================================================================
 
diag debug flow filter add 192.168.10.4
 
diag debug flow show console enable
 
diag debug flow show function-name enable
 
diag debug flow trace start 100
 
diag debug enable
 
==================================================================
 
...to stop the debug, type "diag debug flow trace stop"
 
 
 
20085 trace_id=29 func=get_new_addr line=1240 msg="find SNAT: IP-222.110.157.103, port-46024"
 
20085 trace_id=29 func=fw_forward_handler line=320 msg="Allowed by Policy-5: SNAT"
 
20085 trace_id=29 func=__ip_session_run_tuple line=1562 msg="SNAT 192.168.10.4->222.110.157.103:46024"
 
20085 trace_id=30 func=resolve_ip_tuple_fast line=2809 msg="vd-root received a packet(proto=6, 192.168.10.4:1159->222.234.226.3:110) from internal."
 
20085 trace_id=30 func=resolve_ip_tuple line=2908 msg="allocate a new session-02bb75c1"
 
20085 trace_id=30 func=rpdb_srv_match line=422 msg="Match policy routing: to 222.234.226.3 via ifindex-3"
 
20085 trace_id=30 func=vf_ip4_route_input line=1599 msg="find a route: gw-121.131.216.126 via wan1"
 
20085 trace_id=30 func=get_new_addr line=1240 msg="find SNAT: IP-121.131.216.116, port-46025"
 
20085 trace_id=30 func=fw_forward_handler line=320 msg="Allowed by Policy-7: SNAT"
 
20085 trace_id=30 func=__ip_session_run_tuple line=1562 msg="SNAT 192.168.10.4->121.131.216.116:46025"
 
20085 trace_id=31 func=resolve_ip_tuple_fast line=2809 msg="vd-root received a packet(proto=6, 192.168.10.4:1159->222.234.226.3:110) from internal."
 
20085 trace_id=31 func=resolve_ip_tuple_fast line=2836 msg="Find an existing session, id-02bb75c1, original direction"
 
20085 trace_id=31 func=__ip_session_run_tuple line=1562 msg="SNAT 192.168.10.4->121.131.216.116:46025"
 
예제2. (TP모드의 내부끼리의 통신 디버깅)
 
==================================================================
 
diag debug flow filter add 192.168.10.4
 
diag debug flow show console enable
 
diag debug flow show function-name enable
 
diag debug flow trace start 100
 
diag debug enable
 
==================================================================
 
...to stop the debug, type "diag debug flow trace stop"
 
Example of debug flow output when traffic flows :
 
id=20085 trace_id=113 msg="vd-tp_mode received a packet(proto=6, 192.168.10.4:4370->192.168.10.2:23) from internal."
id=20085 trace_id=113 msg="Find an existing session, id-00000a40, original direction"
id=20085 trace_id=113 msg="enter fast path"
id=20085 trace_id=113 msg="send out via dev-dmz1, dst-mac-00:01:02:03:04:05"

 

 

반응형
LIST

'업무이야기 > Security' 카테고리의 다른 글

Scheduled Daily Reboot of FortiGate  (0) 2018.05.08
FortiGate DNS Translation  (0) 2018.05.08
Fortigate IPv6 over IPv4 VPN Tunnel  (0) 2018.05.08
FortiGate Service Objects Category별 우선 순위  (0) 2018.05.08
FortiSandbox Cluster  (0) 2018.05.08
반응형
SMALL

diagnose debug enable
diagnose debug flow show console enable
diagnose debug flow filter add 10.10.20.30
diagnose debug flow trace start 100


fg60cxadsl # diagnose sys session filter src 192.168.1.110
fg60cxadsl # diagnose sys session filter dport 80


Next it's time to clear the session by issuing thesession clear command as follows:

fg60cxadsl # diagnose sys session clear
Step 3: Sniffer trace

Take a sniffer trace as per the following examples when running a constant ping (or TCP connection) from PC1 to PC2.
This will answer the following questions:
- Is traffic arriving to the FortiGate and does it arrive on the expected port?- Is the ARP resolution correct for the targeted next-hop?- Is the traffic exiting the FortiGate to the destination?- Is the traffic sent back to the source?

FGT# diagnose sniffer packet any "host <PC1> or host <PC2>" 4

or

FGT# diagnose sniffer packet any "(host <PC1> or host <PC2>) and icmp" 4


Including the ARP protocol in the filter may be useful to troubleshoot a failure in the ARP resolution (for instance PC2 may be down and not responding to the FortiGate ARP requests)

FGT# diagnose sniffer packet any "host <PC1> or host <PC2> or arp" 4


To stop the sniffer, type CTRL+C.

Step 4: Debug flow

Traffic should come in and leave the FortiGate. If not, proceed with a debug flow as follows:

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


To stop all other debug, type "diag debug flow trace stop".

Step 5: Session list

diag sys session filter src PC1
diag sys session list 

or 

diag sys session filter dst PC1
diag sys session list 

To clear all sessions corresponding to a filter:

diag sys session filter dst PC1
diag sys session clear

 

 

반응형
LIST

'업무이야기 > Security' 카테고리의 다른 글

Fortigate SIP ALG / Fortinet SIP ALG  (0) 2015.12.28
FortiAP Configuration  (0) 2015.12.28
FortiGate FGSP  (0) 2015.12.28
FortiAnalyzer 점검 CLI  (0) 2015.12.28
fortigate File reached uncompressed size limit  (0) 2015.12.28

+ Recent posts