1.工具说明

  在防火墙部署中,经常会遇到防火墙接收到了数据包,但并未进行转发。可以通过diagnose debug flow 命令来对数据包的处理过程进行跟踪,可以清晰查看数据包再各个功能模块内的处理过程,判断出数据包如何被转发或者丢弃。

2.命令介绍

  diagnose debug enable              开启debug功能

  diagnose debug flow show console enable  开始flow的输出

  diagnose debug flow filter add 119.253.62.131     定制过滤器,支持多种过滤;可以添加多个组合的过滤器

  diagnose debug flow trace start 6    定义所要跟踪数据包的数量

  diagnose debug flow filter         查看过滤器的配置

3.过滤参数

  FGT# diagnose debug flow filter

  addr      IP address.                        // ip地址

  clear     Clear filter.                         // 清除过滤器

  daddr     Destination IP address.     // 目的地址

  dport     Destination port.           //目的端口

  negate    Inverse filter.             //反向过滤

  port      port                        // 接口, 如port1

  proto     Protocol number.  // 协议,  如6,tcp协议, 17 udp, 1 icmp

  saddr     Source IP address.          //源地址

  sport     Source port.                // 源端口

  vd        Index of virtual domain.     //vdom

4.分析示例

1)

  FGT# id=36871 trace_id=1 msg="vd-root received a packet(proto=6, 192.168.1.110:51661->119.253.62.131:80) from internal."id=36871 trace_id=1 msg="allocate a new session-00016920"

  //internal口收到数据,建立新会话

  id=36871 trace_id=1 msg="find a route: gw-192.168.118.1 via wan1"             //查找到路由表

  id=36871 trace_id=1 msg="find SNAT: IP-192.168.118.28, port-43333"                     //检测存在NAT配置

  id=36871 trace_id=1 msg="Allowed by Policy-1: SNAT"                       // 匹配策略,ID1

  id=36871 trace_id=1 msg="SNAT 192.168.1.110->192.168.118.28:43333"          //做NAT

  id=36871 trace_id=3 msg="vd-root received a packet(proto=6, 119.253.62.131:80->192.168.118.28:43333) from wan1."                                                           // Wan1口收到返回数据包

  id=36871 trace_id=3 msg="Find an existing session, id-00016920, reply direction"                //数据包匹配会话id-0001692

  id=36871 trace_id=3 msg="DNAT 192.168.118.28:43333->192.168.1.110:51661"

  /做反向的DNAT

  id=36871 trace_id=3 msg="find a route: gw-192.168.1.110 via internal"                                //查找路由,发送到internal口

  id=36871 trace_id=5 msg="vd-root received a packet(proto=6, 192.168.1.110:51661->119.253.62.131:80) from internal."                                      //internal口收到后续数据包

  id=36871 trace_id=5 msg="Find an existing session, id-00016920, original direction"               //匹配会话id-0001692

  id=36871 trace_id=5 msg="enter fast path"        //直接转发

  id=36871 trace_id=5 msg="SNAT 192.168.1.110->192.168.118.28:43333"                 //NAT

  2)策略拒绝访问

  FGT# id=36871 trace_id=23 msg="vd-root received a packet(proto=6, 192.168.1.110:51768->119.253.62.131:80) from internal."

  id=36871 trace_id=23 msg="allocate a new session-00017537"

  id=36871 trace_id=23 msg="find a route: gw-192.168.118.1 via wan1"

  id=36871 trace_id=23 msg="Denied by forward policy check"       //直接被策略拒绝,检查策略配置问题

  3)常见debug flow结果

  msg="iprope_in_check() check failed, drop"

  没有该项策略,或策略不匹配,数据包被丢弃

  msg="Denied by forward policy check"

  策略动作拒绝,或命中隐含策略, 数据包被拒绝

  msg="reverse path check fail, drop"

  反向路径,即源路由检查失败,丢弃数据包

  会话经由 session-helper 处理

  msg="run helper-ftp(dir=original)"

FortiGate数据流分析 debug flow的更多相关文章

  1. sniffer 和 debug flow

    sniffer 和 debug flow sniffer 和 debug flow 复制模板,直接修改IP即可使用: diagnose sys session filter clear diagnos ...

  2. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  3. FortiGate外网IPSec链路及运维专线链路到个别网段不通

    1.现状: 如图,用户网段有192.168.50.0/24.192.168.51.0/24和192.168.52.0/24.192.168.53.0/24.在防火墙上有静态路由到运维专线的10.160 ...

  4. Fortigate防火墙常用命令

    命令结构 #config 对策略,对象等进行配置 #get  查看相关对象的参数 #show 查看配置文件 #diagnose 诊断命令 #execute  常用的工具命令,如ping treacer ...

  5. in packet sniffer

    in packet sniffer 来源 https://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&am ...

  6. node中的Stream-Readable和Writeable解读

    在node中,只要涉及到文件IO的场景一般都会涉及到一个类-Stream.Stream是对IO设备的抽象表示,其在JAVA中也有涉及,主要体现在四个类-InputStream.Reader.Outpu ...

  7. MFC Picture控件加载图片

    CStatic *pPic = (CStatic*)GetDlgItem(IDC_PICTURE); CBitmap bitmap; bitmap.LoadBitmapW(IDB_BITMAP2); ...

  8. IntelliJ IDEA 的 20 个代码自动完成的特性

    http://www.oschina.net/question/12_70799 在这篇文章中,我想向您展示 IntelliJ IDEA 中最棒的 20 个代码自动完成的特性,可让 Java 编码变得 ...

  9. Stream探究

    http://segmentfault.com/a/1190000003479884 1. 认识Stream Stream的概念最早来源于Unix系统,其可以将一个大型系统拆分成一些小的组件,然后将这 ...

随机推荐

  1. 第十一章 IO流

    11.IO流 11.1 java.io.File类的使用 1课时 11.2 IO原理及流的分类 1课时 11.3 节点流(或文件流) 1课时 11.4 缓冲流 1课时 11.5 转换流 1课时 11. ...

  2. 虚拟机安装及Oracle安装

    1.安装虚拟机(没难度,傻瓜装机) 新建虚拟机 自定义------下一步------- 稍后安装操作系统------下一步 下一步 下一步至完成 然后启动,就可以启动一个系统咯!!! 可以查一下虚拟机 ...

  3. 公式推导:【BACF】

    [BACF]: Kiani Galoogahi H, Fagg A, Lucey S. Learning Background-Aware Correlation Filters for Visual ...

  4. py-day2-5 python 百分号字符串拼接

    #### 字符串格式化. # %s 代替任何的元素 (数字,字符串,列表··) print('I live %s crty' %'my') print('I live %s crty' %'[6,8, ...

  5. JavaScript获取mp4文件MIME编码格式,用于判读是否是h.264,解决在线播放只有声音问题

    测试网址:https://gpac.github.io/mp4box.js/test/filereader.html js库:mp4box.js 不能在线播放的:audio/mp4; codecs=& ...

  6. Excel技巧--单列变多行

    当上图的单列转变成多行时,可以这么做: 1.在第一行输入A2.A3,向右拖拉第一行: 2.第二行按第一行最右顺序,写下A12,再向右拖拉出第二行: 3.选择这两行,再拖拉出一串连续顺序的多行来: 4. ...

  7. C 栈实现队列节点的管理

    栈预先存储节点,队列的malloc/free均有栈模拟,从而保证不频繁的开辟/是否节点内存. #include "com_is_buf.h" #include "com_ ...

  8. Python中的闭包 - Closure

    Python中的闭包不是一个一说就能明白的概念,但是随着你往学习的深入,无论如何你都需要去了解这么一个东西. 闭包的概念 我们尝试从概念上去理解一下闭包. 在一些语言中,在函数中可以(嵌套)定义另一个 ...

  9. js window.location用法

    <script> //设置或获取 href 属性中跟在问号后面的部分. console.log(window.location.search)//设置或获取对象指定的文件名或路径conso ...

  10. 初始nginx(启动运行) 使用nginx做一个简单的静态资源服务器

    第一次接触nginx的时候,那时候公司还是用的一些不知名的小技术,后来公司发展问题,重新招了人,然后接触到nginx,公司 使用nginx用来做代理服务器,所有请求 都先经过nginx服务器,然后交由 ...