zoukankan      html  css  js  c++  java
  • 交换机配置——端口安全

    一、实验目的:在交换机f0/1端口上设置安全配置,使PC1和PC2两台机中只有一台机器能够正常通信,另一台通信时端口则会自动关闭

    二、拓扑图如下

    三、实验步骤:

    1、先给各台主机配置IP地址(PC1PC2PC3)记录PC1PC2的其中一台主机的mac地址

    2、配置交换机S1

    enable  --进入特权模式
    config terminal  --进入全局配置模式
    hostname S2  --修改交换机名为S1
    interface f0/1  --进入到f0/1端口
    shutdown  --关闭f0/1端口
    switchport mode access  --修改端口模式
    switchport port-security  --修改端口为安全模式
    switchport port-security maximum 1  --配置mac地址最大数量为1
    switchport port-security violation shutdown  --配置违反安全设置后的处理动作为关闭端口
    switchport port-security mac-address 0009.7C2D.DC67  --将PC1或PC2其中一台的mac地址与端口绑定
    no shutdown  --激活端口
    end   --返回特权模式
    copy running-config startup-config --保存配置

    3、分别测试PC1PC2主机PingPC3主机

    PC1:正常PIng通

    PC2:不能正常Ping通

    违反端口安全导致端口关闭(如下图,),若想再次启动需要进入到f0/1端口先shutdownno shutdown启动:

    S1:

    enable  --进入特权模式

    config terminal  --进入全局配置模式

    interface f0/1  --进入f0/1端口

    shutdown  --关闭f0/1端口

    noshutdown  --激活f0/1端口

  • 相关阅读:
    【足迹C++primer】32、定制操作_2
    pom文件miss artifact com.sun:tools:jar:1.5.0:system问题
    cents上运行wget报错:unable to resolve host address
    怎样定义函数模板
    06006_redis数据存储类型——String
    雷林鹏分享:C# 类型转换
    雷林鹏分享:C# 运算符
    雷林鹏分享:C# 循环
    雷林鹏分享:C# 判断
    雷林鹏分享:C# 方法
  • 原文地址:https://www.cnblogs.com/evolve/p/9149954.html
Copyright © 2011-2022 走看看