在网络管理中,网络故障排查是一个非常重要的环节。当网络出现故障时,我们需要快速定位问题并解决它。华为交换机提供了远程端口镜像技术,可以帮助我们快速定位网络故障。在本文中,我们将介绍如何使用华为交换机的远程端口镜像技术进行网络故障排查。
某医院的行政部门网络经常断网,需要通过LSW6接入交换机组网,然后通过SwitchA与互联网通信。Server端通过SwitchB与SwitchA相连。现在需要通过Server端,对医院的行政部门进行远程流量监控,以监控访问外网的数据流量,从而排查网络故障。
我这里以华为交换机为例
1、配置观察端口,在SwitchA上
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo inf
[Huawei]undo info-center en
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]
[Huawei]sysna
[Huawei]sysname SwitchA
[SwitchA]
[SwitchA]observe-port 1 in
[SwitchA]observe-port 1 interface gi
[SwitchA]observe-port 1 interface GigabitEthe.NET 0/0/2 vlan 10
[SwitchA]
[SwitchA]
通过上述配置,远端的观察接口会将相关的镜像报文转发给vlan10,如果不进行远端观察接口的配置,我们就的将远端观察口加入到vlan中。
2、配置镜像端口,在SwitchA上
[SwitchA]interface GigabitEthernet 0/0/1
[SwitchA-GigabitEthernet0/0/1]port-mi
[SwitchA-GigabitEthernet0/0/1]port-mirroring to ?
observe-port Observe port
[SwitchA-GigabitEthernet0/0/1]port-mirroring to ob
[SwitchA-GigabitEthernet0/0/1]port-mirroring to observe-port 1 in
[SwitchA-GigabitEthernet0/0/1]port-mirroring to observe-port 1 inbound
[SwitchA-GigabitEthernet0/0/1]return
3、在SwitchB上创建VLAN10,并关闭该VLAN的mac地址学习功能,并将接口GE0/0/1和GE0/0/2加入VLAN10。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysn
[Huawei]sysname SwitchB
[SwitchB]vlan 10
[SwitchB-vlan10]mac-address learning disable
[SwitchB-vlan10]
[SwitchB-vlan10]quit
[SwitchB]
[SwitchB]inter
[SwitchB]interface gi
[SwitchB]interface GigabitEthernet 0/0/1
[SwitchB-GigabitEthernet0/0/1]port lin
[SwitchB-GigabitEthernet0/0/1]port link-t
[SwitchB-GigabitEthernet0/0/1]port link-type ac
[SwitchB-GigabitEthernet0/0/1]port link-type access
[SwitchB-GigabitEthernet0/0/1]por
[SwitchB-GigabitEthernet0/0/1]port def
[SwitchB-GigabitEthernet0/0/1]port default valn
[SwitchB-GigabitEthernet0/0/1]port default va
[SwitchB-GigabitEthernet0/0/1]port default vl
[SwitchB-GigabitEthernet0/0/1]port default vlan 10
[SwitchB-GigabitEthernet0/0/1]
[SwitchB-GigabitEthernet0/0/1]quit
[SwitchB]
[SwitchB]interface GigabitEthernet 0/0/2
[SwitchB-GigabitEthernet0/0/2]
[SwitchB-GigabitEthernet0/0/2]port link-type trunk
[SwitchB-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[SwitchB-GigabitEthernet0/0/2]retu
[SwitchB-GigabitEthernet0/0/2]return
<SwitchB>
4、结果验证
1)查看远程观察接口的相关信息
<SwitchA>dis observe-port
----------------------------------------------------------------------
Index : 1
Interface: GigabitEthernet0/0/2
Used : 1
Vlan : 10
----------------------------------------------------------------------
<SwitchA>
2)查看镜像端口的配置信息
<SwitchA>dis port-mirroring
Port-mirror:
----------------------------------------------------------------------
Mirror-port Direction Observe-port
----------------------------------------------------------------------
GigabitEthernet0/0/1 Inbound GigabitEthernet0/0/2
----------------------------------------------------------------------
<SwitchA>
通过上述配置后,我们就可以在server端,捕捉到行政部门接入外网的相关网络流量,从而对其故障进行排查。