- 論壇徽章:
- 0
|
Cisco CATALYST交換機(jī)端口監(jiān)聽配置
Cisco CATALYST交換機(jī)分為兩 種,在CATALYST家族中稱偵聽端口為分析端 口(analysis port)。
1、Catalyst 2900XL/3500XL/2950系列交換機(jī)端口監(jiān)聽配 置 (基于CLI)
以下命令配置端口監(jiān)聽:
port monitor
例 如,F(xiàn)0/1和F0/2、F0/3同屬VLAN1,F(xiàn)0/1監(jiān)聽F0/2、F0/3端口:
interface FastEthernet0/1
port monitor FastEthernet0/2
port monitor FastEthernet0/3
port monitor VLAN1
2、Catalyst 4000,5000 and 6000系列交換機(jī)端口監(jiān)聽配 置 (基于IOS)
以下命令配置端口監(jiān)聽:
set span
例如,模塊1中端口1和端口2同屬VLAN1,端口3在VLAN2,端口4和5在VLAN2,端口2監(jiān)聽端 口1和3、4、5,
set span 1/1,1/3-5 1/2
3COM交換機(jī)端口監(jiān)聽配置
在3COM交換機(jī)中,端口監(jiān)聽被稱為“Roving Analysis”。 網(wǎng)絡(luò)流量被監(jiān)聽的端口稱作“監(jiān)聽口”(Monitor Port),連接監(jiān)聽設(shè)備的端口稱作“分析 口”(Analyzer Port)。
以下命令配置端口監(jiān)聽:
● 指定分析 口
feature rovingAnalysis add,或縮 寫 f r a,
例 如:
Select menu option: feature rovingAn alysis add
Select analysis slot: 1?& nbsp;
Select analysis port: 2
● 指定監(jiān)聽口并啟動端口監(jiān)聽
feature rovingAnalysis start,或縮 寫 f r sta,
例 如:
Select menu option: feature rovingAn alysis start
Select slot to monitor ?(1-12): 1
Select port to monitor&nb sp;?(1-8): 3
● 停止端口監(jiān) 聽
feature rovingAnalysis stop,或縮 寫 f r sto,
Intel交換機(jī)端口監(jiān)聽配置
Intel 稱端口監(jiān)聽為“Mirror Ports”。 網(wǎng)絡(luò)流量被監(jiān)聽的端口稱作“源端 口”(Source Port),連接監(jiān)聽設(shè)備的端口稱作“鏡像 口”(Mirror Port)。
配置端口監(jiān)聽步驟如下:
● 在 navigation菜單,點擊Statistics下的Mirror Ports,彈出Mirror Ports信 息。
● 在Configure Source 列中點擊端口來選擇源端口, 彈出Mirror Ports Configuration。
● 進(jìn)行源端口設(shè) 置:
源端口是鏡像流量的來源口,鏡像口是接收來自源端口流量的端 口。
● 點擊Apply確定
可以選擇三種監(jiān)聽的方 式:
1.連續(xù)(Always):鏡像全部流量。
2.周期(Periodic):在一定周期內(nèi) 鏡像全部流量。鏡像周期在Sampling Interval configuration中設(shè)置。
3 .禁止(Disabled):關(guān)閉流量鏡像。
Avaya交換機(jī)端口監(jiān)聽配置
在Avaya交換機(jī)用戶手冊中,端口監(jiān) 聽被稱為“端口鏡像”(Port Mirror)。
以下命令配置端口監(jiān)聽:
{ set|clear } Port Mirror
設(shè)置端口偵 聽:set port mirror source-port&n bsp;? mirror-port sampling { always | disable | periodic } [ max-packets-sec ?& nbsp;] [ piggyback-port ]?&nb sp;
禁止端口監(jiān) 聽:clear port mirror
命令 中,mod-port-range指定端口的范圍;mod-port-spec指定特定的端口;piggyback-port指定雙向鏡像的端 口;sampling指定鏡像周期;max-packets-sec僅在sampling設(shè)置為periodic時使用,指定監(jiān)聽口每秒最多的數(shù)據(jù)報數(shù) 量。
華為交換機(jī)端口監(jiān)聽配置
華為交換機(jī)用戶手冊中,端口監(jiān)聽被稱為“端口鏡 像”(Port Mirroring)。
使用Huawei Lanswitch View管 理系統(tǒng)添加一個鏡像端口:
● 選 擇Device Setup或Stack Setup。
● 點 擊Port Mirroring。
● 點擊Add按 鈕。
● 對于堆疊,點擊Switch并從列表選擇一個交換 機(jī)。
● 點擊Reflect from并選擇流量將被鏡像的端 口。
● 點擊Reflect to并選上面所選擇的端口上的
港灣
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
Harbour(config)# config mirroring 1 to 13
Harbour(config)# show mirroring
Port Mirror Configurations:
Mirroring Group 1:
Source Port: 5
Target Port: 13
Harbour(config)# save configuration
Juniper
Juniper M 系列和 T 系列端口鏡像配置方法
[email=usen@router]usen@router[/email]
# show forwarding-options port-mirroring { input {family inet; rate ; run- length ;} output interface {next-hop;} no-filter-check;} }
選擇將抽樣的流量發(fā)送到哪個目的端口
[email=user@router]user@router[/email]
# show firewall filter mirror-sample from {...} then {sample; accept;}
定義抽樣過濾器,選擇感興趣的流量
[email=user@router]user@router[/email]
# show interface unit 0 family inet filter {input mirror-sample;}
選擇將抽樣的過濾器應(yīng)用到某個端口
端口鏡像的風(fēng)險
加重交換機(jī)負(fù)載,造成設(shè)備不穩(wěn)定
在某些情況下會丟包,不能保證 100% 鏡像流量。例如,由于多個源端口鏡像到一個目的端口,目的端口無法處理造成丟包
Nortel 8000
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 交換機(jī)提供的鏡像功能通常是rx的,不支持both方式(看cpu而定),所以ping包檢測不到,只能檢測到ping回答。 ?
Bay stack 450
Very easy,只要安裝菜單按部就班。只支持2個source和1個destination。交換機(jī)軟件版本3以上。
Ssr8000
SSR Command Line Interface Reference Manual 551
port mirroring
Command
Purpose
Apply port mirroring to one or more target ports on an SSR 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 SSR 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.
DELL
鏡像端口設(shè)置方法:
在交換機(jī)管理界面左邊的樹形菜單中,選中“Switch”(交換機(jī))>>>“Ports”(端口)>>>“Port Mirroring”(端口鏡像),右邊將打開“Port Mirroring”(端口鏡像)頁面。該頁面中的參數(shù)解釋如下:
Add(添加):添加端口鏡像操作
Destination Port(目的地端口):定義端口通信要鏡像到的端口號;
Source Port(源端口):定義被鏡像端口的端口號。 最多可以將8個被鏡像端口鏡像到一個鏡像端口;
Type(類型):指定要鏡像的端口通信類型。 可能的字段值包括:“RX”-表示鏡像進(jìn)入網(wǎng)絡(luò)的數(shù)據(jù);“TX”-表示鏡像流出網(wǎng)絡(luò)的數(shù)據(jù);Both()-表示鏡像所有數(shù)據(jù)。
Status(狀態(tài)):表示端口的狀態(tài)。 可能的字段值包括: “Active”-表示端口被啟用;“Not Active”-表示端口被禁用。
Remove(刪除):刪除端口鏡像會話。 可能的字段值包括: “已選取”-刪除端口鏡像會話;“未選取”-保留端口鏡像會話。
具體端口鏡像設(shè)置:
。、在Port Mirroring對話框中的Destination Port中選中目的端口(鏡像端口),再單擊Add按鈕;
。病⒃谙到y(tǒng)將打開“Add Source Port”(添加源端口)頁面中,定義“Source Port”(源端口)和“Type”(類型)字段,并單擊“Apply Changes”(應(yīng)用更改), 使系統(tǒng)接收更改。
。ㄗⅲ喝绻枰獜亩丝阽R像會話刪除副本端口,請打開“Port Mirroring”(端口鏡像)頁面,選取“Remove”(刪除)復(fù)選框,再單擊“Apply Changes”(應(yīng)用更改)。 系統(tǒng)將刪除端口鏡像會話,并更新設(shè)備。)
以下是 CLI 命令實例:
Console(config)# interface ethernet 1/e1
Console(config-if)# port monitor 1/e8
Console# show ports monitor
Source port Destination Port Type Status
----------- ---------------- ----- -------
1/e1 1/e8 RX, TX Active
華為交換機(jī)端口鏡像配置全系列!
【3026等交換機(jī)鏡像】
S2008/S2016/S2026/S2403H/S3026等交換機(jī)支持的都是基于端口的鏡像,有兩種方法:
方法一
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交換機(jī)端口鏡像配置】
1. 假設(shè)8016交換機(jī)鏡像端口為E1/0/15,被鏡像端口為E1/0/0,設(shè)置端口1/0/15為端口鏡像的觀測端口。
[SwitchA] port monitor ethernet 1/0/15
2. 設(shè)置端口1/0/0為被鏡像端口,對其輸入輸出數(shù)據(jù)都進(jìn)行鏡像。
[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15
也可以通過兩個不同的端口,對輸入和輸出的數(shù)據(jù)分別鏡像
1. 設(shè)置E1/0/15和E2/0/0為鏡像(觀測)端口
[SwitchA] port monitor ethernet 1/0/15
2. 設(shè)置端口1/0/0為被鏡像端口,分別使用E1/0/15和E2/0/0對輸入和輸出數(shù)據(jù)進(jìn)行鏡像。
[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15
[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0
『基于流鏡像的數(shù)據(jù)流程』
基于流鏡像的交換機(jī)針對某些流進(jìn)行鏡像,每個連接都有兩個方向的數(shù)據(jù)流,對于交換機(jī)來說這兩個數(shù)據(jù)流是要分開鏡像的。
【3500/3026E/3026F/3050】
〖基于三層流的鏡像〗
1. 定義一條擴(kuò)展訪問控制列表
[SwitchA]acl num 101
2. 定義一條規(guī)則報文源地址為1.1.1.1/32去往所有目的地址
[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any
3. 定義一條規(guī)則報文源地址為所有源地址目的地址為1.1.1.1/32
[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0
4. 將符合上述ACL規(guī)則的報文鏡像到E0/8端口
[SwitchA]mirrored-to ip-group 101 interface e0/8
〖基于二層流的鏡像〗
1. 定義一個ACL
[SwitchA]acl num 200
2. 定義一個規(guī)則從E0/1發(fā)送至其它所有端口的數(shù)據(jù)包
[SwitchA]rule 0 permit ingress interface Ethernet0/1 (egress interface any)
3. 定義一個規(guī)則從其它所有端口到E0/1端口的數(shù)據(jù)包
[SwitchA]rule 1 permit (ingress interface any) egress interface Ethernet0/1
4. 將符合上述ACL的數(shù)據(jù)包鏡像到E0/8
[SwitchA]mirrored-to link-group 200 interface e0/8
【5516】支持對入端口流量進(jìn)行鏡像
配置端口Ethernet 3/0/1為監(jiān)測端口,對Ethernet 3/0/2端口的入流量鏡像。
[SwitchA]mirror Ethernet 3/0/2 ingress-to Ethernet 3/0/1
【6506/6503/6506R】
鏡像組名為1,監(jiān)測端口為Ethernet4/0/2,端口Ethernet4/0/1的入流量被鏡像。
[SwitchA]mirroring-group 1 inbound Ethernet4/0/1 mirrored-to Ethernet4/0/2
【補(bǔ)充說明】
1. 鏡像一般都可以實現(xiàn)高速率端口鏡像低速率端口,例如1000M端口可以鏡像100M端口,反之則無法實現(xiàn)
2. 8016支持跨單板端口鏡像
3 測試驗證
在觀測端口上通過工具軟件可以看到被鏡像端口的相應(yīng)的報文,可以進(jìn)行流量觀測或者故障定位。
Catalyst 2950 3550不支持port monitor
C2950#configure terminal
C2950(config)#
C2950(config)#monitor session 1 source interface fastEthernet 0/2
!--- Interface fa 0/2 is configured as source port.
C2950(config)#monitor session 1 destination interface fastEthernet 0/3
!--- Interface fa0/3 is configured as destination port.
2950/3550/3750
格式如下:
#monitor session number source interface mod_number/port_number both
#monitor session number destination interface mod_mnumber/port_number
//rx-->指明是進(jìn)端口得流量,tx-->出端口得流量 both 進(jìn)出得流量
for example:
第一條鏡像,將第一模塊中的源端口為1-10的鏡像到端口12上面;
#monitor session 1 source interface 1/1-10 both
#monitor session 1 destination interface 1/12
第二條鏡像,將第二模塊中的源端口為13-20的鏡像到端口24上面;
#monitor session 2 source interface 2/13-20 both
#monitor session 2 destination interface 2/24
當(dāng)有多條鏡像、多個模塊時改變其中的參數(shù)即可。
神碼的DCR-7500
-----定義鏡像端口 mir -----
命令:[no] mirror-port ethernet
功能:激活鏡像端口
命令模式:特權(quán)配置模式
參數(shù):為鏡像端口的端口號
-----------------------------
-------激活被鏡像端口----------
命令:[no] monitor ethernet [ethernet...] both|in|out
功能:激活被鏡像的端口的鏡像功能
命令模式:端口配置模式
參數(shù):為鏡像端口的端口號;both|in|out 分別代表雙向流量,輸入流量,輸出流量
-------------------------------------
我來舉個例子
DCRS-7500(config)#mirror-port etherent 4/1
DCRS-7500(config)#interface ethernet 4/3
DCRS-7500(config)#monitor ethernet 4/1 both
上述命令將端口4/3上的雙向流量鏡像到端口4/1,用戶可以在4/1外接協(xié)議分析儀來查看端口4/3的流量信息.
Quidway S5024P交換機(jī)
具體配置:
以24端口為監(jiān)控端口、1端口為上行路由器端口、2和3端口為空閑端口為例,參考配置如下
sys
Enter system view, return to user view with Ctrl+Z.
[Quidway]vlan 2
[Quidway-Vlan2]port g0/2 to g0/3
[Quidway-Vlan2]q
[Quidway]dis vlan 2
VLAN ID: 2
Route Interface: not configured
Tagged Ports: none
Untagged Ports:
GigabitEthernet0/2 GigabitEthernet0/3
[Quidway]monitor-port g0/24
[Quidway]mirroring-port g0/2 to g0/3
[Quidway]dis mir
Monitor-port:
GigabitEthernet0/24
Mirroring-port:
GigabitEthernet0/2 GigabitEthernet0/3
[Quidway]q
save
This will save the configuration in the EEPROM memory
Are you sure?[Y/N]y
Now saving current configuration to EEPROM memory
Please wait for a while...
Current configuration saved to EEPROM memory successfully
配置完成后,保存將1端口通過普通網(wǎng)線連接2端口,3端口連接上行的路由器,24端口連接日志主機(jī)即可。
四 配置關(guān)鍵點:
S5024P需要兩個多余的端口B和C,劃分為VLAN 2。將原連接路由器的A端口直接連接B端口,C端口再連接路由器。而端口C均設(shè)置為被監(jiān)控端口。
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u1/33629/showart_417908.html |
|