交换机配置 |
您所在的位置:网站首页 › 思科配置端口安全 › 交换机配置 |
一、实验目的:在交换机f0/1端口上设置安全配置,使PC1和PC2两台机中只有一台机器能够正常通信,另一台通信时端口则会自动关闭 二、拓扑图如下
三、实验步骤: 1、先给各台主机配置IP地址(PC1、PC2、PC3)记录PC1或PC2的其中一台主机的mac地址 2、配置交换机S1 enable --进入特权模式config terminal --进入全局配置模式hostname S2 --修改交换机名为S1interface f0/1 --进入到f0/1端口shutdown --关闭f0/1端口switchport mode access --修改端口模式switchport port-security --修改端口为安全模式switchport port-security maximum 1 --配置mac地址最大数量为1switchport port-security violation shutdown --配置违反安全设置后的处理动作为关闭端口switchport port-security mac-address 0009.7C2D.DC67 --将PC1或PC2其中一台的mac地址与端口绑定no shutdown --激活端口end --返回特权模式copy running-config startup-config --保存配置 3、分别测试PC1和PC2主机PingPC3主机 PC1:正常PIng通 PC2:不能正常Ping通 违反端口安全导致端口关闭(如下图,),若想再次启动需要进入到f0/1端口先shutdown再no shutdown启动: S1: enable --进入特权模式 config terminal --进入全局配置模式 interface f0/1 --进入f0/1端口 shutdown --关闭f0/1端口 noshutdown --激活f0/1端口
|
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |