最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

华为路由交换端口镜像配置

IT圈 admin 39浏览 0评论

2024年2月15日发(作者:苟明达)

一、 端口镜像概念:

Port Mirror(端口镜像)是用于进行网络性能监测。可以这样理解:在端口 A和端口 B之间 建立镜像关系,这样,通过端口 A传输的数据将同时复制到端口 B,以便于在端口 B上连 接的分析仪或者分析软件进行性能分析或故障判断。

二、 端口镜像配置

『环境配置参数』

1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24

2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24

3. E0/24为交换机上行端口

4. Server接在交换机E0/8端口,该端口作为镜像端口

『组网需求』

1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。

2. 按照镜像的不同方式进行配置:

1) 基于端口的镜像

2) 基于流的镜像

2数据配置步骤

『端口镜像的数据流程』

基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量 观测或者故障定位。

【3026等交换机镜像】

S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法:

方法一

1. 配置镜像(观测)端口

[SwitchA]monitor-port e0/8

2. 配置被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2

方法二

1. 可以一次性定义镜像和被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8

【8016交换机端口镜像配置】

1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口 1/0/15为端口镜 像的观测端口。

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,对其输入输出数据都进行镜像。

[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15

也可以通过两个不同的端口,对输入和输出的数据分别镜像

1. 设置E1/0/15和E2/0/0为镜像(观测)端口

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。

[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15

[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0

『基于流镜像的数据流程』

基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来 说这两个数据流是要分开镜像的。

【3500/3026E/3026F/3050】

〖基于三层流的镜像〗

[SwitchA]aclnum 100

2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址

[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any

3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32

[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0

4. 将符合上述ACL规则的报文镜像到E0/8端口

[SwitchA]mirrored-to ip-group 100 interface e0/8

〖基于二层流的镜像〗

1. 定义一个ACL

[SwitchA]aclnum 200

2. 定义一个规则从E0/1发送至其它所有端口的数据包

[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2

3. 定义一个规则从其它所有端口到E0/1端口的数据包

[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1

4. 将符合上述ACL的数据包镜像到E0/8

[SwitchA]mirrored-to link-group 200 interface e0/8

【5516/6506/6503/6506R 】

目前该三款产品支持对入端口流量进行镜像

1.

2.

定义镜像端口

定义被镜像端口 [SwitchA]mirroring-port Ethernet 3/0/1 inbound

【补充说明】

1. 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,

反之则无法实现

2. 8016支持跨单板端口镜像端口镜像配置

『环境配置参数』

1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24

2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24

3. E0/24为交换机上行端口

4. Server接在交换机E0/8端口,该端口作为镜像端口

『组网需求』

1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。

2. 按照镜像的不同方式进行配置:

1) 基于端口的镜像

2) 基于流的镜像

2数据配置步骤

『端口镜像的数据流程』

基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量 观测或者故障定位。

【3026等交换机镜像】

S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法:

方法一

1. 配置镜像(观测)端口

[SwitchA]monitor-port e0/8

2. 配置被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2

方法二

1. 可以一次性定义镜像和被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8

【8016交换机端口镜像配置】

1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口 1/0/15为端口镜 像的观测端口。

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,对其输入输出数据都进行镜像。

[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15

也可以通过两个不同的端口,对输入和输出的数据分别镜像

1. 设置E1/0/15和E2/0/0为镜像(观测)端口

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。

[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15

[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0

『基于流镜像的数据流程』 基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来

说这两个数据流是要分开镜像的。

【3500/3026E/3026F/3050】

〖基于三层流的镜像〗

1. 定义一条扩展访问控制列表

[SwitchA]aclnum 100

2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址

[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any

3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32

[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0

4. 将符合上述ACL规则的报文镜像到E0/8端口

[SwitchA]mirrored-to ip-group 100 interface e0/8

〖基于二层流的镜像〗

1. 定义一个ACL

[SwitchA]aclnum 200

2. 定义一个规则从E0/1发送至其它所有端口的数据包

[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2

3. 定义一个规则从其它所有端口到E0/1端口的数据包

[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1

4. 将符合上述ACL的数据包镜像到E0/8

【5516/6506/6503/6506R 】 目前该三款产品支持对入端口流量进行镜像

1. 定义镜像端口

[SwitchA]monitor-port Ethernet 3/0/2

2. 定义被镜像端口

[SwitchA]mirroring-port Ethernet 3/0/1 inbound

注意!在此提醒一下各位,相同型号不同版本的设备,配置方法有时是有差异的,最终还是以版本对应的操作手册为准。

2024年2月15日发(作者:苟明达)

一、 端口镜像概念:

Port Mirror(端口镜像)是用于进行网络性能监测。可以这样理解:在端口 A和端口 B之间 建立镜像关系,这样,通过端口 A传输的数据将同时复制到端口 B,以便于在端口 B上连 接的分析仪或者分析软件进行性能分析或故障判断。

二、 端口镜像配置

『环境配置参数』

1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24

2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24

3. E0/24为交换机上行端口

4. Server接在交换机E0/8端口,该端口作为镜像端口

『组网需求』

1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。

2. 按照镜像的不同方式进行配置:

1) 基于端口的镜像

2) 基于流的镜像

2数据配置步骤

『端口镜像的数据流程』

基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量 观测或者故障定位。

【3026等交换机镜像】

S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法:

方法一

1. 配置镜像(观测)端口

[SwitchA]monitor-port e0/8

2. 配置被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2

方法二

1. 可以一次性定义镜像和被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8

【8016交换机端口镜像配置】

1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口 1/0/15为端口镜 像的观测端口。

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,对其输入输出数据都进行镜像。

[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15

也可以通过两个不同的端口,对输入和输出的数据分别镜像

1. 设置E1/0/15和E2/0/0为镜像(观测)端口

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。

[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15

[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0

『基于流镜像的数据流程』

基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来 说这两个数据流是要分开镜像的。

【3500/3026E/3026F/3050】

〖基于三层流的镜像〗

[SwitchA]aclnum 100

2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址

[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any

3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32

[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0

4. 将符合上述ACL规则的报文镜像到E0/8端口

[SwitchA]mirrored-to ip-group 100 interface e0/8

〖基于二层流的镜像〗

1. 定义一个ACL

[SwitchA]aclnum 200

2. 定义一个规则从E0/1发送至其它所有端口的数据包

[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2

3. 定义一个规则从其它所有端口到E0/1端口的数据包

[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1

4. 将符合上述ACL的数据包镜像到E0/8

[SwitchA]mirrored-to link-group 200 interface e0/8

【5516/6506/6503/6506R 】

目前该三款产品支持对入端口流量进行镜像

1.

2.

定义镜像端口

定义被镜像端口 [SwitchA]mirroring-port Ethernet 3/0/1 inbound

【补充说明】

1. 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,

反之则无法实现

2. 8016支持跨单板端口镜像端口镜像配置

『环境配置参数』

1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24

2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24

3. E0/24为交换机上行端口

4. Server接在交换机E0/8端口,该端口作为镜像端口

『组网需求』

1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。

2. 按照镜像的不同方式进行配置:

1) 基于端口的镜像

2) 基于流的镜像

2数据配置步骤

『端口镜像的数据流程』

基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量 观测或者故障定位。

【3026等交换机镜像】

S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法:

方法一

1. 配置镜像(观测)端口

[SwitchA]monitor-port e0/8

2. 配置被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2

方法二

1. 可以一次性定义镜像和被镜像端口

[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8

【8016交换机端口镜像配置】

1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口 1/0/15为端口镜 像的观测端口。

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,对其输入输出数据都进行镜像。

[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15

也可以通过两个不同的端口,对输入和输出的数据分别镜像

1. 设置E1/0/15和E2/0/0为镜像(观测)端口

[SwitchA] port monitor ethernet 1/0/15

2. 设置端口 1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。

[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15

[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0

『基于流镜像的数据流程』 基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来

说这两个数据流是要分开镜像的。

【3500/3026E/3026F/3050】

〖基于三层流的镜像〗

1. 定义一条扩展访问控制列表

[SwitchA]aclnum 100

2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址

[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any

3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32

[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0

4. 将符合上述ACL规则的报文镜像到E0/8端口

[SwitchA]mirrored-to ip-group 100 interface e0/8

〖基于二层流的镜像〗

1. 定义一个ACL

[SwitchA]aclnum 200

2. 定义一个规则从E0/1发送至其它所有端口的数据包

[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2

3. 定义一个规则从其它所有端口到E0/1端口的数据包

[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1

4. 将符合上述ACL的数据包镜像到E0/8

【5516/6506/6503/6506R 】 目前该三款产品支持对入端口流量进行镜像

1. 定义镜像端口

[SwitchA]monitor-port Ethernet 3/0/2

2. 定义被镜像端口

[SwitchA]mirroring-port Ethernet 3/0/1 inbound

注意!在此提醒一下各位,相同型号不同版本的设备,配置方法有时是有差异的,最终还是以版本对应的操作手册为准。

发布评论

评论列表 (0)

  1. 暂无评论