以下是小编为大家收集的为了交换机端口镜像配置 使出专家浑身解数(共含8篇),欢迎参阅,希望可以帮助到有需要的朋友。同时,但愿您也能像本文投稿人“小团芝”一样,积极向本站投稿分享好文章。
为了交换机端口镜像配置 使出专家浑身解数,熟练掌握下面的交换机端口镜像配置知识点,你只需花几分钟的时间就完成交换机端口镜像配置,本地连接也将在文中提到。
【3026等交换机镜像】
S/S/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法:
方法一:
◆配置镜像(观测)端口monitor-port e0/8
◆配置被镜像端口port mirror Ethernet 0/1 to Ethernet 0/2
方法二:
◆可以一次性定义镜像和被镜像端口port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8
【8016交换机端口镜像配置】
◆假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口1/0/15为交换机端口镜像配置的观测端口。 port monitor ethernet 1/0/15
◆设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。 port mirroring ethernet 1/0/0 both ethernet 1/0/15
也可以通过两个不同的端口,对输入和输出的数据分别镜像
◆设置E1/0/15和E2/0/0为镜像(观测)端口 port monitor ethernet 1/0/15
◆设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。 port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15 port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0
『基于流镜像的数据流程』
基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。
【3500/3026E/3026F/3050】
〖基于三层流的镜像〗
◆定义一条扩展访问控制列表acl num 101
◆定义一条规则报文源地址为1.1.1.1/32去往所有目的地址rule 0 permit ip source 1.1.1.1 0 destination any
◆定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32rule 1 permit ip source any destination 1.1.1.1 0
◆将符合上述ACL规则的报文镜像到E0/8端口mirrored-to ip-group 101 interface e0/8
〖基于二层流的镜像〗
◆定义一个ACLacl num 200
◆定义一个规则从E0/1发送至其它所有端口的数据包rule 0 permit ingress interface Ethernet0/1 (egress interface any)
◆定义一个规则从其它所有端口到E0/1端口的数据包rule 1 permit (ingress interface any) egress interface Ethernet0/1
◆将符合上述ACL的数据包镜像到E0/8mirrored-to link-group 200 interface e0/8
【5516】
支持对入端口流量进行镜像配置端口Ethernet 3/0/1为监测端口,对Ethernet 3/0/2端口的入流量镜像,
mirror Ethernet 3/0/2 ingress-to Ethernet 3/0/1
【6506/6503/6506R】
目前该三款产品只支持对入端口流量进行镜像,虽然有outbount参数,但是无法配置。镜像组名为1,监测端口为Ethernet4/0/2,端口Ethernet4/0/1的入流量被镜像。mirroring-group 1 inbound Ethernet4/0/1 mirrored-to Ethernet4/0/2
【补充说明】
◆镜像一般都可以实现高速率交换机端口镜像配置低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现。
◆8016支持跨单板交换机端口镜像配置。
1, 配置镜像(观测)端口
monitor-port e0/8
2。 配置被镜像端口
port mirror Ethernet 0/1 to Ethernet 0/2
1。 可以一次性定义镜像和被镜像端口
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为端口镜像的观测端口。
port monitor ethernet 1/0/15
2。 设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。
port mirroring ethernet 1/0/0 both ethernet 1/0/15
也可以通过两个不同的端口,对输入和输出的数据分别镜像
1。 设置E1/0/15和E2/0/0为镜像(观测)端口
port monitor ethernet 1/0/15
2。 设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。
port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15
port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0
『基于流镜像的数据流程』
基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。
【3500/3026E/3026F/3050】
〖基于三层流的镜像〗
1。 定义一条扩展访问控制列表
acl num 101
2。 定义一条规则报文源地址为1,
1。1。1/32去往所有目的地址
rule 0 permit ip source 1。1。1。1 0 destination any
3。 定义一条规则报文源地址为所有源地址目的地址为1。1。1。1/32
rule 1 permit ip source any destination 1。1。1。1 0
4。 将符合上述ACL规则的报文镜像到E0/8端口
mirrored-to ip-group 101 interface e0/8
〖基于二层流的镜像〗
1。 定义一个ACL
acl num 200
2。 定义一个规则从E0/1发送至其它所有端口的数据包
rule 0 permit ingress interface Ethernet0/1 (egress interface any)
3。 定义一个规则从其它所有端口到E0/1端口的数据包
rule 1 permit (ingress interface any) egress interface Ethernet0/1
4。 将符合上述ACL的数据包镜像到E0/8
mirrored-to link-group 200 interface e0/8
【5516】
支持对入端口流量进行镜像
配置端口Ethernet 3/0/1为监测端口,对Ethernet 3/0/2端口的入流量镜像。
mirror Ethernet 3/0/2 ingress-to Ethernet 3/0/1
【6506/6503/6506R】
目前该三款产品只支持对入端口流量进行镜像,虽然有outbount参数,但是无法配置。
镜像组名为1,监测端口为Ethernet4/0/2,端口Ethernet4/0/1的入流量被镜像。
mirroring-group 1 inbound Ethernet4/0/1 mirrored-to Ethernet4/0/2
【补充说明】
1。 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现
2。 8016支持跨单板端口镜像
【相关文章】
华为8016交换机DHCP配置
局域网交换机的配置及性能比较
配置Cisco交换机启动及基本设置
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 100
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 100 interface e0/8
〖基于二层流的镜像〗
1. 定义一个ACL
[SwitchA]acl num 200
2. 定义一个规则从E0/1发送至其它所有端口的数据包
[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2
3. 定义一个规则从其它所有端口到E0/1端口的数据包
[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1
4. 将符合上述ACL的数据包镜像到E0/8 www.hanwangtx.com
[SwitchA]mirrored-to link-group 200 interface e0/8
【5516/6506/6503/6506R】
目前该三款产品支持对入端口流量进行镜像
1. 定义镜像端口
[SwitchA]monitor-port Ethernet 3/0/2
2. 定义被镜像端口
[SwitchA]mirroring-port Ethernet 3/0/1 inbound
【补充说明】
1. 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现
2. 8016支持跨单板端口镜像端口镜像配置
本文来自于无忧网客联盟
SPAN可以方便将流量探头设备或者其他的远程监控探将接到交换机的某个端口,从而在这个端口上来监控其他端口,或者其他VLAN上的数据包,
所有在端口5上的数据包都被镜像到端口10,从而在端口10上接上网络嗅探器后,就可以不用与端口5物理相连而得到其数据包。
例如:
以下是在2/1(目的)上镜像1/1(源),对双向流里镜像:
Console> (enable) set span 1/1 2/1
Destination : Port 2/1
Admin Source : Port 1/1
Oper Source : Port 1/1
Direction : transmit/receive
Incoming Packets: disabled
Learning : enabled
Multicast : enabled
Filter : -
以下是在2/1(目的)上镜像VLAN 522(源)的流量:
Console> (enable) set span 522 2/1
Destination : Port 2/1
Admin Source : VLAN 522
Oper Source : Port 3/1-2
Direction : transmit/receive
Incoming Packets: disabled
Learning : enabled
Multicast : enabled
Filter : -
Console> (enable)
以下是在2/12(目的)上镜像VLAN 522(源)的流量,只镜像发送出去的包,同时,允许2/12上正常的input的数据包:
Console> (enable) set span 522 2/12 tx inpkts enable
Destination : Port 2/12
Admin Source : VLAN 522
Oper Source : Port 2/1-2
Direction : transmit
Incoming Packets: enabled
Learning : enabled
Multicast : enabled
Filter : -
Console> (enable)
主流交换机的镜像配置方法
常用品牌交换机端口镜像(Port Mirroring)配置
满足组网需求的交换机端口镜像配置参数,对于很多朋友来说,交换机端口镜像配置还是一个很陌生的词语,它到底是干什么的,有什么作用呢?带着这些疑问,我们来了解一下吧。
『环境交换机端口镜像配置参数』
◆PC1接在交换机E0/1端口,IP地址1.1.1.1/24
◆PC2接在交换机E0/2端口,IP地址2.2.2.2/24
◆E0/24为交换机上行端口,Server接在交换机端口镜像配置E0/8端口,该端口作为镜像端口
『组网需求』
◆通过交换机端口镜像配置的功能使用server对两台pc的业务报文进行监控。
◆按照镜像的不同方式进行配置:
◆基于端口的镜像
◆基于流的镜像
数据配置步骤『端口镜像的数据流程』基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量观测或者故障定位。
【3026等交换机端口镜像配置】
S/S/S2026/S2403H/S3026等交换机端口镜像配置支持的都是基于端口的镜像,有两种方法:
◆配置镜像(观测)端口monitor-port e0/8
◆配置被镜像端口port mirror Ethernet 0/1 to Ethernet 0/2
◆可以一次性定义镜像和被镜像端口port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8
【8016交换机端口镜像配置】
◆假设8016交换机端口镜像配置端口为E1/0/15,被镜像端口为E1/0/0,设置端口1/0/15为交换机端口镜像配置的观测端口。 port monitor ethernet 1/0/15
◆设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。 port mirroring ethernet 1/0/0 both ethernet 1/0/15也可以通过两个不同的端口,对输入和输出的数据分别镜像。
◆设置E1/0/15和E2/0/0为镜像(观测)端口 port monitor ethernet 1/0/15
◆设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。 port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15 port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0
基于流镜像的数据流程,基于流镜像的交换机端口镜像配置针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机端口镜像配置来说这两个数据流是要分开镜像的,
【3500/3026E/3026F/3050】
〖基于三层流的交换机端口镜像配置〗
◆定义一条扩展访问控制列表acl num 100
◆定义一条规则报文源地址为1.1.1.1/32去往所有目的地址rule 0 permit ip source 1.1.1.1 0 destination any
◆定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32rule 1 permit ip source any destination 1.1.1.1 0
◆将符合上述ACL规则的报文镜像到E0/8端口mirrored-to ip-group 100 interface e0/8
〖基于二层流的交换机端口镜像配置〗
◆定义一个ACLacl num 200
◆定义一个规则从E0/1发送至其它所有端口的数据包rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2
◆定义一个规则从其它所有端口到E0/1端口的数据包rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1
◆将符合上述ACL的数据包镜像到E0/8mirrored-to link-group 200 interface e0/8
【5516/6506/6503/6506R】
目前该三款产品支持对入交换机端口镜像配置进行镜像
◆定义镜像端口monitor-port Ethernet 3/0/2
◆定义被镜像端口mirroring-port Ethernet 3/0/1 inbound
【交换机端口镜像配置补充说明】
◆镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现。
◆8016支持跨单板端口镜像。
◆测试验证在观测端口上通过工具软件可以看到被镜像端口的相应的报文,可以进行流量观测或者故障定位。
最常用的对端口安全的理解就是可根据MAC地址来做对网络流量的控制和管理,比如MAC地址与具体的端口绑定,限制具体端口通过的MAC地址的数量,或者在具体的端口不允许某些MAC地址的帧流量通过,稍微引申下端口安全,就是可以根据802.1X来控制网络的访问流量。
首先谈一下MAC地址与端口绑定,以及根据MAC地址允许流量的配置。
1.MAC地址与端口绑定,当发现主机的MAC地址与交换机上指定的MAC地址不同时,交换机相应的端口将down掉。当给端口指定MAC地址时,端口模式必须为access或者Trunk状态。
3550-1#conf t
3550-1(config)#int f0/1
3550-1(config-if)#switchport mode access /指定端口模式。
3550-1(config-if)#switchport port-security mac-address 00-90-F5-10-79-C1 /配置MAC地址。
3550-1(config-if)#switchport port-security maximum 1 /限制此端口允许通过的MAC地址数为1。
3550-1(config-if)#switchport port-security violation shutdown /当发现与上述配置不符时,端口down掉。
2.通过MAC地址来限制端口流量,此配置允许一TRUNK口最多通过100个MAC地址,超过100时,但来自新的主机的数据帧将丢失。
3550-1#conf t
3550-1(config)#int f0/1
3550-1(config-if)#switchport trunk encapsulation dot1q
3550-1(config-if)#switchport mode trunk /配置端口模式为TRUNK。
3550-1(config-if)#switchport port-security maximum 100 /允许此端口通过的最大MAC地址数目为100。
3550-1(config-if)#switchport port-security violation protect /当主机MAC地址数目超过100时,交换机继续工作,但来自新的主机的数据帧将丢失,
上面的配置根据MAC地址来允许流量,下面的配置则是根据MAC地址来拒绝流量。
1.此配置在Catalyst交换机中只能对单播流量进行过滤,对于多播流量则无效。
3550-1#conf t
3550-1(config)#mac-address-table static 00-90-F5-10-79-C1 vlan 2 drop /在相应的Vlan丢弃流量。
3550-1#conf t
3550-1(config)#mac-address-table static 00-90-F5-10-79-C1 vlan 2 int f0/1 /在相应的接口丢弃流量。
最后说一下802.1X的相关概念和配置。
802.1X身份验证协议最初使用于无线网络,后来才在普通交换机和路由器等网络设备上使用。它可基于端口来对用户身份进行认证,即当用户的数据流量企图通过配置过802.1X协议的端口时,必须进行身份的验证,合法则允许其访问网络。这样的做的好处就是可以对内网的用户进行认证,并且简化配置,在一定的程度上可以取代Windows 的AD。
配置802.1X身份验证协议,首先得全局启用AAA认证,这个和在网络边界上使用AAA认证没有太多的区别,只不过认证的协议是802.1X;其次则需要在相应的接口上启用802.1X身份验证。(建议在所有的端口上启用802.1X身份验证,并且使用radius服务器来管理用户名和密码)
下面的配置AAA认证所使用的为本地的用户名和密码。
3550-1#conf t
3550-1(config)#aaa new-model /启用AAA认证。
3550-1(config)#aaa authentication dot1x default local /全局启用802.1X协议认证,并使用本地用户名与密码。
3550-1(config)#int range f0/1 -24
3550-1(config-if-range)#dot1x port-control auto /在所有的接口上启用802.1X身份验证。
后记
通过MAC地址来控制网络的流量既可以通过上面的配置来实现,也可以通过访问控制列表来实现,比如在Cata3550上可通过700-799号的访问控制列表可实现MAC地址过滤。但是利用访问控制列表来控制流量比较麻烦,似乎用的也比较少,这里就不多介绍了。
通过MAC地址绑定虽然在一定程度上可保证内网安全,但效果并不是很好,建议使用802.1X身份验证协议。在可控性,可管理性上802.1X都是不错的选择。
交换机端口安全:交换机端口安全是通过对交换接接口的配置,来限定只允许特定的mac地址向交换机接口发送帧,如果交换机收到mac地址的帧,则丢弃来自该设备的帧,
基本配置命令:
switch(config)#int f0/0
switch(config-if)#switchport mode access /配置此接口为接入接口,不能是中继接口/
switch(config-if)#switchport port-security /启用端口安全/
switch(config-if)#switchport port-security mac-address mac /指定允许向这个接口内发送帧的mac地址,
多次使用此命令,可定义多个mac地址/
其它命令:
switch(config-if)#switchport port-security macaddress sticky /与上面命令功能一样。利用粘带学习,动态的获悉和配置当前已连接主机的mac地址/ switch(config-if)#switchport port-security maxinum /指定当前接口最多允许多少个mac地址,默认为一个/ switch(config-if)#switchport port-security violation {protect restrict shutdown} /规定在接收到来自规定地址之外某个mac地址帧时应该采取的动作,默认是关闭该端口/
switch#show port-security int f0/0 /查看接口安全的状态/