全发国际

620 点全场景落地 丨 半导体大厂熙泰科技的云桌面安全与提效实战分享
预约直播
铸数基 · 智运维 丨 全发国际乐享3.0智能运维解决规划颁布会
预约直播
全发国际(中国)有限公司官网
产品
< 返回主菜单
产品中心
产品
解决规划
< 返回主菜单
解决规划中心
行业
合作同伴
返回主菜单
选择区域/说话
全发国际(中国)有限公司官网

您订阅的产品有更新, ,,,,,,,请实时查阅

查看详情

镜像是什么, ,,,,,,,若何配置? ??????

颁布功夫:2023-03-24
点击量:1706

镜像职能介绍

镜像职能概述

随着网络的发展, ,,,,,,,对网络的高可用性的要求日益提高。。。。 。当网络出现异常时, ,,,,,,,必要对网络节点或者设备的端口进行了数据流量分析以便网络可能急剧复原正常, ,,,,,,,但同时又要求不影响设备数据流量的正常转发。。。。 。

镜像是将指定端口的报文复造到另一个衔接有网络监测设备的端口的职能, ,,,,,,,实现了对可疑的网络节点或者设备端口进行数据流量分析, ,,,,,,,同时又不影响被监控设备的数据转发。。。。 。镜像职能重要利用在网络监控和故障排查两种场景中, ,,,,,,,实现了监控网络信息安全和解决网络故障的主张。。。。 。

根基概想

1.    源端口

源端口也称为被监控口, ,,,,,,,源端口上的数据流会被复造一份到主张端口, ,,,,,,,用于网络分析或故障排除。。。。 。

2.    主张端口

主张端口也称为为监控口, ,,,,,,,与监控设备相衔接的端口, ,,,,,,,将接管到的源端口报文转发到监控设备。。。。 。

3.    会话

会话是一个逻辑上的概想, ,,,,,,,一个齐全的会话由源端口和主张端口组成。。。。 。

4.    SPAN

SPANSwitch Port Analyzer, ,,,,,,,互换式端口分析器)也称为本地端口镜像或者本地镜像。。。。 。指统一个镜像会话的源端口与主张端口在统一台设备上的镜像。。。。 。

5.    RSPAN

RSPANRemote Switch Port Analyzer, ,,,,,,,远程端口镜像)是SPAN的扩大, ,,,,,,,源端口和指标端口处于分歧的设备。。。。 。

6.    ERSPAN

ERSPANEncapsulated Remote Switch Port Analyzer, ,,,,,,,封装远程端口镜像)是RSPAN的扩大, ,,,,,,,实现了逾越互换或路由网络的多台设备的远程监控步骤。。。。 。

7.    远程镜像VLAN

远程镜像VLAN是一种特殊的VLAN, ,,,,,,,该VLAN只传输镜像报文, ,,,,,,,不合正常的业务数据进行传输。。。。 。

8.    输出端口

源设备大将镜像报文发送到中央设备或者主张设备的端口称为输出端口。。。。 。

9.    源设备

源设备是远程镜像角色之一, ,,,,,,,指源端口地点的设备, ,,,,,,,掌管将源端口的报文复造一份到源设备的输出端口, ,,,,,,,传输给中央设备主张设备。。。。 。

10.  主张设备

主张设备远程镜像角色之一, ,,,,,,,指远程镜像主张端口地点的设备, ,,,,,,,掌管将中央设备或者源设备接管到的镜像报文转发给监控设备。。。。 。

11.  中央设备

中央设备是远程镜像角色之一, ,,,,,,,指处于源设备和主张设备之间的设备, ,,,,,,,掌管将镜像报文传输给下一个中央设备或主张设备。。。。 。若是源设备与主张设备直接相连, ,,,,,,,则不存在中央设备。。。。 。

12.  镜像数据流

镜像数据流指被镜像的数据报文。。。。 。镜像会话的数据流蕴含以下三种方向的数据流:

l  输入数据流

所有源端口上接管到的报文都将被复造一份到主张端口。。。。 。在一个镜像会话中, ,,,,,,,能够监控一个或多个源端口的输入报文。。。。 。

l  输出数据流

所有从源端口发送的报文都将复造一份到主张端口。。。。 。在一个镜像会话中, ,,,,,,,能够监控一个或多个源端口的输出报文。。。。 。

l  双向数据流

同时蕴含输入数据流和输出数据流。。。。 。在一个镜像会话中, ,,,,,,,可监控一个或多个源端口的输入和输出方向的数据流。。。。 。

典型配置举例

1  SPAN配置举例

1.    组网需要

1-6所示, ,,,,,,,通过适当的配置, ,,,,,,,网络分析仪可能监控DeviceA转发给DeviceB的所罕见据流, ,,,,,,,监控来自DeviceB的特定数据流(如来自PC1PC2的数据流)。。。。 。

2.    组网图

图1-6     SPAN组网图

 

3.    配置重点

l  配置DeviceAGigabitEthernet 0/1GigabitEthernet 0/2属于VLAN 1。。。。 。创建SVI 1, ,,,,,,,并配置SVI 1地址为10.10.10.10/24。。。。 。

l  配置DeviceBGigabitEthernet 0/1属于VLAN 1。。。。 。创建SVI 1, ,,,,,,,并配置SVI 1地址为10.10.10.20/24。。。。 。

l  配置PC1PC2的地址别离为10.10.10.1/2410.10.10.2/24。。。。 。

l  配置DeviceA的本地镜像, ,,,,,,,指定端口GigabitEthernet 0/1GigabitEthernet 0/2别离为镜像的源端口和主张端口。。。。 。监控DeviceA转发给DeviceB的所罕见据流, ,,,,,,,监控来自DeviceB的特定数据流。。。。 。

4.    配置步骤

配置DeviceAGigabitEthernet 0/1GigabitEthernet 0/2属于VLAN 1。。。。 。

DeviceA> enable

DeviceA# configure terminal

DeviceA(config)# vlan 1

DeviceA(config-vlan)# exit

DeviceA上创建SVI 1, ,,,,,,,并配置SVI 1地址为10.10.10.10/24。。。。 。

DeviceA(config)# interface vlan 1

DeviceA(config-if-VLAN 1)# ip address 10.10.10.10 255.255.255.0

DeviceA(config-if-VLAN 1)# exit

配置DeviceBGigabitEthernet 0/1属于VLAN 1。。。。 。

DeviceB# configure

DeviceB(config)# vlan 1

DeviceB(config-vlan)# exit

DeviceB上创建SVI 1, ,,,,,,,并配置SVI 1地址为10.10.10.20/24。。。。 。

DeviceB (config)# interface vlan 1

DeviceB(config-if-VLAN 1)# ip address 10.10.10.20 255.255.255.0

DeviceB(config-if-VLAN 1)# exit

DeviceA上配置ACL, ,,,,,,,匹配源地址为10.10.10.20的报文。。。。 。

DeviceA(config)# access-list 100 permit ip host 10.10.10.20 any

DeviceA上配置端口GigabitEthernet 0/1为镜像的源端口, ,,,,,,,监控DeviceA转发给DeviceB的所罕见据流, ,,,,,,,监控来自DeviceB的特定数据流。。。。 。

DeviceA(config)# monitor session 1 source interface gigabitethernet 0/1 tx

DeviceA(config)# monitor session 1 source interface gigabitethernet 0/1 rx acl 100

DeviceA上配置GigabitEthernet 0/2为镜像的主张端口。。。。 。

DeviceA(config)# monitor session 1 destination interface gigabitethernet 0/2

5.    验证配置了局

通过show monitor号令查看镜像是否正确配置。。。。 。

DeviceA# show monitor

sess-num: 1

span-type: LOCAL_SPAN

src-intf:

 GigabitEthernet 0/1     frame-type TX Only

src-intf:

 GigabitEthernet 0/1     frame-type RX Only

rx acl id 100

dest-intf:

 GigabitEthernet 0/2

6.    配置文件

l  DeviceA的配置文件

hostname DeviceA

!

ip access-list extended 100

 10 permit ip host 10.10.10.20 any

!

interface VLAN 1

 ip address 10.10.10.10 255.255.255.0

!

monitor session 1 destination interface GigabitEthernet 0/2

monitor session 1 source interface GigabitEthernet 0/1 tx

monitor session 1 source interface GigabitEthernet 0/1 rx acl 100

!

end

l  DeviceB的配置文件

hostname DeviceB

!

interface VLAN 1

 ip address 10.10.10.20 255.255.255.0

!

end

2  基于RSPAN实现的一对多镜像职能配置举例

*    忠告

当部署一对多端口镜像时, ,,,,,,,必须使用switchport trunk allowed vlan remove vlan-list号令裁剪掉各镜像设备上trunk类型的接口中广播的VLAN, ,,,,,,,不然trunk接口可能会被广播的流量占满导致业务中断。。。。 。

 

1.    组网需要

1-7所示, ,,,,,,,网络分析仪能够通过远程镜像职能, ,,,,,,,实此刻主张设备DeviceBDeviceC上监控源设备DeviceA上的双向数据流。。。。 。且设备之间均能正常互换数据。。。。 。

2.    组网图

图1-7     基于RSPAN实现的一对多镜像职能网图

 

3.    配置重点

l  配置DeviceA为源设备, ,,,,,,,配置远程镜像VLAN, ,,,,,,,配置端口GigabitEthernet 0/1为源端口, ,,,,,,,与主张设备相连的端口GigabitEthernet 0/3GigabitEthernet 0/4为输出端口, ,,,,,,,配置GigabitEthernet 0/2接口为MAC回环口, ,,,,,,,用于实现一对多镜像的“反射”职能。。。。 。配置输出端口可互换职能。。。。 。

l  DeviceBDeviceC配置为主张设备, ,,,,,,,配置远程镜像VLAN, ,,,,,,,与源设备相连的端口GigabitEthernet 0/1作为源端口, ,,,,,,,配置Trunk端口, ,,,,,,,与网络分析仪相连的端口GigabitEthernet 0/2配置为镜像主张端口, ,,,,,,,并配置镜像主张端口可互换职能。。。。 。

4.    配置步骤

配置DeviceA为源设备。。。。 。

(1)   配置远程VLAN。。。。 。

DeviceA> enable

DeviceA# configure terminal

DeviceA(config)# vlan 7

DeviceA(config-vlan)# remote-span

DeviceA(config-vlan)# exit

(2)   配置源端口。。。。 。

DeviceA(config)# monitor session 1 remote-source

DeviceA(config)# monitor session 1 source interface gigabitethernet 0/1 both

(3)   配置输出端口。。。。 。

DeviceA(config)# monitor session 1 destination remote vlan 7 interface gigabitethernet 0/2 switch

(4)   配置回环口。。。。 。

DeviceA(config)# interface gigabitethernet 0/2

DeviceA(config-if)# mac-loopback

DeviceA(config-if)# switchport access vlan 7

DeviceA(config-if)# exit

DeviceA(config)# interface range gigabitethernet 0/3-4

DeviceA(config-if-range)# switchport mode trunk

配置DeviceB为主张设备。。。。 。

(1)   配置远程VLAN。。。。 。

DeviceB> enable

DeviceB# configure

DeviceB(config)# vlan 7

DeviceB(config-vlan)# remote-span

DeviceB(config-vlan)# exit

(2)   配置主张端口。。。。 。

DeviceB(config)# monitor session 1 remote-destination

DeviceB(config)# monitor session 1 destination remote vlan 7 interface gigabitethernet 0/2 switch

DeviceB(config)# interface gigabitethernet 0/1

DeviceB(config-if)# switchport mode trunk

配置DeviceC为主张设备。。。。 。

(1)   配置远程VLAN。。。。 。

DeviceC> enable

DeviceC# configure

DeviceC(config)# vlan 7

DeviceC(config-vlan)# remote-span

DeviceC(config-vlan)# exit

(2)   配置主张端口。。。。 。

DeviceC(config)# monitor session 1 remote-destination

DeviceC(config)# monitor session 1 destination remote vlan 7 interface gigabitethernet 0/2 switch

DeviceC(config)# interface gigabitethernet 0/1

DeviceC(config-if)# switchport mode trunk

5.    验证配置了局

DeviceA上通过show monitor号令查看镜像源设备配置了局。。。。 。

DeviceA# show monitor

sess-num: 1

span-type: SOURCE_SPAN

src-intf:

GigabitEthernet 0/1   frame-type Both

dest-intf:

GigabitEthernet 0/2

Remote vlan 7

mtp_switch on

DeviceBDeviceC中通过show monitor号令查看镜像主张设备配置了局。。。。 。以DeviceB为例注明。。。。 。

DeviceB# show monitor

sess-num: 1

span-type: DEST_SPAN

dest-intf:

GigabitEthernet 0/2

Remote vlan 7

mtp_switch on

6.    配置文件

l  DeviceA的配置文件

hostname DeviceA

!

vlan 7

!

 remote-span

!

interface GigabitEthernet 0/2

 mac-loopback

 switchport access vlan 7

!

interface GigabitEthernet 0/3

switchport mode trunk

interface GigabitEthernet 0/4

switchport mode trunk

!

monitor session 1 remote-source

monitor session 1 source interface GigabitEthernet 0/1 both

monitor session 1 destination remote vlan 7 interface GigabitEthernet0/2 switch

!

end

l  DeviceB的配置文件

hostname DeviceB

!

vlan 7

 remote-span

!

interface GigabitEthernet 0/1

 switchport mode trunk

!

monitor session 1 remote-destination

monitor session 1 destination remote vlan 7 interface GigabitEthernet0/2 switch

!

end

l  DeviceC的配置文件

hostname Device

!

vlan 7

 remote-span

!

interface GigabitEthernet 0/1

 switchport mode trunk

 !

monitor session 1 remote-destination

monitor session 1 destination remote vlan 7 interface GigabitEthernet 0/2 switch

!

end

7.    常见谬误

l  源设备、中央设备、主张设备均要配置远程VLANVID必须一致。。。。 。

l  带宽大的端口被镜像到带宽幼的端口可能会造成丢包。。。。 。

3  ERSPAN根基职能配置举例

1.    组网需要

1-8中所示。。。。 。网管但愿通过网络分析仪对DeviceADeviceC的流量进行监控。。。。 。其中对于DeviceA, ,,,,,,,监控双向数据流;;;;;对于DeviceC, ,,,,,,,仅监控部门发送到Device的报文。。。。 。为了合理利用资源, ,,,,,,,对监控报文进行采样, ,,,,,,,采样率为1000。。。。 。

2.    组网图

图1-8     ERSPAN配置举例组网图

 

3.    配置重点

l  配置各设备之间三层路由可达。。。。 。

l  配置DeviceB为源设备。。。。 。GigabitEthernet 0/1, ,,,,,,,GigabitEthernet 0/2均为源端口, ,,,,,,,监控GigabitEthernet 0/1的双向数据报文, ,,,,,,,对于GigabitEthernet 0/2的报文, ,,,,,,,仅镜像主张IP2.1.1.1的报文, ,,,,,,,GigabitEthernet 0/3为镜像报文出口。。。。 。

l  配置镜像报文的采样率为1000。。。。 。

4.    配置步骤

配置DeviceB的地址。。。。 。

DeviceB> enable

DeviceB# configure terminal

DeviceB(config)# interface gigabitethernet 0/1

DeviceB(config-if-GigabitEthernet 0/1)# ip address 1.1.1.1 255.255.255.0

DeviceB(config-if-GigabitEthernet 0/1)# exit

DeviceB(config)# interface gigabitethernet 0/2

DeviceB(config-if-GigabitEthernet 0/1)# ip address 2.1.1.1 255.255.255.0

DeviceB(config-if-GigabitEthernet 0/1)# exit

DeviceB(config)# interface gigabitethernet 0/3

DeviceB(config-if-GigabitEthernet 0/1)# ip address 13.1.1.1 255.255.255.0

DeviceB(config-if-GigabitEthernet 0/1)# exit

配置DeviceA的地址。。。。 。

DeviceA> enable

DeviceA# configure terminal

DeviceA(config)# interface gigabitethernet 0/1

DeviceA(config-if-GigabitEthernet 0/1)# ip address 1.1.1.2 255.255.255.0

DeviceA(config-if-GigabitEthernet 0/1)# exit

配置DeviceC地址。。。。 。

DeviceC> enable

DeviceC# configure terminal

DeviceC(config)# interface gigabitethernet 0/1

DeviceC(config-if-GigabitEthernet 0/1)# ip address 2.1.1.2 255.255.255.0

DeviceC(config-if-GigabitEthernet 0/1)# exit

DeviceB上配置ACL。。。。 。

DeviceB(config)#access-list 1 permit host 1.1.1.1

创建ERSPAN Session 1, ,,,,,,,设置为源设备, ,,,,,,,并设置端口GigabitEthernet 0/1为源端口, ,,,,,,,镜像双向数据流, ,,,,,,,端口GigabitEthernet 0/2也为源端口, ,,,,,,,仅进行主张地址为1.1.1.1的报文。。。。 。

DeviceB(config)# monitor session 1 erspan-source

DeviceB(config-mon-erspan-src)# source interface gigabitethernet 0/1 both

DeviceB(config-mon-erspan-src)# source interface gigabitethernet 0/2 rx acl acl1

DeviceB(config-mon-erspan-src)# origin ip address 10.1.1.2

DeviceB(config-mon-erspan-src)# destination ip address 3.1.1.2

开启镜像报文选取职能并配置采样率为1000。。。。 。

DeviceB(config-mon-erspan-src)# sample enable

DeviceB(config-mon-erspan-src)# sample rate 1000

5.    验证配置了局

验证DeviceBDeviceA之间三层可通。。。。 。

DeviceB# ping 1.1.1.2

Sending 5, 100-byte ICMP Echoes to 1.1.1.2, timeout is 2 seconds:

 < press Ctrl+C to break >

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 2/3/8 ms.

验证DeviceBDeviceC之间三层可通。。。。 。

DeviceB# ping 2.1.1.2

Sending 5, 100-byte ICMP Echoes to 2.1.1.2, timeout is 2 seconds:

 < press Ctrl+C to break >

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 2/3/8 ms.

验证DeviceB与网络分析仪之间三层可通。。。。 。

DeviceB# ping 3.1.1.2

Sending 5, 100-byte ICMP Echoes to 3.1.1.2, timeout is 2 seconds:

 < press Ctrl+C to break >

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 2/3/8 ms.

通过show access-lists号令查看ACL配置成功。。。。 。

DeviceB# show access-lists

 

ip access-list standard 1

 10 permit host 1.1.1.1

通过show monitor号令查看配置了局, ,,,,,,,ERSPAN会话处于Active状态。。。。 。

DeviceB# show monitor

sess-num: 1

span-type: ERSPAN_SOURCE

src-intf:

 GigabitEthernet 0/1     frame-type: Both    TX status: Active  RX status: Active 

src-intf:

 GigabitEthernet 0/2     frame-type: RX Only   Rx acl id: 1   

status: Active

original ip address: 2.1.1.2

destination ip address: 3.1.1.2

ip ttl: 64

ip dscp: 0

sample rate: 1000

vrf: default

6.    配置文件

l  DeviceA的配置文件

hostname DeviceA

!

interface GigabitEthernet 0/1

 ip address 1.1.1.2 255.255.255.0

!

end

l  DeviceC的配置文件

hostname DeviceC

!

interface GigabitEthernet 0/1

 ip address 2.1.1.2 255.255.255.0

!

end

l  DeviceB的配置文件

hostname DeviceB

!

ip access-list standard 1

 10 permit host 1.1.1.1

!

interface GigabitEthernet 0/1

 ip address 1.1.1.1 255.255.255.0

!

interface GigabitEthernet 0/2

 ip address 2.1.1.1 255.255.255.0

!

interface GigabitEthernet 0/3

 ip address 3.1.1.1 255.255.255.0

!

monitor session 1 erspan-source

 source interface gigabitEthernet 0/1 both

 source interface gigabitEthernet 0/2 rx acl acl1

 origin ip address 10.1.1.2

 destination ip address 3.1.1.2

 sample enable

 sample rate 1000

!

end

7.    常见谬误

l  配置ERSPAN镜像的会话ID已经被配置了RSPANLOCAL SPAN。。。。 。

l  从源设备到主张设备的三层路由无法互通。。。。 。

全发国际(中国)有限公司官网

返回顶部

收起
全发国际(中国)有限公司官网 文档AI副手
全发国际(中国)有限公司官网 文档评价
该资料是否解决了您的问题? ??????
您对当前页面的中意度若何? ??????
不咋滴
极度好
您中意的原因是(多选!。。 。 ??????
您对文档是否还有其它的问题或建议? ??????
为尽快解决问题, ,,,,,,,请您留下联系方式以便回复
邮箱
手机号
感激您的反馈!。。 。
全发国际(中国)有限公司官网
全发国际(中国)有限公司官网
全发国际(中国)有限公司官网
请选择服务项目
关关征询页
售前征询 售前征询
售前征询
售后服务 售后服务
售后服务
定见反馈 定见反馈
定见反馈
更多联系方式
【网站地图】【sitemap】