• 实验一:单臂路由+端口安全


    实验一:单臂路由+端口安全

    实验拓扑:

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ILJWU469-1661844565173)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg)]

    实验需求:

    1.网络配通(PC1和PC4 ping通,PC1和RTA ping通)

    2.SWB和SWC配置端口安全。

    配置内容:

    第一部分配置单臂路由,使得网络互通。

    PC1

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Sf1XdYj9-1661844565175)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg)]

    PC2

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qshmKQXp-1661844565175)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg)]

    PC3

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RftLNids-1661844565176)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image008.jpg)]

    PC4

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WDiqeZgs-1661844565177)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image010.jpg)]

    SWB

    #
    
    vlan batch 10 20
    
    #
    
    interface GigabitEthernet0/0/1
    
     port link-type access
    
     port default vlan 10
    
    #
    
    interface GigabitEthernet0/0/2
    
     port link-type access
    
     port default vlan 10
    
    #
    
    interface GigabitEthernet0/0/3
    
     port link-type trunk
    
     port trunk allow-pass vlan 10 20
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28

    SWC

    #
    
    vlan batch 10 20
    
    #
    
    interface GigabitEthernet0/0/1
    
     port link-type access
    
     port default vlan 20
    
    #
    
    interface GigabitEthernet0/0/2
    
     port link-type access
    
     port default vlan 20
    
    #
    
    interface GigabitEthernet0/0/3
    
     port link-type trunk
    
     port trunk allow-pass vlan 10 20
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28

    SWA

    **#**
    
    vlan batch 10 20
    
    \#
    
    interface GigabitEthernet0/0/1
    
     port link-type trunk
    
     port trunk allow-pass vlan 10 20
    
    \#
    
    interface GigabitEthernet0/0/2
    
     port link-type trunk
    
     port trunk allow-pass vlan 10 20
    
    \#
    
    interface GigabitEthernet0/0/3
    
     port link-type trunk
    
     port trunk allow-pass vlan 10 20
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28

    RTA

    #
    
    interface GigabitEthernet0/0/0.1
    
     dot1q termination vid 10
    
     ip address 192.168.1.254 255.255.255.0 
    
     arp broadcast enable
    
    #
    
    interface GigabitEthernet0/0/0.2
    
     dot1q termination vid 20
    
     ip address 192.168.2.254 255.255.255.0 
    
     arp broadcast enable
    
    #
    
    interface LoopBack1
    
     ip address 1.1.1.1 255.255.255.255 
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27

    第二部分在SWB SWC 上配置端口安全

    接入终端接口启动端口安全sticky,最多安全MAC地址数量为1,超过后限制动作shutdown

    //粘性(stickymac地址是端口安全的一种应用,顾名思义,就是将交换机端口发现的对端设备的 mac 地址粘贴到 mac-address-table中,省的管理员一个个输入进去了。

    SWB

    port-group group-member GE0/0/1 to GE0/0/2
    
    port-security enable
    
    port-security mac-address sticky 
    
    port-security protect-action shutdown 
    
    port-security max-mac-num 1
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    SWC

    port-group group-member GE0/0/1 to GE0/0/2
    
    port-security enable
    
    port-security mac-address sticky 
    
    port-security protect-action shutdown 
    
    port-security max-mac-num 1
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    验证:

    1. PC1 ping 自己的网关地址:ping 192.168.1.254;

    PC1 ping PC2、PC3、PC4;测试连通性。

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jUykNNJ8-1661844565178)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image012.jpg)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lIlrfTLN-1661844565179)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image014.jpg)]

    2. PC1 ping RTA 上的Loop1地址 1.1.1.1

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yUuUV0tg-1661844565179)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image016.jpg)]

    3. 在SWB 和 SWC 上查看 sticky 地址截图。

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QLNVLPoe-1661844565180)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image018.jpg)]

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KZ1UNRa7-1661844565181)(file:///C:/Users/HAO/AppData/Local/Temp/msohtmlclip1/01/clip_image020.jpg)]

  • 相关阅读:
    Android Banner - ViewPager 02
    【日记】文章更新计划
    如何预防最新的Mallox变种malloxx勒索病毒感染您的计算机?
    Hadoop中SecondaryNameNode工作机制
    Airtest:各平台的剪切板功能汇总
    OS2.3.9:读者-写者问题
    德迅云安全和您聊聊关于DDOS高防ip的一些方面
    OceanBase 社区版 Docker 镜像存在的必要性
    【C刷题】day4
    vue3导出表格(导出成Execl表)
  • 原文地址:https://blog.csdn.net/Quiet_Superman/article/details/126605266