当前位置:   article > 正文

Packet Tracer - 第 2 层 VLAN 安全_pt activity: layer 2 vlan security 第2层vlan的安全 topo

pt activity: layer 2 vlan security 第2层vlan的安全 topology diagram

Packet Tracer - 第 2 层 VLAN 安全

目标

·         在 SW-1 和 SW-2 之间连接新的冗余链路。

·         启用中继,并在 SW-1 和 SW-2 之间的新中继链路上 配置安全。

·         创建新的管理 VLAN (VLAN 20) 并将管理 PC 连接到 该 VLAN。

·         实施 ACL 以阻止外部用户访问 管理 VLAN。

拓扑图

背景/ 场景

目前,公司的网络使用两个 独立的 VLAN 进行设置:VLAN 5 和 VLAN 10。此外,使用本征 VLAN 15 配置 所有中继端口。网络管理员想要在 交换机 SW-1 和 SW-2 之间添加冗余链路。链路必须启用中继,并且所有 安全要求应实施到位。

此外,网络管理员想要将 管理 PC 连接到交换机 SW-A。管理员想要让 管理 PC 连接到所有交换机和路由器,但不想任何 其他设备连接到管理 PC 或交换机。出于管理目的, 管理员想要创建新的 VLAN 20。

所有设备都已采用以下信息进行预配置:

o    启用 加密密码:ciscoenpa55

o    控制台 密码:ciscoconpa55

o    SSH 用户名和密码:SSHadmin/ciscosshpa55

第 1 部分:验证 连接。

步骤 1:验证 C2 (VLAN 10) 和 C3 (VLAN 10) 之间的连接。

步骤 2:验证 C2 (VLAN 10) 和 D1 (VLAN 5) 之间的连接。

注意:如果使用简单的 PDU GUI 数据包,请确保执行 ping 操作两次以允许进行 ARP。

第 2 部分:创建 SW-1 和 SW-2 之间的冗余链路

步骤 1:连接 SW-1 和 SW-2。

使用交叉电缆,将 SW-1 上的端口 F0/23 连接到 SW-2 上的端口 F0/23。

步骤 2:启用中继,包括 SW-1 和 SW-2 之间的链路上的所有中继安全 机制。

已在所有现有 中继接口上配置了中继。必须为中继配置新的链路,包括所有 中继安全机制。在 SW-1 和 SW-2 上,将端口设置为 中继,将本征 VLAN 15 分配给中继端口,并禁用自动协商功能。

SW-1(config)#interface f0/23

SW-1(config-if)#switchport mode trunk

SW-1(config-if)#switchport trunk native vlan 15

SW-1(config-if)#switchport nonegotiate

SW-1(config-if)#no shutdown

SW-2(config)#interface f0/23

SW-2(config-if)#switchport mode trunk

SW-2(config-if)#switchport trunk native vlan 15

SW-2(config-if)#switchport nonegotiate

SW-2(config-if)#no shutdown

第 3 部分:启用 VLAN 20 作为管理 VLAN

网络管理员想要使用管理 PC 访问所有交换机和 路由设备。出于安全考虑,管理员 想要确保所有托管设备均位于单独的 VLAN 上。

步骤 1:在 SW-A 上启用管理 VLAN (VLAN 20)。

1.   在 SW-A 上启用 VLAN 20。

SW-A(config)#vlan 20

SW-A(config-vlan)#exit

2.     创建接口 VLAN 20 并分配 192.168.20.0/24 网络中的一个 IP 地址。

SW-A(config)#interface vlan 20

SW-A(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

SW-A(config-if)#ip address 192.168.20.1 255.255.255.0

步骤 2:在所有其他 交换机上启用同一个管理 VLAN。

1.     在以下所有交换机上创建管理 VLAN:SW-BSW-1SW-2 和 Central

SW-B(config)#vlan 20

SW-B(config-vlan)#exit

SW-1(config)#vlan 20

SW-1(config-vlan)#exit

SW-2(config)#vlan 20

SW-2(config-vlan)#exit

Central(config)#vlan 20

Central(config-vlan)#exit

2.    在所有交换机上创建接口 VLAN 20 并分配 192.168.20.0/24 网络中 的一个 IP 地址。

SW-B(config)#interface vlan 20

SW-B(config-if)#ip address 192.168.20.2 255.255.255.0

SW-1(config)#interface vlan 20

SW-1(config-if)#ip address 192.168.20.3 255.255.255.0

SW-2(config)#interface vlan 20

SW-2(config-if)#ip address 192.168.20.4 255.255.255.0

Central(config)#interface vlan 20

Central(config-if)#ip address 192.168.20.5 255.255.255.0

步骤 3:连接并配置管理 PC。

将管理 PC 连接到 SW-A 端口 F0/1 ,并确保向其分配了 192.168.20.0/24 网络中的可用 IP 地址。

步骤 4:在 SW-A 上,确保管理 PC 是 VLAN 20 的组成部分。

接口 F0/1 必须是 VLAN 20 的一部分。

SW-A(config)#interface f0/1

SW-A(config-if)#switchport access vlan 20

SW-A(config-if)#no shutdown

步骤 5:验证管理 PC 与所有 交换机的连接。

管理 PC 应能 ping 通 SW-ASW-B、 SW-1SW-2 和 Central

第 4 部分:启用 管理 PC 以访问路由器 R1

步骤 1:在路由器 R1 上启用新的子接口。

1.  创建子接口 g0/0.3 并将封装设置为 dot1q 20 以 用于 VLAN 20。

R1(config)#interface g0/0.3

R1(config-subif)#encapsulation dot1q 20

2.   分配 192.168.20.0/24 网络中的一个 IP 地址。

R1(config)#interface g0/0.3

R1(config-subif)#ip address 192.168.20.100 255.255.255.0

步骤 2:验证管理 PC 和 R1 之间的连接。

务必在管理 PC 上配置默认网关以允许连接。

步骤 3:启用安全性。

虽然管理 PC 必须能够访问路由器, 但是其他 PC 不能访问管理 VLAN。

1.     创建一个只允许管理 PC 访问路由器的 ACL。

R1(config)#access-list 101 deny ip any 192.168.20.0 0.0.0.255

R1(config)# access-list 101 permit ip any any

R1(config)#access-list 102 permit ip host 192.168.20.6 any

2.     将该 ACL 应用到正确的接口。

R1(config)#interface g0/0.1

R1(config-subif)#ip access-group 101 in

R1(config-subif)#interface g0/0.2

R1(config-subif)#ip access-group 101 in

R1(config-subif)#line vty 0 4

R1(config-line)#access-class 102 in

注意:可以通过多种方式创建 ACL 以实现必要的安全性。因此,对此练习的 这一部分进行评分时基于正确的连接要求。 管理 PC 必须能够连接到所有交换机和路由器。所有 其他 PC 都不能连接到管理 VLAN 中的任何设备。

步骤 4:验证安全。

a.     验证只有管理 PC 可访问路由器。使用 SSH 访问 R1 ,使用用户名 SSHadmin 和密码 ciscosshpa55

PC> ssh -l SSHadmin 192.168.20.100

  1.      从管理 PC ping 通 SW-ASW-B 和 R1。 ping 操作是否成功?说明原因。

ping 应该已成功,因为 192.168.20.0 网络中的所有设备都应该能够相互 ping 操作。VLAN20 中的设备不需要通过路由器进行路由。

2.   从 D1 ping 通管理 PC。ping 操作是否成功? 说明原因。

ping 应该失败,因为要使不同 VLAN 中的设备成功 ping VLAN20 中的设备,必须对其进行路由。路由器具有阻止所有数据包访问 192.168.20.0 网络的 ACL

步骤 5:检查结果。

完成比例应为 100%。点击 Check Results(检查结果)以查看反馈并验证已完成的所需组件。

如果所有组件似乎都是正确的,但练习 仍显示未完成,则可能是由于验证 ACL 工作原理的连接测试 造成的。

实验具体步骤:

SW-1:

  1. SW-1>en
  2. Password:
  3. SW-1#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. SW-1(config)#interface f0/23
  6. SW-1(config-if)#switchport mode trunk
  7. SW-1(config-if)#switchport trunk native vlan 15
  8. SW-1(config-if)#switchport nonegotiate
  9. SW-1(config-if)#no shutdown
  10. %LINK-5-CHANGED: Interface FastEthernet0/23, changed state to down
  11. SW-1(config-if)#exit
  12. SW-1(config)#vlan 20
  13. SW-1(config-vlan)#exit
  14. SW-1(config)#interface vlan 20
  15. SW-1(config-if)#
  16. %LINK-5-CHANGED: Interface Vlan20, changed state to up
  17. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
  18. SW-1(config-if)#ip address 192.168.20.3 255.255.255.0
  19. SW-1(config-if)#exit
  20. SW-1(config)#end
  21. SW-1#
  22. %SYS-5-CONFIG_I: Configured from console by console
  23. SW-1#wr
  24. Building configuration...
  25. [OK]
  26. SW-1#

SW-2:

  1. SW-2>en
  2. Password:
  3. SW-2#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. SW-2(config)#interface f0/23
  6. SW-2(config-if)#switchport mode trunk
  7. SW-2(config-if)#switchport trunk native vlan 15
  8. SW-2(config-if)#switchport nonegotiate
  9. SW-2(config-if)#no shutdown
  10. %LINK-5-CHANGED: Interface FastEthernet0/23, changed state to down
  11. SW-2(config-if)#exit
  12. SW-2(config)#vlan 20
  13. SW-2(config-vlan)#exit
  14. SW-2(config)#interface vlan 20
  15. SW-2(config-if)#
  16. %LINK-5-CHANGED: Interface Vlan20, changed state to up
  17. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
  18. SW-2(config-if)#ip address 192.168.20.4 255.255.255.0
  19. SW-2(config-if)#exit
  20. SW-2(config)#end
  21. SW-2#
  22. %SYS-5-CONFIG_I: Configured from console by console
  23. SW-2#wr
  24. Building configuration...
  25. [OK]
  26. SW-2#

SW-A:

  1. SW-A>en
  2. Password:
  3. SW-A#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. SW-A(config)#interface f0/1
  6. SW-A(config-if)#switchport access vlan 20
  7. SW-A(config-if)#no shutdown
  8. SW-A(config-if)#
  9. %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
  10. %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
  11. SW-A(config-if)#exit
  12. SW-A(config)#end
  13. SW-A#
  14. %SYS-5-CONFIG_I: Configured from console by console
  15. SW-A#wr
  16. Building configuration...
  17. [OK]
  18. SW-A#

SW-B:

  1. SW-B>en
  2. Password:
  3. SW-B#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. SW-B(config)#vlan 20
  6. SW-B(config-vlan)#exit
  7. SW-B(config)#interface vlan 20
  8. SW-B(config-if)#
  9. %LINK-5-CHANGED: Interface Vlan20, changed state to up
  10. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
  11. SW-B(config-if)#ip address 192.168.20.2 255.255.255.0
  12. SW-B(config-if)#exit
  13. SW-B(config)#end
  14. SW-B#
  15. %SYS-5-CONFIG_I: Configured from console by console
  16. SW-B#wr
  17. Building configuration...
  18. [OK]
  19. SW-B#

Central:

  1. Central>en
  2. Password:
  3. Central#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. Central(config)#vlan 20
  6. Central(config-vlan)#exit
  7. Central(config)#interface vlan 20
  8. Central(config-if)#
  9. %LINK-5-CHANGED: Interface Vlan20, changed state to up
  10. %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
  11. Central(config-if)#ip address 192.168.20.5 255.255.255.0
  12. Central(config-if)#exit
  13. Central(config)#end
  14. Central#
  15. %SYS-5-CONFIG_I: Configured from console by console
  16. Central#wr
  17. Building configuration...
  18. [OK]
  19. Central#

R1:

  1. R1>en
  2. Password:
  3. R1#conf t
  4. Enter configuration commands, one per line. End with CNTL/Z.
  5. R1(config)#interface g0/0.3
  6. R1(config-subif)#
  7. %LINK-5-CHANGED: Interface GigabitEthernet0/0.3, changed state to up
  8. %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.3, changed state to up
  9. R1(config-subif)#encapsulation dot1q 20
  10. R1(config-subif)#ip address 192.168.20.100 255.255.255.0
  11. R1(config-subif)#exit
  12. R1(config)#access-list 101 deny ip any 192.168.20.0 0.0.0.255
  13. R1(config)# access-list 101 permit ip any any
  14. R1(config)#access-list 102 permit ip host 192.168.20.6 any
  15. R1(config)#interface g0/0.1
  16. R1(config-subif)#ip access-group 101 in
  17. R1(config-subif)#interface g0/0.2
  18. R1(config-subif)#ip access-group 101 in
  19. R1(config-subif)#line vty 0 4
  20. R1(config-line)#access-class 102 in
  21. R1(config-line)#exit
  22. R1(config)#end
  23. R1l#
  24. %SYS-5-CONFIG_I: Configured from console by console
  25. R1#wr
  26. Building configuration...
  27. [OK]
  28. R1#

实验脚本:

SW-1

  1. en
  2. ciscoenpa55
  3. conf t
  4. interface f0/23
  5. switchport mode trunk
  6. switchport trunk native vlan 15
  7. switchport nonegotiate
  8. no shutdown
  9. exit
  10. vlan 20
  11. exit
  12. interface vlan 20
  13. ip address 192.168.20.3 255.255.255.0
  14. exit
  15. end
  16. wr

SW-2

  1. en
  2. ciscoenpa55 
  3. conf t
  4. interface f0/23
  5. switchport mode trunk
  6. switchport trunk native vlan 15
  7. switchport nonegotiate
  8. no shutdown
  9. exit
  10. vlan 20
  11. exit
  12. interface vlan 20
  13. SW-2(config-if)#
  14. ip address 192.168.20.4 255.255.255.0
  15. exit
  16. end
  17. wr

SW-A

  1. en
  2. ciscoenpa55
  3. conf t
  4. interface f0/1
  5. switchport access vlan 20
  6. no shutdown
  7. exit
  8. end
  9. wr

SW-B

  1. en
  2. ciscoenpa55
  3. conf t
  4. vlan 20
  5. exit
  6. interface vlan 20
  7. ip address 192.168.20.2 255.255.255.0
  8. exit
  9. end
  10. wr

Central

  1. en
  2. ciscoenpa55
  3. conf t
  4. vlan 20
  5. exit
  6. interface vlan 20
  7. ip address 192.168.20.5 255.255.255.0
  8. exit
  9. end
  10. wr

R1:

  1. en
  2. ciscoenpa55
  3. conf t
  4. interface g0/0.3
  5. encapsulation dot1q 20
  6. ip address 192.168.20.100 255.255.255.0
  7. exit
  8. access-list 101 deny ip any 192.168.20.0 0.0.0.255
  9. access-list 101 permit ip any any
  10. access-list 102 permit ip host 192.168.20.6 any
  11. interface g0/0.1
  12. ip access-group 101 in
  13. interface g0/0.2
  14. ip access-group 101 in
  15. line vty 0 4
  16. access-class 102 in
  17. exit
  18. end
  19. wr

实验链接:https://pan.baidu.com/s/1FaSOwXenBEfxN3SX-0Rw4w?pwd=6313

提取码:6313

--来自百度网盘超级会员V2的分享

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/477288
推荐阅读
相关标签
  

闽ICP备14008679号