-
交换机端口镜像配置大全【汇集
22
个各种品牌
交换机】
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
fitervlan 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
将
p>
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
的所有
(
出
/
入
)
p>
的业务流进行监控。
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]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]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]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]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
、
s
ummary
)
4.2 3com
3500/3026E/3026F/3050/S3526
[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
交换机