1、华为USG防火墙运维命令大全 This model paper was revised by LINDA on December 15, 2012.华为USG防火墙运维命令大全华为USG防火墙运维命令大全1查会话使用场合针对可以建会话的报文,可以通过查看会话是否创建以及会话详细信息来确定报文是否正常通过防火墙。命令介绍(命令类)display firewall session table verbose source inside | global | destination inside | global source-vpn-instance STRING | public | dest-
2、vpn-instance STRING | public application gtp | ftp | h323 | http | hwcc | ras | mgcp | dns | pptp | qq | rtsp | ils | smtp | sip | nbt | stun | rpc | sqlnet | mms nat destination-port INTEGER long-link 使用方法(工具类)首先确定该五元组是否建会话,对于TCP/UDP/ICMP(ICMP只有echo request和echo reply建会话)/GRE/ESP/AH的报文防火墙会建会话,其它比如S
3、CTP/OSPF/VRRP等报文防火墙不建会话。如果会话已经建立,并且一直有后续报文命中刷新,基本可以排除防火墙的问题,除非碰到来回路径不一致情况,需要关闭状态检测。如果没有对应的五元组会话或者对于不建会话的报文,继续后续排查方法。Global:表示在做NAT时转换后的IP。Inside:表示在做NAT时转换前的IP。使用示例display firewall session table verbose source inside 14:29:51 2010/07/01 Current total sessions : 1? icmp VPN: public -public Zone: trus
4、t - local TTL: 00:00:20 Left: 00:00:20 Interface: I0 Nexthop: MAC: 00-00-00-00-00-00 packets:4461 bytes:374724? :43986 local首包会话方向源域为trust,目地域为local(源域 - 目的域)TTL: 00:00:20 Left: 00:00:20ttl表示会话表老化时间,left表示会话表剩余多少时间老化Interface: I0 Nexthop: MAC: 00-00-00-00-00-00会话首包方向出接口、下一跳IP地址和MAC地址 packets:4461 by
5、tes:374724代表会话outbound方向/同域的字节数和报文数:43986-:43986 表示会话首包是outbound或者同域使用限制对于TCP/UDP/ICMP/GRE/ESP/AH的报文防火墙会建会话,其它比如SCTP/OSPF/VRRP无法使用该方法排查。2检查接口状态使用场合在报文不通时,可以先检查接口状态,排除由于接口down而导致报文不通的情况。命令介绍display ip interface brief使用方法查看接口物理层和协议层状态,正常情况下三层接口物理层(Physical)和协议层(Protocol)都是up,如果有down现象,检查网线连接和网线(光纤,光模块
6、)本身是否有问题,更换网线(光纤,光模块)尝试。使用示例USG5360display ip interface brief*down: administratively down(l): loopback(s): spoofingInterface IP Address Physical Protocol DescriptionGigabitEthernet0/0/0 up up Huawei, USG5000GigabitEthernet0/0/1 up up Huawei, USG5000GigabitEthernet0/0/2 up up Huawei, USG5000GigabitEt
7、hernet0/0/3 down down Huawei, USG5000GigabitEthernet1/0/0 unassigned down down Huawei, USG5000GigabitEthernet1/0/1 unassigned up down Huawei, USG5000如上显示,GigabitEthernet0/0/3和GigabitEthernet1/0/0的物理层是down,其中GigabitEthernet0/0/3已经配置了IP地址,而GigabitEthernet1/0/0未配置,物理层down可能是因为网线被拔出或网线出问题,或者是与其对接的接口down
8、,需要检查线路。GigabitEthernet1/0/1的协议层down是因为没有配置ip地址。3检查接口统计信息使用场合在发现报文传输有性能下降或者ping有丢包时,可以检查接口统计信息,确认接口是否有丢包。命令介绍display interface interface-type interface-number 使用方法查看接口下是否有error,确认CRC/ collisions有无增长,如果有增长确认接口双工模式和速率是否与对端设备一致。Align?Errors:对齐错误,即传送的包中存在不完整的字节,包括前导码和帧间隙。Collision Errors:碰撞错误。runts:超短包,
9、长度小于64字节但CRC值正确的数据包。giants:超长包,长度大于1618(如果带vlan是1622)字节的CRC值正确的数据包。CRC(Input):长度为64至1618字节之间但CRC值不正确的数据包。(路由器中长度为64至1618字节之间的Alignment、Dribble错包也在此类中统计)。Error(Input):PHY层发现的错包。Overrun(Input):接收队列满失败包。Late Collision?(Output):发送64字节后发生碰撞的错误包。查看出入接口统计是否计数正在增加,如果有增加则说明该接口链路正常,如果只有一条流则可以确定报文是否进入防火墙。查看接口协
10、商的情况,包括协商速率,全双工/半双工等。关注接口五分钟流量统计与正常时的差别,关注业务经过设备的两个方向出入接口流量是否差不多。使用示例GigabitEthernet1/0/0 current state : UP Line protocol current state : UP?GigabitEthernet1/0/0 current firewall zone : trust Description : Huawei, USG5000 Series, GigabitEthernet1/0/0 Interface?The Maximum Transmit Unit is 1500 byte
11、s, Hold timer is 10(sec)Internet Address is /24?IP Sending Frames Format is PKTFMT_ETHNT_2, Hardware address is 0018-82fd-9d3b?Media type is twisted pair, loopback not set, promiscuous mode not set?1000Mb/s-speed mode, Full-duplex mode, link type is auto negotiation?flow control is disable?Output qu
12、eue : (Urgent queue : Size/Length/Discards) 0/50/0Output queue : (Protocol queue : Size/Length/Discards) 0/1000/0?Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0 Last 5 minutes input rate 1083 bytes/sec, 11 packets/sec Last 5 minutes output rate 1019 bytes/sec, 10 packets/sec Input: pack
13、ets, 20 bytes 180 broadcasts, 19745 multicasts 5920 errors, 0 runts, 0 giants, 0 throttles, 0 CRC, 0 frames, 5920 overruns, 0 align errors? Output: packets, 50 bytes 200 broadcasts, 0 multicasts 0 errors, 0 underruns, 0 collisions, 0 late collisions, 0 deferred, 0 lost carrier, 0 no carrier如上显示,Inpu
14、t方向出现了5920个overruns,很有可能之前出现了瞬间很大的流量,导致overruns丢包。4查看防火墙系统统计使用场合通过查看防火墙系统统计,可以得到各种报文的统计值,以及各种丢包情况等信息。命令介绍display firewall statistic system使用方法查看当前系统总会话数,TcpSession、UDPSession、ICMP session这三项统计值的和查看TCP半连接数,CurHalfCon统计值就是半连接数,通过该值可以确认半连接数是否过多,是否受到syn-flood攻击查看防火墙转发TCP业务是否丢包,使用RcvTCPpkts、RcvTCPbytes、P
15、assTCPpkts、PassTCPOcts统计值,正常情况下Pass和Rcv不会相差很多会话创建是否失败根据发送报文的类别查看是否存在丢包,从这个统计可以查看出是否存在因攻击防范,包过滤等引起的丢包,以及根据收到ICMP/UDP/TCP报文个数和转发的个数计算被防火墙丢弃的个数。5查看设备的运行状况使用场合在发现设备的告警灯亮时或者其他如接口无法UP等异常情况时,可以查看设备的运行状况,看主控板、接口卡等是否运行正常。如果有器件显示故障,需尽快分析。命令介绍display device使用方法直接执行display device。使用示例display device?Secoway USG5
16、360s Device status: Slot # Type Online Status - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 RPU Present Normal 2 2GE Present Normal3 PWR(AC) Present Abnormal4 PWR(AC) Present Normal5 FAN Present Normal收藏分享顶踩点评回复报告电梯直达小小李L3发表于 2015-3-27 13:57:30只看该作者6?查看告警信息使用场合在发现设备的告警
17、灯亮时或者在日志中发现如风扇灯硬件相关信息时,可以查看告警信息来确定问题,具体告警的信息参见USG5300和E200告警.xls。命令介绍display alarm urgent使用方法直接执行display diagnostic-information。使用示例display alarm urgent Alarm ID Slot Date Time Para1 Para2 4 3 10/7 /7 11:28:4 1 2554 3 10/7 /7 10:19:8 1 255 7?查看内存使用率使用场合当防火墙自身某些业务运行不稳定时,可以查看一下内存使用率,看是否是内存消耗过多导致。内存占有率
18、不应过高。超过80时需要分析当时的路由表容量和其他防火墙自身相关业务。命令介绍display memory-usage使用方法在系统视图下执行display memory-usage。使用示例Eudemondisplay memory-usage Memory utilization statistics at 2010-07-07 19:27:38 50 msSystem Total Memory Is: 48 bytes Total Memory Used Is: 96 bytes?Memory Using Percentage Is: 47% 8?查看CPU使用率使用场合CPU占有率应正
19、常,与当前开展的业务类型和转发流量相符。超过60应分析当时的业务流量。USG5300是由转发平面转发的,通常CPU使用率与流量关系不大,只与业务类型有关,一般的来说,软件IPSEC/L2TP/ASPF/NAT ALG对CPU资源消耗较大。命令介绍display cpu-usage-for-user使用方法直接执行display cpu-usage-for-user。使用示例display cpu-usage-for-user?= Current CPU usage info =?CPU Average Usage (5 seconds) : 6%CPU Average Usage (30 se
20、conds) : 6%CPU Average Usage (5 minutes) : 6%9?检查各器件温度信息和电压信息使用场合在发生硬件故障时,可以查看各器件温度信息和电压信息等,判断是否是温度或电压的异常引起的问题。命令介绍display environment使用方法直接执行display environment。使用示例display environment Environment information: Temperature information:local CurrentTemperature LowLimit HighLimit Status (Celsius) (Cel
21、sius) (Celsius) (OK/FAIL)CPU 44 0 85 OKVENT 29 0 65 OK Voltage information:-CheckPoint ReferenceVol Range CurrentVol StatusDDR 1710 1890 mV 1790mV OKIO-1 2362 2613 mV 2494mV OKIO-2 3126 3455 mV 3299mV OKIO-3 1710 1890 mV 1820mV OKCPU 950 1050 mV 1000mV OKFAN 8520 9420 mV 8940mV OKUSB 4732 5226 mV 50
22、44mV OK-10查看日志使用场合在发生故障以后,可以查看日志,查找之前发生过的和当前故障相关的信息,从而定位故障原因。从日志中能看到,接口UP/DOWN、主备切换、攻击事件、命令行执行记录等信息。命令介绍display logbuffer使用方法直接执行display logbuffer。使用示例display logbuffer Logging buffer configuration and contents:enabled?Allowed max buffer size : 1024?Actual buffer size : 512?Channel number : 4 , Chan
23、nel name : logbuffer?Dropped messages : 0?Overwritten messages : 0 Current messages : 58?2010-07-19 10:31:58 USG5360 %01SHELL/5/CMD(l): task:co0 ip:* user:* vrf:public command:display logbuffer2010-07-19 10:30:48 USG5360 %01SHELL/5/LOGIN(l): vrf:public user:Console login from con0 2010-07-19 10:28:2
24、4 USG5360 %01PHY/2/PHY(l): GigabitEthernet0/0/2: change status to up?2010-07-19 10:28:19 USG5360 %01PHY/2/PHY(l): GigabitEthernet0/0/2: change status to down 2010-07-19 10:27:22 USG5360 %01PHY/2/PHY(l): GigabitEthernet0/0/2: change status to up?2010-07-19 10:25:42 USG5360 %01SHELL/5/CMD(l): task:co0
25、 ip:* user:* vrf:public command:undo debugging all?2010-07-19 10:25:42 USG5360 %01SHELL/5/LOGOUT(l): vrf:public user:Console logout from con02010-07-19 10:25:41 USG5360 %01HWCM/5/EXIT(l): exit from configure mode点评回复支持 ()反对 ()报告小小李L3发表于 2015-3-27 13:58:01只看该作者回复 2 楼11查看丢包统计,确定是否丢包使用场合在无法确认报文是否经过防火墙,
26、防火墙是否丢包时,可以查看丢包统计,并对每种丢包统计查询丢包手册,得到发生问题的可能性。命令介绍display?dataplane discardundo firewall debug_statistic acl enabledisplay firewall debug_statistic使用方法报文进入防火墙创建会话之前大部分丢包位置都进行了记录,可以通过下面方式查看。进入隐藏模式,按照下面的顺序查看:1)Eudemon_VC-A-hidecmdreset dataplane discard USG5000firewall packet-capture startup difficult 3
27、00 USG5000firewall packet-capture send queue 0 ip target_eth_addr : 0000-0000-0000, target_ip_addr : USG5360 %01ARP/7/arp_send(d): Send an ARP Packet, operation : 2, sender_eth_addr : 0022-a100-18ea,sender_ip_addr : target_eth_addr : 00e0-fc00-000c, target_ip_addr : 使用限制display arp只对三层口有意义。14检查路由使用场
28、合在设备接口UP时,但如果ping远端设备或PC不通,可以检查一下路由表项是否正常。命令介绍display fibdisplay ip routing-table使用方法使用命令display fib或display ip routing-table查看防火墙fib表是否有相应的路由,并检查是否正确。针对动态路由请使用display ospf peer、display ospf brief等ospf命令检查ospf是否正常;针对静态路由,使用display current-configuration | include ip route-static命令检查是否添加相应的静态路由。使用示例di
29、splay fib14:20:57 2010/07/02 Destination/Mask Nexthop Flag TimeStamp Interface/0 GSU t0 GigabitEthernet0/0/1/0 GSU t0 GigabitEthernet0/0/0/0 GSU t0 GigabitEthernet0/0/3/32 GHU t0 InLoopBack0/24 U t0 GigabitEthernet0/0/3/8 GSU t0 GigabitEthernet0/0/1 /24 U t0 GigabitEthernet0/0/1/24 U t0 GigabitEthernet0/0/0 /32 GHU t0 InLoopBack0/32 GHU t0 InLoopBack0 /32 GHU t0 InLoopBack0/32 GHU t0 InLoopBack0 /24 U t0 LoopBack0/8 U
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1