网络设备常用排障命令——华为&华三H3C

华为的ACL默认是允许,路由策略默认是拒绝

华为设备BGP查询命令

#强制踢出vty登陆用户
    dis users
    free user-interface vty 2

#查看bgp配置
    display current-configuration configuration bgp

#查看对等体列表
    display bgp peer

#查看指定对等体信息描述
    display bgp peer 10.0.0.18 verbose

#查看指定对等体日志信息
    display bgp peer 10.0.0.18 log-info

#显示发布给指定对等体的公网路由信息。
    dis bgp routing-table peer 14.192.11.254 advertised-routes

#显示从指定对等体收到的公网路由信息。
    dis bgp routing-table peer 14.192.11.254 received-routes

#显示通过路由策略的路由信息。
    dis bgp routing-table peer 14.192.11.254 accepted-routes

#显示BGP路由的as-path信息。
    display bgp routing-table 1.2.3.1 24 as-path

#显示BGP路由表中所有路由的团体属性。
    display bgp routing-table 1.2.3.1 24 community-list

#显示活跃路由统计信息。
    display bgp routing-table statistics active

#显示best和best-external路由统计信息。
    display bgp routing-table statistics best

#查看指定的路由策略配置
    display cu configuration route-policy Static-To-BGP-WebComand

#查看指定的路由策略配置
    dis route-policy SGP-To-BGP-WebCommand

#查看指定的前缀
    dis ip ip-prefix P_103.233.254.0

#查看所有的前缀过滤策略
    display ip as-path-filter

#查看指定的前缀过滤策略
    display ip as-path-filter CM-AS

#查看所有的团体属性过滤策略
    display ip community-filter

#查看指定的团体属性过滤策略
    display ip community-filter Blackhole_AS4635[HKIX]

#查看指定的团体属性过滤策略
    dis bgp rout community-filter Blackhole_AS4635[HKIX]

#查看某条路由在IP路由表怎么走
    dis ip routing-table 223.84.153.80

#查看某条指定路由在BGP 路由表中是怎样的 
    dis bgp routing-table 223.84.153.80

#查看带有No export属性的community路由信息(不发布到本AS之外)
    display bgp routing-table community no-export   

#华为交换机攻击cpu防护
<HK-CU-J20-S9306-4>dis cu configuration cpu-defend-policy cpu
cpu-defend policy cpu
 blacklist 1 acl 3002
 car packet-type arp-miss cir 16 cbs 10000
 auto-defend enable
 auto-defend alarm enable
 auto-defend action deny timer 3600

#华为设备如何获取SN码
    https://support.huawei.com/enterprise/zh/bulletins-website/ENEWS2000005772

华为交换机常用机命令

#关闭接口ICMP响应
interface g0/0/1
    undo icmp host-unreachable send
    undo icmp port-unreachable send
    undo icmp ttl-exceeded send

#查看某个流策略traffic-policy 应用在那些接口上
    dis traffic-policy applied-record P200M

#查看是否存在二层环路,环的vlan是多少
    dis mac-address flapping record

<SH-TongLian-B0601-40U-S6720>dis mac-address flapping record 
 S  : start time                                                                
 E  : end time                                                                  
(Q) : quit VLAN                                                                 
(D) : error down                                                                
------------------------------------------------------------------------------- 
Move-Time                 VLAN MAC-Address  Original-Port  Move-Ports   MoveNum
------------------------------------------------------------------------------- 
S:2019-07-18 18:34:36     204  0024-ecf1-56f4 Eth-Trunk11   XGE0/0/38    65535
E:2019-07-18 19:15:29                                       XGE0/0/4        
S:2019-07-18 16:11:40     301  0024-ecf1-3f53 XGE0/0/41     Eth-Trunk11  41730
E:2019-07-18 16:25:52                                         
S:2019-07-17 17:26:52     250  002e-c7dd-1bb2 XGE0/0/38     XGE0/0/44    65535
E:2019-07-17 18:28:55                                         
S:2019-07-13 02:48:28     1301 001e-080f-421f XGE0/0/45     XGE0/0/14    72   
E:2019-07-13 02:48:29                                         
------------------------------------------------------------------------------- 
Total items on slot 0: 4

#查看告警信息(然后根据告警OID去华为官网的技术支持下的产品文档 查询可能的原因 ,如您可以查询 NE40的 1.3.6.1.4.1.2011.5.25.219.2.2.)
    display alarm active 

#MAC黑洞
    [TJ-9306]mac-address blackhole 0015-5d78-7f87

#如何绑定静态arp
    [TJ-9306]arp static 1.1.1.1 000c-2935-489b

#重置arp,让arp重新学习
    <TJ-9306>reset arp dynamic 1.1.1.1

#清除端口的流量统计数据
    <TJ-9306>reset counters interface g0/0/1

#查看有哪些VRF,能看到所有配置
    <TJ-9306>dis cu configuration  vpn-instance
    <TJ-9306>dis cu configuration vpn-instance related

#查看VRF所应用在哪些接口
    <TJ-9306>dis ip vpn-instance L3BGP interface

    <TJ-9306>dis ip vpn-instance interface
 VPN-Instance Name and ID : QingWWZ-HK-TencentCloud, 3
  Interface Number : 2 
  Interface list : Vlanif2425, 
                   Vlanif2397

#查询VRF路由表项(vpn-instance)
    <TJ-9306>dis ip routing-table vpn-instance Tencent-Cloud 

#带源地址的tracert(ping)(包括使用了VRF的情形)
    tracert -a 11.11.11.1 22.2.2.2
    tracert -vpn-instance CN2 -a 103.76.105.129 222.180.149.226

    ping -a 1.1.1.1 2.2.2.2
    ping -vpn-instance CN2 -a 103.76.105.1 222.180.149.226
    ping -c 500 -m 1 180.150.147.40     #交换机快ping

#查看接口光衰|光功率
    <TJ-9306>dis transceiver interface g1/0/0 verbose
    # CE系列交换机 这么看(可能某些模块不支持DDM数字诊断监测功能,所以看不到光衰功率)
    <HLJ-Suihua-CU-CORE-CE6870>dis int 100GE 1/0/1 transceiver verbose

#查看交换机某接口的默认配置
    dis this include-default

#查看某个接口的流量情况
    dis traffic policy statistics interface g0/0/35 inbound verbose classifier-base

#清除流量策略流量统计(清除流量统计)
    >reset traffic policy statistics interface g0/0/0 inbound
    >reset counters interface g0/0/35

#快速检查交换机mac地址有不有mac漂移(LDT检测)
    #框式设备默认使能该功能,可直接查看,盒式设备要在vlan下先使能,( [s5700-vlan100]loop-detect eth-loop alarm-only )
    display  loop-detect eth-loop

#查看策略是如何调用的
    dis traffic policy user-defined BGP-To-1299

查看专线的累计流量

    dis traffic policy statistics interface g1/6/0/0 outbound verbose classifier-base class vlan1086-LianYSJ-SH-LA-003-100M

华为交换机常用机命令

查看交换机ICMP统计
        dis icmp statistics

#查看报文统计功能(有用)(可以查看cpcar,比如arp,icmp等的pass与drop数)
        dis cpu-defend statistics all
        dis cpu-defend statistics all | include icmp
        dis cpu-defend statistics all | include snmp
        dis cpu-defend configuration packet-type icmp all   (查看某种协议在交换机里的cpcar限速配置,易信的ping -f 丢包)
        dis cpu-defend statistics packet-type icmp all      (查看报文统计关于icmp的统计pass与drop统计)可以看arp的等

#交换机流量统计(inbound和outbound)使用方式
    1:定义一个高级ACL,匹配源和目的地址
    2:定义流非分类,流行为,流策略
    3:在两个通信接口接口下的对应方向应用该策略
    4:查看两个通信接口的入方向和出方向流量情况
          dis traffic policy interface Ethernet 0/0/24 inbound
          dis traffic policy interface Ethernet 0/0/23 outbound

      查看流量统计(后面一个用于在以后的traffic policy里面新加匹配的acl,时使用)
        dis traffic policy statistics interface g0/0/0 inbound
        dis traffic policy statistics interface g0/0/1 outbound
        dis traffic policy statistics interface g0/0/1 outbound verbose classifier-base class c1

      清除流量策略流量统计
        reset traffic policy statistics interface g0/0/0 inbound

#交换机丢包故障处理
    二层丢包:
        1:首先确认两个通信接口是否在同一vlan
        2:确认mac对应关系正确(小心mac漂移)    (漂移可能导致,可能不是交换机丢了,而是转发到别的口去了)
        3:查接口信息
            dis interface Ethernet 0/0/24   (若是output方向的Discard数一直在增长,唯一的原因是拥塞丢弃,因为交换机的Discard是符合RFC标准的)
        4:使用流量统计功能

    三层丢包:
        1:看ARP,看路由表,(小心ARP一直不停改变,可能是IP地址冲突)
        2:根据流量统计,确定丢包点

二层mac漂移,三层ARP,路由震荡导致的数据包转发到其他口上的排查技巧(小技巧,如何使用流量统计,来确实是不是交换机将流量转发到了别的口上)
        1:在预期的口上出方向绑定
        2:再将将流量统计应用到全局出方向,

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
端口类故障的处理
        1:电口不能UP,(半双工)
        2:光口打环测试

#快速检查交换机mac地址有不有mac漂移(LDT检测)
        #框式设备默认使能该功能,可直接查看,盒式设备要在vlan下先使能,( [s5700-vlan100]loop-detect eth-loop alarm-only )
        display  loop-detect eth-loop

华三交换机常见故障排查

H3C arp攻击问题排查步骤(95e和12500),命令可能不一样,思路是一致的

arp攻击问题排查步骤
1、确定arp报文上送CPU的速率门限值
    display qos policy control-plane pre-define
2、查看上送CPU的arp报文统计情况(数字是框号,槽位号)
    display hardware internal nst packet-statistic chassis 2 solt 2 clear
3、打印上送CPU的报文确定攻击源
    terminal debug      #开启调试开关,显示debuglog
    terminal m          #显示display log
    display hardware internal rxtx rxpkt slot 2 length 100 number 200

arp攻击解决
    打开设备的arp防攻击功能
    []arp source-mac {filter | monitor}     #filter表示检测到攻击后对mac地址对应的arp报文进行过滤,monitor只打印告警信息
    查看防攻击表项里面的内容
    []dis arp source-mac chassis 2 slot 2
声明:本文为原创,作者为 辣条①号,转载时请保留本声明及附带文章链接:https://boke.wsfnk.com/archives/82.html
谢谢你请我吃辣条谢谢你请我吃辣条

如果文章对你有帮助,欢迎点击上方按钮打赏作者

最后编辑于:2024/7/25作者: 辣条①号

目标:网络规划设计师、系统工程师、ceph存储工程师、云计算工程师。 不负遇见,不谈亏欠!

暂无评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

arrow grin ! ? cool roll eek evil razz mrgreen smile oops lol mad twisted wink idea cry shock neutral sad ???

文章目录