如需注册 @ccie.engineer、@ccde.engineer、@ccar.engineer、@hcie.engineer、@rhce.engineer 和 @cissp.engineer 邮箱,请点击这里。 |
传送门:CCIE RS V5 考试 LAB1 实验详解:Section 1.1 VTP:https://ccie.lol/knowledge-base/ccie-rs-v5-lab1-section-1-1-vtp/
Section 1.2-Layer 2 ports

根据下列需求配置你的网络:
- 完成所有的 VLAN 配置,使得 ACME 总部(AS12345)和纽约办公室(AS34567)的所有路由器的直连能够全部 ping 通。(需求一)
- 四台交换机(SW1-SW4)的 Trunk 封装必须使用 dot1q,不能进行任何协商,也不能配置 etherchannel 。(需求二)
- 在四台交换机上,确保所有没有用到的接口全部 shutdown,并且设置成 access port,并划分到 vlan 999 。(需求三)
E3/0 – E3/3 在 SW1 和 SW2 上没有被使用
E1/0 – E1/3 在 SW3 和 SW4 上没有被使用
E3/0 – E3/3 在 SW3 和 SW4 上没有被使用
需求二:
为了让 VLAN 配置信息通过交换机间的 Trunk 链路和 VTP 协议被提前同步,请先配置需求二。
SW01/02/03/04(config)#int r e 2/0-3 —— 图2右下角显示 SW3 和 SW4 之间的 Trunk 链路是 e 2/0-3,其实 SW1 和 SW2 也是 SW01/02/03/04(config-if-range)#switchport trunk encapsulation dot1q SW01/02/03/04(config-if-range)#switchport mode trunk SW01/02/03/04(config-if-range)#switchport trunk nonegotiate —— IOU 没法敲上 这条命令
需求一:
该需求是让 AS 12345 和 AS 34567 的直连能 ping 通,那么我们先来看一下这两个 AS 的路由器是怎么连接的。

我们以 R1 和 R4 的连接为例子:根据图 1 所示,R1 连接 R4 使用的是 E0/2 口,R4 连接 R1 使用的是 E0/1 口,并且 R1 和 R4 之间是 VLAN 14 。然而并没有这么简单,我们接着看二层拓扑图。

如图 2 所示,这些路由器分别都跟两台交换机进行了连接,要想直连 ping 通,其实就是要在这四台交换机上划分 VLAN 。那么怎么在二层交换机上划分 VLAN 呢?我们综合分析一下:
如图 2 所示,R1 的 E0/2 口实际上是接到了 SW2 的 E0/0 口上,而 R4 的 E0/1 口实际上是接到了 SW1 的 E1/0 口上;所以我们需要把 SW2 的 E0/0 口和 SW1 的 E1/0 口分别划分到 VLAN 14,再建立 SW1 和 SW2 的 trunk 口,那么 R1 和 R4 之间就可以 ping 通了。
换言之,三层路由器之间的直连 ping 通,其实需要通过二层交换机来中转。
我们再捋一遍思路:根据图 2 我们知道:R1 E0/2 连接 R4 E 0/1;而根据图 2 我们知道,R1 连接到 R4 其实是这么连接的:R1 E0/2 → SW2 E 0/0 → SW1 和 SW2 的 trunk 链路 → SW1 E 1/0 → R4 E 0/1,所以 SW1 E 1/0 和 SW2 E 0/0 要划分到 VLAN 14(之所以是 VLAN 14,看图 1 的拓扑图)。
同理,R1 E0/1 连接 R5 E 0/1;而根据图 2 我们知道,R1 连接到 R5 其实是这么连接的:R1 E0/1 → SW1 E 0/0 → SW1 E 1/1 → R5 E 0/1,所以 SW1 E 0/0 和 SW1 E 1/1 要划分到 VLAN 15(之所以是 VLAN 15,看图 1 的拓扑图)。
当然,实际也不需要看得这么复杂,我们只要看几个点就可以完成这个配置:
- 先看图 2,发现 SW1 E 0/0 连接 R1 E 0/1,
- 再看图 1,发现 R1 E 0/1 位于 VLAN 15,
- 那么 SW1 E 0/0 划分到 VLAN 15;
- 接着再看图 2 中 SW1 的下一个接口 E 0/1:发现 SW1 E 0/1 连接 R2 E 0/1,
- 再看图 1,发现 R2 E 0/1 位于 VLAN 23,
- 那么 SW1 E 0/1 划分到 VLAN 23,以此类推……
现在我们根据上面的描述,来完成第一个需求:
SW01(config-if)#int r e 0/0-3 , e 1/0-3 SW01(config-if-range)#switchport mode access —— 先把交换机上所有连接到三层路 由器的接口批量设置为 access port SW01(config-if-range)#vlan 23,24,35,14,15,46,67,57,999 —— 再批量创建 AS 12345 上所有的 VLAN,注意!根据 section 1.1 我们知道:SW1 是 vtp server,SW2 是 vtp client,所以 SW2 将收到 SW1 的 VLAN 配置,那么 SW2 就不用配置 VLAN。当然 SW2 也配 置不上 VLAN,因为 SW2 是 vtp client。 SW01(config-vlan)#int e 0/0 SW01(config-if)#switchport access vlan 15 —— SW1 E 0/0 连接 R1 E 0/1,R1 E 0/1 位于 VLAN 15 SW01(config-if)# SW01(config-if)#int e 0/1 SW01(config-if)#switchport access vlan 23 —— SW1 E 0/1 连接 R2 E 0/1,R2 E 0/1 位于 VLAN 23 SW01(config-if)# SW01(config-if)#int e 0/2 SW01(config-if)#switchport access vlan 23 —— SW1 E 0/2 连接 R3 E 0/1,R3 E 0/1 位于 VLAN 23 SW01(config-if)# SW01(config-if)#int e 0/3 SW01(config-if)#switchport access vlan 24 —— SW1 E 0/3 连接 R4 E 0/0,R4 E 0/0 位于 VLAN 24 SW01(config-if)# SW01(config-if)#int e 1/0 SW01(config-if)#switchport access vlan 14 —— SW1 E 1/0 连接 R4 E 0/1,R4 E 0/1 位于 VLAN 14 SW01(config-if)# SW01(config-if)#int e 1/1 SW01(config-if)#switchport access vlan 15 —— SW1 E 1/1 连接 R5 E 0/1,R5 E 0/1 位于 VLAN 15 SW01(config-if)# SW01(config-if)#int e 1/2 SW01(config-if)#switchport access vlan 67 —— SW1 E 1/2 连接 R6 E 0/1,R6 E 0/1 位于 VLAN 67 SW01(config-if)# SW01(config-if)#int e 1/3 SW01(config-if)#switchport access vlan 67 —— SW1 E 1/3 连接 R7 E 0/1,R7 E 0/1 位于 VLAN 67
SW02(config-if)#int r e 0/0-3 , e 1/0-3 SW02(config-if-range)#switchport mode access SW02(config-if-range)# SW02(config-if-range)#int e 0/0 SW02(config-if)#switchport access vlan 14 SW02(config-if)# SW02(config-if)#int e 0/1 SW02(config-if)#switchport access vlan 24 SW02(config-if)# SW02(config-if)#int e 0/2 SW02(config-if)#switchport access vlan 35 SW02(config-if)# SW02(config-if)#int e 0/3 SW02(config-if)#switchport access vlan 46 SW02(config-if)# SW02(config-if)#int e 1/0 SW02(config-if)#switchport access vlan 35 SW02(config-if)# SW02(config-if)#int e 1/1 SW02(config-if)#switchport access vlan 57 SW02(config-if)# SW02(config-if)#int e 1/2 SW02(config-if)#switchport access vlan 46 SW02(config-if)# SW02(config-if)#int e 1/3 SW02(config-if)#switchport access vlan 57
SW03(config)#int r e 0/0-3
SW03(config-if-range)#switchport mode access
SW03(config-if-range)#
SW03(config-if-range)#vlan 89,38,49,34,310,411,111,999
—— 根据 section 1.1 我们知道:SW3 和 SW4 都是 vtp transparent,所以 SW3 和 SW4
都要划分 VLAN
SW03(config-vlan)#
SW03(config-vlan)#int e 0/0
SW03(config-if)#switchport access vlan 89
SW03(config-if)#
SW03(config-if)#int e 0/1
SW03(config-if)#switchport access vlan 49
SW03(config-if)#
SW03(config-if)#int e 0/2
SW03(config-if)#switchport access vlan 111
SW03(config-if)#
SW03(config-if)#int e 0/3
SW03(config-if)#switchport access vlan 411
SW04(config)#int r e 0/0-3
SW04(config-if-range)#switchport mode access
SW04(config-if-range)#
SW04(config-if-range)#vlan 89,38,49,34,310,411,111,999
—— 根据 section 1.1 我们知道:SW3 和 SW4 都是 vtp transparent,所以 SW3 和 SW4
都要划分 VLAN
SW04(config-vlan)#
SW04(config-vlan)#int e 0/0
SW04(config-if)#switchport access vlan 38
SW04(config-if)#
SW04(config-if)#int e 0/1
SW04(config-if)#switchport access vlan 89
SW04(config-if)#
SW04(config-if)#int e 0/2
SW04(config-if)#switchport access vlan 310
SW04(config-if)#
SW04(config-if)#int e 0/3
SW04(config-if)#switchport access vlan 111
需求三:
SW01/02(config)#int r e 3/0-3 SW01/02(config-if-range)#sw mo ac SW01/02(config-if-range)#sw ac vlan 999 SW01/02(config-if-range)#sh SW03/04(config)#int r e 3/0-3 , e 1/0-3 SW03/04(config-if-range)#sw mo ac SW03/04(config-if-range)#sw ac v 999 SW03/04(config-if-range)#sh
测试:
我们在 R1 上测试一下直连接口,先打开接口:
R01(config)#int r e 0/1-2 R01(config-if-range)#no sh R04/05(config)#int e 0/1 R04/05(config-if)#no sh
测试,R1 ping R4:
R01#p 123.10.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 123.10.1.1, timeout is 2 seconds: .!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
测试,R1 ping R5:
R01#p 123.10.1.6 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 123.10.1.6, timeout is 2 seconds: .!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
OK,其他的大家都可以分别测试一下,这里就不一一测试了。
这里给大家演示几个与本 section 有关的 show 命令:
SW01#show interfaces trunk —— 用来查看哪些接口起了 Trunk Port Mode Encapsulation Status Native vlan Et2/0 on 802.1q trunking 1 Et2/1 on 802.1q trunking 1 Et2/2 on 802.1q trunking 1 Et2/3 on 802.1q trunking 1 Port Vlans allowed on trunk Et2/0 1-4094 Et2/1 1-4094 Et2/2 1-4094 Et2/3 1-4094 Port Vlans allowed and active in management domain Et2/0 1,14-15,23-24,35,46,57,67,999 Et2/1 1,14-15,23-24,35,46,57,67,999 Et2/2 1,14-15,23-24,35,46,57,67,999 Et2/3 1,14-15,23-24,35,46,57,67,999 Port Vlans in spanning tree forwarding state and not pruned Et2/0 1,14-15,23-24,35,46,57,67,999 Et2/1 1,14-15,23-24,35,46,57,67,999 Et2/2 1,14-15,23-24,35,46,57,67,999 Port Vlans in spanning tree forwarding state and not pruned Et2/3 1,14-15,23-24,35,46,57,67,999 SW01#show vlan brief —— 用来查看 VLAN 的一些相关配置,比如哪些 VLAN 多配置了, 哪些少配置了,哪些接口在哪些 VLAN 下 VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Et4/0, Et4/1, Et4/2, Et4/3 Et5/0, Et5/1, Et5/2, Et5/3 14 VLAN0014 active Et1/0 15 VLAN0015 active Et0/0, Et1/1 23 VLAN0023 active Et0/1, Et0/2 24 VLAN0024 active Et0/3 35 VLAN0035 active 46 VLAN0046 active 57 VLAN0057 active 67 VLAN0067 active Et1/2, Et1/3 999 VLAN0999 active Et3/0, Et3/1, Et3/2, Et3/3 1002 fddi-default act/unsup 1003 trcrf-default act/unsup 1004 fddinet-default act/unsup 1005 trbrf-default act/unsup SW01#show interfaces ethernet 2/0 switchport Name: Et2/0 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On —— 这里可以检查 Trunk 协商是否关闭,根据需求是要关闭的, 但是 IOU 不支持这个命令,关闭命令是:switchport trunk nonegotiate Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk associations: none Administrative private-vlan trunk mappings: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Appliance trust: none
发表评论?