思朋思科知识点-交换机端口镜像配置大全
发布时间:2013-11-23 浏览次数:6245

1、思科(CISCO)交换机
1.1配置镜像(SPAN)端口
Switch(config)# monitor session 1 source interface fastethernet 4/10
Switch(config)# monitor session 1 filter vlan 57
Switch(config)# monitor session 1 destination interface fastethernet 4/15
如果想释放该SPAN 任务,输入如下命令:
Switch(config)# no monitor session 1
以下语句显示如何检验SPAN 任务的配置结果:
Switch# show monitor session 2
在配置镜像端口(SPAN)过程中,还应考虑到数据流量过大时,设备的处理速度及端口数
据缓存的大小,要尽量减少被监控数据包的丢失。
1.2 Catalyst 2550/2950/3550/3560/3560-E/3570-E
旧交换机系统命令:
Switch(config)# int fa0/1
Switch(config-if)# port monitor fastEthernet0/2
新交换机系统命令:
Switch> show interfaces
Switch> enable
Password: cisco
Switch# configure terminal
Switch(config)# monitor session 1 source interface fastethernet 0/17
Switch(config)# monitor session 1 destination interface fastethernet 0/2
Switch(config)# end
Switch# show monitor session 1 –查看镜像
Switch# no monitor session 1 –清空镜像
Switch# show running-config –查看运行配置
Switch# copy running-config startup-config –保存到配置文件
如果用 display mirror 命令看到ingress:disabled,说明划分了VLAN,源数据中包含了目
的端口所在的VLAN。假设目的端口在VLAN1:
Switch(config)# monitor session 1 filter vlan 1
或者
Switch(config)# monitor session 1 destination interface fasternet 0/20 ingress vlan 1
1.3 Catalyst 4000/4500/4900
进入配置模式:
Switch# enable
Switch# password cisco –默认为cisco
Switch# configure terminal
举例配置: FastEthernet2/3为源端口,FastEthernet5/48为目的端口
Switch(config)# monitor session 1 source interface fa 2/3 (rx|tx|both)
Switch(config)# monitor session 1 destination interface fa 5/48
当源端口是trunk interface 时,监控VLAN 1-5 和VLAN 9
Switch(config)# monitor session 2 fiter vlan 1-5,9
当监控FastEthernet 4/10是trunk interface 带着VLAN 1-1005,如果只想监控VLAN57的数
据,fastethernet 4/15为目的端口
Switch(config)# monitor session 1 source interface fastethernet 4/10
Switch(config)# monitor session 1 filter vlan 57
Switch(Config)# monitor session 1 destination interface fastethernet 4/15
1.4 Cisco catylist2820
有2 个菜单选项
先进入menu 选项,enable port monitor
进入cli 模式,
en
conf term
Interface fast 0/x –镜像口
port monitor fast 0/x –被镜像口
exit
wr
2
、华为交换机
2.1 华为NE80
3/0/2的数据镜像到3/0/0 和3/0/1中
NE80-C(config)#observing-port ethernet3/0/0
NE80-C(config)#observing-port Ethernet3/0/1
NE80-C(config)#port-mirroring ethernet3/0/2 both ethernet3/0/0 ethernet3/0/1
注:如果只想镜像出口或入口可以将both改为egress或ingress
2.2 华为3900
[Quidway] interface Ethernet 1/0/4
[Quidway-Ethernet1/0/1] monitor-port
[Quidway-Ethernet1/0/1] quit
[Quidway] interface Ethernet1/0/1
[Quidway-Ethernet1/0/1] mirroring-port both
[Quidway-Ethernet1/0/1] quit
2.3 华为S6500/S7500
将1/0/1~1/0/3端口镜像到1/0/4
[Quidway]system-view
[Quidway]mirroring-group 1 inbound Ethernet 1/0/1 to Ethernet1/0/3 mirrored-to Ethernet
1/0/4
[Quidway]mirroring-group 1 outbound ethernet1/0/1 to Ethernet1/0/3 mirrored-to Ethernet
1/0/4
取消镜像
[Quidway]undo mirroring-group 1
2.4 Quidway 2008/2016/3026/2403H
Quidway(config)# monitor-port e 0/18 –镜像口
Quidway(config)# monitor e 0/3 –被镜像口
上述两条命令与下面一条等效
Quidway(config)# monitor e 0/3 observing-port e0/18
查看镜像端口信息
Quidway(config)# show monitor
2.5 Quidway 3526
Quidway(config)#monitor-port Ethernet 0/24 –监控口
将从 Ethernet0/1输出的业务流镜像到监控口
Quidway(config)#rule-map 12 rule1 ingress Ethernet 0/1 egress any
将从 Ethernet0/1输入的业务流镜像到监控口
Quidway(config)#rule-map 12 rule2 ingress any egress Ethernet 0/1
注:(rule1/rule2)为rule 名称,两个规则名称不能相同,否则后配置规则覆盖先配置的规
则,any定义对端口Ethernet0/1的所有(出/入)的业务流进行监控。
3、H3C
交换机
3.1 H3C S2008/S2016/S2026/S2403H/S3026
方法一:
[SwitchA]system-view
[SwitchA]monitor-port 0/8 –(观测)端口
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 –被镜像端口
方法二:
[SwitchA]system-view
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8
3.2 H3C S3100
< H3C>system-view
[H3C]mirroring-group 1 local
[H3C]mirroring-group 1 monitor-port Ethernet 1/0/4 –镜像口
[H3C]mirroring-group 1 mirroring-port Ethernet 1/0/1 both –被镜像口
3.3 H3C S3500
< H3C>system-view
[H3C]mirroring-group 1 local
[H3C]mirroring-group 1 mirroring-port Ethernet 1/0/1 to Ethernet 1/0/5 both
3.4 H3C S3600
方法一:
<H3C>system-view
[H3C]mirroring-group 1 local
[H3C]interface Ethernet 1/0/4
[H3C-Ethernet1/0/4]monitor-port –设置为镜像口
[H3C-GigabitEthernet1/0/4]quit
[H3C]interface Ethernet 1/0/1
[H3C-GigabitEthernet1/0/1]mirroring-port both –设置为被镜像口
[H3C-GigabitEthernet1/0/1]quit
[H3C]save –(Y/N)保存名称
方法二:
<H3C>system-view
[H3C]mirroring-group 1 local
[H3C]mirroring-group 1 monitor-port GigabitEthernet 1/0/4
[H3C]mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both
4、3COM
交换机
4.1 3com 4400
24端口监控9端口
Select menu option(feature/rovingAnalysis):add
Select analyzer port(unit:port,?): 1:24
Select menu option(feature/rovingAalysis):start
Select port to monitor(unit:port,?): 1:9
Select menu option(feature/rovingAnalysis):summary
注:命令(add、start、remove、summary)
4.2 3com 3500/3026E/3026F/3050/S3526
< switch>system-view
[switch]ac1 num 4000 –定义一条扩展访问控制列表
定义对 e0/2口出/入进行监控
[switch-ac1-4000]rule 0 permit ingress interface Ethernet 0/2 egress any
[switch-ac1-4000]rule 1 permit ingress any egress interface Ethernet 0/2
[switch-ac1-4000]quit
定义 e0/1监控口
[switch]mirrored-to link-group 4000 rule 0 interface Ethernet 0/1
[switch]mirrored-to link-group 4000 rule 1 interface Ethernet 0/1

[switch]mirrored-to link-group 4000 interface Ethernet 0/1
4.3 3com 4900 family
配置分析端口
Feature rovingAlysis add
The following prompt is displayed:
Select analyzer port(unit:port,?): 1:10
配置被监控端口
Feature rovingAlysis start
The following prompt is displayed:
Select unit to monitor(unit:port,?): 1:12
检查配置
Feature rovingAnalysis summary
5、D-Link
交换机
5.1 D-Link 3226
DES-3226S:4#config mirror port 1 add source ports 2 both
DES-3226S:4#show mirror
DES-3226S:4#enable mirror
DES-3226S:4#config port mirroring source port b target port 1
6、Tp-Link
交换机
7
、北电交换机
7.1 Nortel 1100/2000
支持一组镜像、2个source 、1个destination 默认用户名/密码12/12
Config
Mirror
Input1(mod/port)enable
Input2(mod/port)enable
Output(mod/port)enable
Save configure ture
7.2 Nortel 8000 series
默认用户名/密码rwa/rwa
Config diag mirror-by-port 1 create in-port 2/4 out-port 2/1
Config diag mirror-by-port 1 enable ture
Config diag mirror-by-port 1 mode both | tx | rx
Save config
Diag mirror-by-port 1 info –查看第1号镜像
注:Nortel 镜像功能通常是rx,不支持both(看CPU而定)
8
、锐捷交换机
Switch#configure terminal
Switch(config)#monitor session 1 source interface fastEthernet 0/10 both
Switch(config)#monitor session 1 destination interface fastEthernet 0/2
Switch(config)show monitor session 1
Switch#show running-config –显示当前所有配置
Switch#no monitor session 1 –取消镜像session 1
9、Intel
交换机
Navigation菜单-> Statistics -> Mirror Ports -> Mirror Ports对话框
Configure Source -> Mirror Ports Configuration -> Apply(确定)
三种监听模式:
1、连续(Always):镜像全部流量
2、周期(Periodic):在一定周期内镜像全部流量。周期在Sampling interval configuration
中设置
3、禁止(Disabled):关闭流量镜像
10、Avaya
交换机
设置端口监听:set port mirror source-port mirror-port sampling{always | disable | periodic}
[max-packets-sec < max-packets-sec-value>] [piggyback-port]
Mod-port-range:指定端口范围
Mod-port-spec:指定特定端口
Piggyback-port:指定双向镜像的端口
Sampling:指定镜像周期
Max-packets-sec:指定监听口每秒最多的数据报数量(仅在sampling设置为periodic时)
禁止端口监听:clear port mirror
11
、港湾交换机
11.1 flax24
Harbour(config)#
Harbour(config)# config mirroring 1
Harbour(config)#config mirroring 1 add port 5 (or 5-10) –被镜像口
Harbour(config)#config mirroring 1 to 13 –镜像口
Harbour(config)#show mirroring
Harbour(config)#save configuration
11.2 港湾6802
Interface Ethernet 1/11
Mirror ingress 1/10 egress 1/10
Exit
Extreme alpine 3802
Alpine3804:#enable mirroring to port 2:10
Alpine3804:#configure mirror add port 2:32
Alpine3804:#configure mirror add port 2:1
注:如果监控端口与被监控端口不在一个控制器(一组端口)中的话,只能抓到进口包,
出口包抓不到
11.3 BigHammer 6808
设置镜像(板槽1,1端口监控2口接收、3口接收和发送、4口发送的数据)
Harbour(config)#interface Ethernet 1/1
Harbour(config-if-eth1/1)#mirror ingress 1/2,1/3 egress 1/3-4
取消镜像
Harbour(config)#interface Ethernet 1/1
Harbour(config)#no mirror
11.4 NetHammerM128(8口)
将端口2、3接收到目的地址为00:11:22:33:44:55的报文镜像到1号口:
Router(config-if-swi)#config mirror to 1
Router(config-if-swi)#config mirror monitor all add 2-3
Router(config-if-swi)#config mirror mode all dest 00:11:22:33:44:55
Router(config-if-swi)#
11.5 港湾5210
Harbour5210(config)#interface Ethernet 1/4
Harbour5210(config-if-eth1/4)#mirro ingress 1/24 egress 1/24
11.6 港湾FLEX HAMMER 5010
Harbour>enable
Password:harbour –默认为harbour
Harbour(config)#config mirroring 1 to 5
Harbour(config)#config mirroring 1 add port 6 (or 6-10) egress
Harbour(config)#config mirroring 1 add port 6 (or 6-10) ingress
Harbour(config)#show mirror
12、DELL
交换机
12.1 DELL 5224
Console#conf
Console(config)#interface Ethernet 1/19 –镜像口
Console(config-if)#port monitor Ethernet 1/7 tx –被镜像口{tx、rx、both}
Console#show port moni –查看镜像
Console(config)#interface Ethernet 1/19 –删除镜像
Console(config-if)#no port monitor Ethernet 1/7 –删除镜像
13、NetCore
交换机
进入NetCore超级终端->主菜单中输入5进入端口镜像设置->输入1设置镜像端口状态
配置命令如下:
1、选择配置的选项(1.off,2.Rx,3.Tx,4.Both): 4
2、选择捕获端口:1
3、选择被镜像端口:8
注:NETGEAR 增强型智能交换机有Web设置界面(在Monitoring选项卡中)
14
、中兴交换机
14.1 2826/2826E/2618
Zte(cfg)#set mirror add port 1,16 –添加被镜像端口
Zte(cfg)#set mirror monitorport 24 –设置监听端口
Zte(cfg)#set mirror type ingress –设置监听类型{ingress | egress | all}
Zte(cfg)#set mirror enable –开启镜像
Zte(cfg)#show mirror –查看镜像
Zte(cfg)#set mirror delete port 1,16 –删除被镜像口
Zte(cfg)#set mirror disable –关闭镜像
14.2 T16S/T16C/T32C/T64C
Port mirroring monitor-port <port number> target-port <port list>|target-profile <acl name>
注:不支持端口对端口的镜像,只支持对整个WAN卡配置端口镜像
14.3 T160G/T64G
ZXR10(config)#interface gei_1/1 –被镜像口(rx)
ZXR10(config-if)#monitor session 1 source direction rx
ZXR10(config)interface gei_1/2 –被镜像口(both)
ZXR10(config-if)#monitor session 1 source
ZXR10(config)#interface gei_3/3 –监控口
ZXR10(config-if)#monitor session 1 destination
ZXR10(config)#show monitor session 1
注:最多支持8组镜像,每组最多支持8个被镜像口
15、Extreme
交换机
E
xtreme 4.1 及以上版本
{enable | disable} mirroring on port
Configure mirroring{add | delete}{vlan | port}
Extreme 4.1 以下版本
enable mirror to port 1 –镜像口
config mirror add port 3 –被镜像口{port | vlan}
disable mirror –关闭镜像
config mirror del 3 –取消对该端口镜像{port| vlan}
show mirror –显示镜像设置
16、Foundry
交换机
Interface port monitor{{rx | tx | both}}
17、Juniper
交换机
17.1 Juniper M系列/T 系列
User@route# show forwarding-options port-mirroring{input{family inet;rate ; run-length ;}
output interface | {next-hop;}no-filter-check;}}
注:端口镜像的风险,加重交换机负载,造成设备不稳定,在某些情况下会对包;比如,
由于多个源端口镜像到一个目的端口,目的端口无法处理造成丢包
18
、凯创交换机
19
、神州数码交换机
19.1 3526S/3926S
Switch(Config)#monitor session 1 source interface e 1,2-4 tx –{tx,rx,both}
Switch(Config)#monitor session 1 destination interface eth 25
注:3029端口书写为0/0/25
20
、安耐特交换机
Set switch port=1-23 mirror=both –被镜像口
Set switch mirror=24 –监控口
Enable swith mirror
21、HP
交换机
21.1 HP 2650
HP_2650(eth-2)#monitor –设为被镜像
HP_2650(config)#mirror-port 20 –设为镜像
21.2 HP 1600/4000/8000
在console管理模式->Switch Configuration->Network Monitoring Port
配置命令如下:
Monitoring Enabled[NO]:Yes
Monitoring Port: A1
Monitor:VLAN
VLAN: Red_VLAN –将被镜像的端口放入该VLAN中
22
、联想交换机
22.1 iSpirit 3524G/F
Switch#mirror
Mirror Mode 2
Mirror Port:8 –监控口
Egress ports_list:1 –被监控出口
Ingress ports_list:1 –被监控入口
22.2 iSpirit 4504
Switch# mirror port 1/4
MirrorMode 2
Switch#mirror egress 1/1
Switch#mirror ingress 1/1
Switch#show mirror
22.3 iSpirit 4508
Switch#monitor session 1 source 8/1 destination 8/32
注:该交换机镜像配置不能保存到配置文件中
22.4 iSpirit 6800
开启镜像:Enable mirroring
镜像配置
configure mirroring add [<mac_address> | vlan <vlan name> {ports <port number>} | ports
< portnumber> {vlan <vlan name>}]
例:configure mirroring add ports 3:1 vlan1 default 将vla1的数据镜像到第3个插槽的
1号口
关闭镜像功能:Disable mirroring
22.5 iSpirit8805
Switch(config-ge1/1)#mirror interface ge1/12 direction both –{both | receive | transmit}
Switch(config-ge1/1)#

思朋简介
联系我们
官方微博
思朋特色
服务宗旨
企业服务
商务合作
企业运维

Copyright 2023 江苏思朋信息科技有限公司 版权所有 技术支持:星度网络 苏ICP备2021003433号-2

地址:苏州市吴中区石湖西路188号万达广场西楼(苏州大学国家大学科技园吴中分园)19楼1902室(吴中万达1号门附近) 咨询热线:0512-80682876