
FortiGate 40流量整形功能配置及故障分析.docx
5页说明: 本文档针对FortiGate 4.1.0 MR1产品的流量整形功能配置和基本故障分析命令使用进行说明,相关详细命令参照相关手册1. 基本命令命令:config firewall shaper traffic-shaperdiagnose firewall shaper traffic-shaper statediagnose firewall shaper traffic-shaper statsdiagnose firewall shaper traffic-shaper list2. 概述2. 1流量整形功能在FOS4.0版本里面已经从防火墙策略里面单独剥离出来,这样就可以让多条策略共用一条流量整形策略;2. 2请尽可能的为一台防火墙策略同时配置正向及反向流量整形策略已更精确控制带宽使用;2. 3相关P2P流控功能已经转移到应用控制模块实现;2. 4如何通过“diagnose firewall shaper traffic-shaper"命令来查看防火墙丢包情况;2. 5如何通过“diagnose debug flow”来分析流量整形问题;2. 6如何通过“diagnose sys session”来分析流量整形问题。
3 •详细说明3. 1流量整形功能在FOS4.0版本里面已经从防火墙策略里面单独剥离出来,在防火墙里面新增加一个独立的“流量整形器”用 来配置独立的流量整形配置,也可以通过命令行来配置,格式如下:config firewall shaper traffic-shaperedit "limit_GB_25_MB_50_LQ"set action none (*) 配额满时的动作set guaran teed-bandwid th 25 承诺带宽set maximum-bandwid th 50 限制带宽set priority high (*) 带宽优先级set per-policy disable (*) 带宽类型set quota 0 (*) 配额set type hour (*) 带宽报告产生周期nex tend注意,带“*”表示默认配置,如果“每条策略”没有启用,表示所有的共有这台整形器的防火墙策略共享同一个带宽,启用的 话不同的防火墙策略都可以独立享受一个带宽3. 2可以同时配置正反向整形策略,如下:config firewall policyedit 4set srcintf "port2"set dstintf "port6"set srcaddr "VM3"set dstaddr "VM6"set action acceptset schedule "always"set service "ANY"set traffic-shaper "limit_GB_25_MB_50_LQ"set traffic-shaper-reverse Timit_GB_12_MB_25_LQ"nex tend3. 3 P2P协议的带宽控制功能已经转移到应用控制模块,如下图显示:(点击放大)命令行的配置如下:config application list edit "test"config entriesedit 1set action passset application 6set category 2set shaper "0_150_Low"set shaper-reverse "0_400_Medium"nex tendnex tend3. 5如何通过“diagnose firewall shaper traffic-shaper"命令来查看防火墙丢包情况。
FOS里面给每个流量整形器都分配了计数器以记录防火墙丢包情况,可以登陆命令行进行丢包状态查看,如下显示:FGT # diagnose firewall shaper traffic-shaper statsshapers 27 ipv4 42 ipv6 0 drops 242287007FGT # diagnose firewall shaper traffic-shaper listname 0_150_Lowmaximum-bandwidth 150 KB/secguaranteed-bandwidth 0 KB/seccurrent-bandwidth 114 B/secpriority 3policy 91dropped 0config: port=1015 giga=0 mega=0 beh=none type=hour status: giga=0 mega=0 bytes=0 log=0 action二pass name 150_250_Mediummaximum-bandwidth 250 KB/secguaranteed-bandwidth 150 KB/seccurrent-bandwidth 250 KB/secpriority 2policy 96dropped 23979config: port=l015 giga=0 mega=0 beh二none type二hourstatus: giga=0 mega=0 bytes=0 log=0 action二passname 50_200_Mediummaximum-bandwidth 200 KB/secguaranteed-bandwidth 50 KB/seccurrent-bandwidth 120 B/secpriority 2policy 98dropped 117config: port=1015 giga=0 mega=0 beh=none type=hourstatus: giga=0 mega=0 bytes=0 log=0 action二pass如上表示防火墙总共由于流量整形丢包242287007个,其中策略91没有丢包,策略96丢包23979个,策略98丢包117个。
3. 4通过debug flow来分析丢包问题,如下:FGT# diagnose debug flow show console enableFGT# diagnose debug flow fil ter addr 10.143.0.5FGT# diagnose debug flow trace start 1000id=20085 trace_id=11 msg二"vd-root received a packet(proto =17, 10.141.0.11:3735->10.143.0.5:5001) from port5.'id=20085 trace_id=11 msg二"Find an existing session, id-0000eabc, original direction"id=20085 trace_id=11 msg二"exceeded shaper limit, drop"3. 5通过查看系统连接表判断丢包问题,如下: 如果防火墙策略配置了双向流量整形器,通过命令可以看出来;diagnose sys session listsession info: proto=6 proto_state=02 expire=115 timeout=3600 flags=00000000 sock flag=00000000 sockport=0 av_idx=0 use=4origin-shaper二Limit_25Mbps prio=1 guarantee 25600/sec max 204800/sec traffic 48/sec reply-shaper二Limit_100Mbps prio=1 guarantee 102400/sec max 204800/sec traffic 0/sec ha_id=0 hakey=44020 policy_dir=0 tunnel二/state=may_dirty rem os rsstatistic(bytes/packets/allow_err): org=96/2/1 reply=0/0/0 tuples=2orgin-〉sink: org pre->pos t, reply pre->pos t dev=2->3/3->2 gwy=10.160.0.1/0.0.0.0 hook=pre dir=org act=dnat 192.168.171.243:2538->192.168.182.110:80(10.160.0.1:80) hook=post dir二reply act二snat 10.160.0.1:80->192.168.171.243:2538(192.168.182.110:80) pos/(before,after) 0/(0,0), 0/(0,0) misc=0 policy_id=2 auth_info=0 chk_client_info=0 vd=0 serial=00011e81 tos二ff/ff app=0 dd_type=0 dd_rule_id=0。
