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端口

  • 相关阅读:
    75. 颜色分类
    排序链表
    两个数组的交集
    242. 有效的字母异位词
    排序优化
    622.设计循环队列
    比较含退格的字符串
    682.棒球比赛
    496.下一个更大的元素I
    线性排序算法
  • 原文地址:https://www.cnblogs.com/evolve/p/9149954.html
Copyright © 2011-2022 走看看