交换机端口安全配置实验(MAC动态绑定和静态绑定)


1、 根据拓扑完成上图 ,可以配置pc的地址为192.168.1.1-192.168.1.4
2、 配置安全端口
Switch>enable
switch#conf t
Switch(config)#interface f0/1
Switch(config-if)#switchport mode access 配置access模式
Switch(config-if)#switchport port-security 开启安全端口
Switch(config-if)# do show port inter f0/1 查看安全端口信息
Port Security : Enabled 已经开启
Port Status : Secure-up
Violation Mode : Shutdown
Aging Time : 0 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 1
Total MAC Addresses : 0
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan : 0000.0000.0000:0
Security Violation Count : 0

Switch(config-if)#switchport port-security maximum 2

设置最大接入MAC地址数为2
Switch(config-if)#switchport port-security mac-address sticky
自动获得接入设备的MAC
Switch(config-if)#switchport port-security violation ?
违规处理方式
protect Security violation protect mode
保护- 丢弃数据,不告警
restrict Security violation restrict mode
抵制 –丢弃数据,发告警
shutdown Security violation shutdown mode
关闭- 丢弃数据,发告警并关闭链路
Switch(config-if)#switchport port-security violation protect
选择违规处理方式为保护
Switch(config-if)#end
Switch#
Switch#show port-security address 查看地址表
Secure Mac Address Table

Vlan Mac Address Type Ports Remaining Age
(mins)



1 0002.4AA6.D46D SecureSticky FastEthernet0/1 -
1 0010.1108.D197 SecureSticky FastEthernet0/1 -

Total Addresses in System (excluding one mac per port) : 1
Max Addresses limit in System (excluding one mac per port) : 1024

验证试验,两台先接入的主机可以访问PC3 ,第三台不能访问PC3 说明试验成功 。

验证安全端口的另外一种模式-静态绑定

Switch#conf t
Switch(config)#
Switch(config)#interface f0/1
Switch(config-if)#no switchport port-security mac-address sticky 删除动态绑定
Switch(config-if)#do show port add
Secure Mac Address Table

Vlan Mac Address Type Ports Remaining Age



1 0002.4AA6.D46D SecureSticky FastEthernet0/1 -
动态绑定的地址还在
1 0010.1108.D197 SecureSticky FastEthernet0/1 -

Total Addresses in System (excluding one mac per port) : 1
Max Addresses limit in System (excluding one mac per port) : 1024
Switch(config-if)#end
Switch#clear port-security sticky
清除动态绑定地址
Switch#show port-security address
Secure Mac Address Table

Vlan Mac Address Type Ports Remaining Age
(mins)




Total Addresses in System (excluding one mac per port) : 0
Max Addresses limit in System (excluding one mac per port) : 1024

Switch#conf t
Switch(config)#interface f0/1
Switch(config-if)#switchport port-security mac-address 00D0.FF76.14ED 手动绑定PC的MAC
Switch(config-if)#switchport port-security mac-address 0010.1108.D197

PC的MAC地址需要你自己在pC 的命令提示符下获取,获取方法:ipconfig /all

验证试验,静态绑定的PC可以访问PC3 ,其他不可以访问PC3 ,证明试验成功 。

原文地址:http://blog.51cto.com/ronning/2116012

时间: 2024-08-01 06:54:10

交换机端口安全配置实验(MAC动态绑定和静态绑定)的相关文章

CISCO交换机端口镜像配置

镜像口配置    大多数交换机都支持镜像技术,这可以对交换机进行方便的故障诊断.我们称之为"mirroring "或"Spanning ".镜像是将交换机某个端口的流量拷贝到另一端口(镜像端口),进行监测. Cisco3550可以配置2个镜像口 案例:将端口2~5镜像到端口6 1.镜像口配置 Switch>enable                         Switch#conf  t                          Step3:

华为交换机端口镜像配置

端口镜像 通过配置镜像功能,可以将报文复制到特定的目的地进行分析,以进行网络监控和故障定位. 通俗来讲,镜像是指将经过指定端口(源端口或者镜像端口)的报文复制一份到另一个指定端口(目的端口或者观察端口). 如下图所示: 在华为中,交换机上做镜像的网口叫做镜像端口,连接监控设备的接口叫做观察口. 一般端口镜像分为1对1 ,1对多,多对1等情况,下面通过简单的案例来进行学习: 1.1对1本地端口镜像(一台监控设备连接一个镜像端口) 测试拓扑图如下所示: 现在我要把LSW1上GE0/0/2接口的流量镜

Cisco交换机端口聚合配置

交换机和交换机,交换机和路由器之间的端口速率,不能满足实际的速率,就需要将两个以上的端口绑在一起,实现负载均衡,防止出现单点故障. 1.选择交换机SW2960 进行配置  将f0/1和f0/2端口模式配置成truck #conf terminal                进入特权模式 #interface range fa0/1 – 2   用来绑定一组端口,并进入端口批量配置视图 #switchport mode truck        将图端口这只为truck模式 2. 将fa0/1

NAT静态和端口映射配置实验

一.静态NAT配置图 1.配置主机地址: PC1> ip 192.168.100.10 192.168.100.1 Checking for duplicate address... PC1 : 192.168.100.10 255.255.255.0 gateway 192.168.100.1 PC2> ip 192.168.100.20 192.168.100.1 Checking for duplicate address... PC1 : 192.168.100.20 255.255.

华为S9300、s5700交换机端口镜像配置

华为s5700端口镜像配置# 配置GigabitEthernet0/0/1为镜像接口,GigabitEthernet0/0/2为观察接口,观察接口索引号为1.镜像GigabitEthernet0/0/1上的入方向业务流量到GigabitEthernet0/0/2上.<Quidway> system-view[Quidway] observe-port 1 interface gigabitethernet 0/0/2[Quidway] interface gigabitethernet 0/0

强制清除交换机端口所有配置

遇到无法修改和删除端口配置信息是直接强制清除该端口所有配置 clear configuration interface GigabitEthernet 0/0/15 按Y

交换机端口安全配置

任务要求:实验要求:在交换机f0/1端口上设置安全配置,使PC1或者PC2两台机器只有一台机器能够通信,另一台通信时端口则会自动关闭. 拓扑图 1.我们进入交换机命令行 2.输入enable 进入特权模式 2.输入configure terminal  进入全局模式 3.输入interface f0/1 进入f0/1端口 4输入.shutdown  关闭端口 5.输入switchport mode access 修改端口模式 6.输入switchport port-security 修改端口为安

路由器端口聚合配置实验报告

实验目的 理解快速生成树协议 RSTP 的工作原理,掌握如何在交换机上配置快速生成树. 实验设备 三层交换机 1 台 二层交换机 1 台 实验步骤 第一步:配置两台交换机的主机名.管理 IP  地址和 Trunk 第二步:在两台交换机上启用 RSTP L2-SW(config)#spanning-tree !启用生成树协议 L2-SW(config)#spanning-tree mode rstp !修改生成树协议的类型为 RSTP L2-SW(config)# L3-SW(config)#sp

路由器交换机远程登录配置实验

一实验目的 学习如何配置路由器的gatway.Console.vty.enable password 学习如何配置交换机的vlan1 gatway.Console.vty.enable password 学习如何安装telnet 学习如何远程登录交换机路由器 二实验步骤 路  由  配  置 R1路由器配置IP.子网掩码. R1(config)#intf0/0                                //进入F0/0接口 R1(config-if)#ipadd 192.16