华为NE40端口镜像,一对一和一对多,流量过滤

如题所述

第1个回答  2022-07-17
镜像口:Eth-trunk11

 观测口:GE5/1/1,GE5/1/2,GE5/1/3

这个条命令”port-mirroring to observe-index 33 34 35“的值可以从1-64,可以一个也可以多个。一对一采用一个即可,1对多则多个。

配置:

interface Eth-Trunk11

port-mirroring inbound

port-mirroring outbound

port-mirroring to observe-index 33 34 35

#

interface GigabitEthernet5/1/1

port-observing observe-index 33

#

interface GigabitEthernet5/1/2

port-observing observe-index 34

#

interface GigabitEthernet5/1/3

port-observing observe-index 35

这样R1和R2交互的流量都会复制一份到观测口GE5/1/1-3上。如果流量过大可以考虑做策略控制,最后在镜像口Eth-Trunk11下调用。当然ACL要自己玩。config模板如下:

acl number 2001

rule 5 permit source x.x.x.x 0

#

acl ipv6 number 2001

rule 5 permit source xxxx:xxxx::x 0

#

traffic classifier A

if-match acl 2001

if-match ipv6 acl 2001

#

traffic behavior B

port-mirroring enable

#

traffic policy C

share-mode

classifier A behavior B

#

interface Eth-Trunk11

traffic-policy C inbound

traffic-policy C outbound

注意一点是这个策略是会针对所有的抓包机,如果抓包机抓取不同的业务流量,建议还是从抓包机上做过滤。
相似回答