端口镜像详解
什么是端口镜像
?
把交换机一个或多个端口(
VLAN
)的数据镜像到一个或多个端口的方法。
为什么需要端口镜像
?
通常为了部署
IDS
产品需要监听网络流量(网络分析仪同样也需要),但是在目前广泛采用的交换网络中监听所有流量有相当大的困难,因此需要通过配置交换机来把一个或多个端口(
VLAN
)的数据转发到某一个端口来实现对网络的监听。
端口镜像的别名
端口镜像通常有以下几种别名:
●Port Mirroring
通常指允许把一个端口的流量复制到另外一个端口,同时这个端口不能再传输数据。
●Monitoring Port
监控端口
●Spanning Port
通常指允许把所有端口的流量复制到另外一个端口,同时这个端口不能再传输数据。
●SPAN port
在
Cisco
产品中,
SPAN
通常指
Switch Port ANalyzer
。某些交换机的
SPAN
端口不支持传输数据。
●Link Mode port
支持端口镜像的交换机
大多数中档以上的交换机都支持端口镜像功能,但支持程度不同。
端口镜像配置方法
下面是几种交换机的端口镜像配置方法,主要来自于
Talisker Security Wizardry ([url]http://www.securitywizardry.com/[/url])
的
Switch Port Mirroring ([url]http://www.securitywizardry.com/switch.htm[/url])
Cisco
交换机
特点:
●Cisco 2900
和
Cisco 3500XL
系列交换机
Cisco 2950
、
Cisco 3550
和
Cisco 3750
系列交换机
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 5000
系列交换机
使用
CatOS
的
Cisco 4000
和
Cisco 6000
系列交换机
使用
IOS
的
Cisco 4000
和
Cisco 6000
系列交换机
Extreme
交换机
特点:
●
只能创建多对一或者一对一的镜像端口
●
可以监听
VLAN
的流量
●Extreme
会镜像
IN
和
OUT
的流量。这就意味着在镜像
VLAN
的时候,会看到一个报文至少两次
— —
从
VLAN
的某个端口出来,并且进入
VLAN
的另一个端口。
版本高于
4.1
的
Extreme
交换机端口镜像配置方法
{enable | disable} mirroring on port
开启
/
关闭端口镜像功能,并且指定镜像流量从何端口流出,
port-no
只能是一个端口
configure mirroring { add | delete } { vlan | port }
指定镜像哪个或哪些
VLAN
或端口的流量
{ vlan | port }
部分可以重复多次
版本低于
4.1
的
Extreme
交换机端口镜像配置方法
enable mirror to port port-no
开启端口镜像功能,并且指定镜像流量从何端口流出,
port-no
只能是一个端口
disable mirror
关闭端口镜像功能
config mirror add port
镜像端口
port-no
的流量,如果这个端口包含多个
VLAN
这些流量都会被镜像到目的端口
config mirror add port vlan
镜像端口
port-no
中指定
VLAN
的流量
config mirror add vlan
镜像端口中指定
VLAN
的所有端口的流量
config mirror del port
取消对
port-no
的端口镜像
config mirror del vlan
取消对指定
VLAN
的端口镜像
show mirror
显示端口镜像情况
Foundry
交换机
特点:
●
可以创建多对多的端口镜像
Foundry
交换机端口镜像配置方法
在配置模式中(
Configuration Mode
):
interface
port monitor { { rx | tx | both}}
确定镜像流量从哪个端口流出,修改此端口配置
指定要镜像哪些端口的哪些流量(
rx
指接收的流量,
tx
指发送的流量,
both
指双向流量),
{ { rx | tx | both}}
部分可以重复
Juniper
交换机
特点:
●
每交换机只能有一个监听端口
●
只能镜像
IPv4
的流量
●
只能镜像发送(
transit only
)的流量,不能镜像接收的流量
Juniper M
系列和
T
系列端口镜像配置方法
[url=mailto:usen@router]usen@router[/url]# show forwarding-options port- mirroring { input {family inet; rate ; run- length ;} output interface {next-hop
;} no-filter-check;} }
转载于:https://blog.51cto.com/ciscolj/81830