背景:某单位上架一台内网准入设备,在核心交换上配置端口镜像,将内网进出流量镜像到准入设备监控口进行行为监控,当流量来自不可信终端时候阻口发送reset报文进行阻断,并把不可信终端的http请求重定向到准入设备上,要求终端安装准入客户端进行认证后才允许入网。

配置思路:配置一个本地观察口,该接口和准入设备的监控口对接,将需要监控的端口流量复制一份到该接口。

操作步骤

1. 使用Telnet或者Console口登陆到交换机。

2. 配置本地观察口(此处配置23口为本地观察口)

<Huawei> system-view
[Huawei] observe-port 1 interface Gigabitethernet 0/0/23

3. 配置端口镜像,将需要监控和的端口流量复制到观察口(此处配置GE0/0/1-6口为镜像端口)

[Huawei] interface Gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1] port-mirroring to observe-port 1 both
[Huawei-GigabitEthernet0/0/1] quit

[Huawei] interface Gigabitethernet 0/0/2
[Huawei-GigabitEthernet0/0/2] port-mirroring to observe-port 1 both
[Huawei-GigabitEthernet0/0/2] quit

[Huawei] interface Gigabitethernet 0/0/3
[Huawei-GigabitEthernet0/0/3] port-mirroring to observe-port 1 both
[Huawei-GigabitEthernet0/0/3] quit

[Huawei] interface Gigabitethernet 0/0/4
[Huawei-GigabitEthernet0/0/3] port-mirroring to observe-port 1 both
[Huawei-GigabitEthernet0/0/3] quit

4. 验证配置

查看观测口配置情况

[Huawei] display observe-port
----------------------------------------------------------------------
Index : 1
Untag-packet : No
Interface : GigabitEthernet0/0/23
----------------------------------------------------------------------

查看端口镜像配置情况:

[Huawei] display port-mirroring
----------------------------------------------------------------------
Observe-port 1 : GigabitEthernet23/0/4
----------------------------------------------------------------------
Port-mirror:
----------------------------------------------------------------------
Mirror-port Direction Observe-port
----------------------------------------------------------------------
1 GigabitEthernet0/0/1 Inbound  Observe-port 1
2 GigabitEthernet0/0/1 outbound Observe-port 1
3 GigabitEthernet0/0/2 Inbound  Observe-port 1
4 GigabitEthernet0/0/2 outbound Observe-port 1
5 GigabitEthernet0/0/3 Inbound  Observe-port 1
6 GigabitEthernet0/0/3 outbound Observe-port 1
7 GigabitEthernet0/0/4 Inbound  Observe-port 1
8 GigabitEthernet0/0/4 outbound Observe-port 1
----------------------------------------------------------------------

配置结束,配置成功后要记得save一下。