各型號交換機端口鏡像配置方法和命令

 
  
"Port Mirror"即端口鏡像,端口鏡像爲網絡傳輸提供了備份通道。此外,還可以用於進行數據流量監測。可以這樣理解:在端口A和端口B之間建立鏡像關係,這樣,通過端口A傳輸的數據將同時通過端口B傳輸,即使端口A處因傳輸線路等問題造成數據錯誤,還有端口B處的數據是可用的。
Cisco交換機端口鏡像配置
cisco交換機最多支持2組鏡像,支持所有端口鏡像。默認密碼cisco
Cisco catylist2820
有2個菜單選項
先進入menu選項,enable port monitor
進入cli模式,
en
conf term
interface fast0/x 鏡像口
port monitor fast0/x 被鏡像口
exit
wr
Cisco catylist2924、2948 Cisco catylist 3524、3548
Switch>En
Switch#Conf term
Switch(config)#Interface fast mod/port
Switch(config-if)#Port monitor mod/port
Switch(config-if)#Exit
Switch(config)#Wr


Cisco catylist 2550 Cisco catylist 3550
支持2組monitor session
en password
config term
Switch(config)#monitor session 1 destination interface fast0/4(1爲session id,id範圍爲1-2)
Switch(config)#monitor session 1 source interface fast0/1 , fast0/2 , fast0/3 (空格,逗號,空格)
Switch(config)#exit
Switch#copy running-conf startup-conf
Switch#show port-monitor
Cisco catylist 4000/5000系列 Cisco catylist 6000 系列
支持2組鏡像
En
Show module (確認端口所在的模塊)
Set span source(mod/port) destination(mod/port) in|out|both inpkts enable
Write tern all
Show span
注:多個source:mod/port,mod/port-mod/port 連續端口用橫杆“-”,非連續端口用逗號“,”
set span enable 允許鏡像
set span disable 禁止鏡像
set span source destination in|out|both inpkts enable create (create用於建立第二組鏡像)


Huawei(華爲)s2403h端口監聽配置
en
conf term
monitor ethernet source_mod/port to ethernet source_mod/port obser ethernet dest_mod/port
exit
write
show monitor-port
注:不可以將非連續端口作爲souce,如果鏡像單個端口,則不用to,直接到obs ether。。。。。
刪除鏡像
en
conf t
no monitort ethernet 源 to enternet 源 obser enternet 目的
exit
show monitor-port
write
huawei 6500
S6506_A>en
Password:
S6506_A#
S6506_A#conf t
Enter configuration commands, one per line. End with Ctrl+Z.
S6506_A(config)#
S6506_A(config)#set mirr WORD1 input GigabitEthernet1/0/3 GigabitEthernet1/0/4 mirror-port GigabitEthernet1/0/6
S6506_A(config)#exit
S6506_A#show mirror all
mirror name: WORD1
slot no: 1/0
port mask: gigabitethernet1/0/3 gigabitethernet1/0/4
mirror direction:input
mirror port: gigabitethernet1/0/6
Nortel 交換機
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


Nortel 8000 series 端口鏡像配置
Software 3.2.0.0以前的版本,支持一組鏡像,10個source,一個destination
Software 3.2.0.0後的版本,支持2組鏡像,(說明:通常8個ethernet口爲一個電路集成板,destination不可以在同一個板子上,即1-8口上只允許有一個destination),支持25個source(10個有效―――不懂,沒有玩過這麼高的版本)。
用戶名/密碼:rwa/rwa 超級用戶
例如:2/6 2/6 2/8 鏡像到2/1
config diag mirror-by-port 1 create in-port 2/4 out-port 2/1 (1是id號,範圍1-10)
config diag mirror-by-port 1 enable ture
config diag mirror-by-port 2 create in-port 2/6 out-port 2/1
config diag mirror-by-port 2 enable ture
config diag mirror-by-port 3 create in-port 2/8 out-port 2/1
config diag mirror-by-port 3 enable ture
config diag mirror-by-port 1 mode both|tx|rx
save config
diag mirror-by-port id info (查看第id號鏡像信息)
Nortel 交換機提供的鏡像功能通常是rx的,不支持both方式(看cpu而定),所以ping包檢測不到,只能檢測到ping回答。 ?
Bay stack 450
Very easy,只要安裝菜單按部就班。只支持2個source和1個destination。交換機軟件版本3以上。
***8000
*** Command Line Interface Reference Manual 551
port mirroring
Command
Purpose
Apply port mirroring to one or more target ports on an *** or to traffic specified by an
ACL profile.
Format
port mirroring monitor-port target-port |target-profile name>
Mode
Configure
Description
The port mirroring command allows you to monitor via a single port the activity of one
or more ports on an *** or the traffic that is specified by an ACL.
Parameters
monitor-port
The port you will use to monitor activity.
target-port
The port(s) for which you want to monitor activity. You can specify a single port or a
comma-separated list of ports.
target-profile
The name of the ACL that specifies the profile of the traffic that you want to
monitor. The ACL must be a previously created IP ACL. The ACL may contain
either permit or deny keywords. The port mirroring command only looks at the
following ACL rule parameter values: protocol, source IP address, destination IP
address, source port, destination port, and TOS.


3COM交換機端口鏡像配置
在3COM交換機中,端口鏡像被稱爲“Roving Analysis”。網絡流量被監聽的端口稱作“監聽口”(Monitor Port),連接監聽設備的端口稱作“分析口”(Analyzer Port)。
以下命令配置端口鏡像:
● 指定分析口
feature rovingAnalysis add,或縮寫 f r a,
例如:
Select menu option: feature rovingAnalysis add
Select analysis slot: 1
Select analysis port: 2
● 指定監聽口並啓動端口監聽
feature rovingAnalysis start,或縮寫 f r sta,
例如:
Select menu option: feature rovingAnalysis start
Select slot to monitor (1-12): 1
Select port to monitor (1-8): 3
● 停止端口監聽
feature rovingAnalysis stop,或縮寫 f r sto,

Intel交換機端口鏡像配置
Intel稱端口監聽爲“Mirror Ports”。 網絡流量被監聽的端口稱作“源端口”(Source Port),連接監聽設備的端口稱作“鏡像口”(Mirror Port)。
配置端口監聽步驟如下:
● 在navigation菜單,點擊Statistics下的Mirror Ports,彈出Mirror Ports信息。
● 在Configure Source 列中點擊端口來選擇源端口,彈出Mirror Ports Configuration。
● 進行源端口設置:
源端口是鏡像流量的來源口,鏡像口是接收來自源端口流量的端口。
● 點擊Apply確定
可以選擇三種監聽的方式:
1.連續(Always):鏡像全部流量。
2.週期(Periodic):在一定週期內鏡像全部流量。鏡像週期在Sampling Interval configuration中設置。
3.禁止(Disabled):關閉流量鏡像。

Avaya交換機端口鏡像配置
在Avaya交換機用戶手冊中,端口監聽被稱爲“端口鏡像”(Port Mirror)。
以下命令配置端口監聽:
{ set|clear } Port Mirror
設置端口偵聽:set port mirror source-port mirror-port sampling { always | disable | periodic } [ max-packets-sec < max-packets-sec-value> ] [ piggyback-port ]
禁止端口監聽:clear port mirror
命令中,mod-port-range指定端口的範圍;mod-port-spec指定特定的端口;piggyback-port指定雙向鏡像的端口;sampling指定鏡像週期;max-packets-sec僅在sampling設置爲periodic時使用,指定監聽口每秒最多的數據報數量。


港灣flax24
Harbour(config)#
Harbour(config)# config mirroring 1
add Add ports to mirroring group.
delete Delete ports from mirroring group.
disable Disable current mirroring group.
to Apply port mirroring group.
Harbour(config)# config mirroring 1 add port 5  (source)
Harbour(config)# config mirroring 1 to 13    (target)
Harbour(config)# show mirroring
Port Mirror Configurations:
Mirroring Group 1:
Source Port: 5
Target Port: 13
Harbour(config)# save configuration



Cisco交換機端口鏡像配置
Catalyst 2900XL/3500XL/2950系列交換機端口鏡像配置
以下命令配置端口監聽:
port monitor
例如,F0/1和F0/2、F0/2同屬VLAN1,F0/1監聽F0/2、F0/2端口:
interface FastEthernet0/1
port monitor FastEthernet0/2
port monitor FastEthernet0/5
port monitor VLAN1

Catalyst 4000,5000,and 6000系列交換機端口鏡像配置

以下命令配置端口監聽:
set span
例如,模塊6中端口1和端口2同屬VLAN1,端口3在VLAN2,端口4和5在VLAN2,端口2監聽端口1和3、4、5,
set span 6/1,6/3-5 6/2
以下命令禁止端口監聽:
set span disable [dest_mod/dest_port|all]
cisco 3550 emi 端口鏡像配置:
在配置模式進行配置
monitor session 1 source interface Fa0/15
monitor session 1 destination interface Fa0/14
註釋:15端口是源端口(接外網的端口),14端口是監視端口(安裝上網管理軟件的電腦接在該端口

華爲交換機端口鏡像配置

端口鏡像的數據流程
基於端口的鏡像是把被鏡像端口的進出數據報文完全拷貝一份到鏡像端口,這樣來進行流量觀測或者故障定位。
【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]acl num 101
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 101 interface e0/8
〖基於二層流的鏡像〗
1. 定義一個ACL
[SwitchA]acl num 200
2. 定義一個規則從E0/1發送至其它所有端口的數據包
[SwitchA]rule 0 permit ingress interface Ethernet0/1 (egress interface any)
3. 定義一個規則從其它所有端口到E0/1端口的數據包
[SwitchA]rule 1 permit (ingress interface any) egress interface Ethernet0/1
4. 將符合上述ACL的數據包鏡像到E0/8
[SwitchA]mirrored-to link-group 200 interface e0/8
【5516】支持對入端口流量進行鏡像
配置端口Ethernet 3/0/1爲監測端口,對Ethernet 3/0/2端口的入流量鏡像。
[SwitchA]mirror Ethernet 3/0/2 ingress-to Ethernet 3/0/1
【6506/6503/6506R】
目前該三款產品只支持對入端口流量進行鏡像,雖然有outbount參數,但是無法配置。
鏡像組名爲1,監測端口爲Ethernet4/0/2,端口Ethernet4/0/1的入流量被鏡像。
[SwitchA]mirroring-group 1 inbound Ethernet4/0/1 mirrored-to Ethernet4/0/2
【補充說明】
1. 鏡像一般都可以實現高速率端口鏡像低速率端口,例如1000M端口可以鏡像100M端口,反之則無法實現
2. 8016支持跨單板端口鏡像
3 測試驗證
在觀測端口上通過工具軟件可以看到被鏡像端口的相應的報文,可以進行流量觀測或者故障定位。

3COM交換機端口監聽配置
在3COM交換機用戶手冊中,端口監聽被稱爲“Roving Analysis”。網絡流量被監聽的端口稱作“監聽口”(Monitor Port),連接監聽設備的端口稱作“分析口”(Analyzer Port)。
以下命令配置端口監聽:
● 指定分析口
feature rovingAnalysis add,或縮寫 f r a,
例如:
Select menu option: feature rovingAnalysis add
Select analysis slot: 1
Select analysis port: 2
● 指定監聽口並啓動端口監聽
feature rovingAnalysis start,或縮寫 f r sta,
例如:
Select menu option: feature rovingAnalysis start
Select slot to monitor (1-12): 1
Select port to monitor (1-8): 3
● 停止端口監聽
feature rovingAnalysis stop,或縮寫 f r sto,
● 刪除分析口並還原其狀態
feature rovingAnalysis remove,或者使用縮寫 f r r,
使用此命令之前需執行停止端口監聽命令。
● 查看分析口和監聽口的設置:
feature rovingAnalysis summary,或者使用縮寫 f r su,
例如:
Select menu option: feature rovingAnalysis summary
Monitor port Analysis port State
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Slot 3 Port 5 Slot1 Port2 Enabled
Intel交換機端口鏡像配置
Intel稱端口監聽爲“Mirror Ports”。 網絡流量被監聽的端口稱作“源端口”(Source Port),連接監聽設備的端口稱作“鏡像口”(Mirror Port)。
以下步驟配置端口鏡像:
在navigation菜單,點擊Statistics下的Mirror Ports,彈出Mirror Ports信息。
在Configure Source 列中點擊端口來選擇源端口,彈出Mirror Ports Configuration。
進行源端口設置:
源端口是鏡像流量的來源口,鏡像口是接收來自源端口流量的端口。
點擊Apply確定
可以選擇三種監聽的方式:
1.連續(Always):鏡像全部流量。
2.週期(Periodic):在一定週期內鏡像全部流量。鏡像週期在Sampling Interval configuration中設置。
3.禁止(Disabled):關閉流量鏡像。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章