任务四使用vlantrunk技术实现跨交换机的vlan内的通信内容摘要:

1 . 3P C 3I P : 1 9 2 . 1 6 8 . 1 . 4P C 4I P : 1 9 2 . 1 6 8 . 1 . 5P C 6I P : 1 9 2 . 1 6 8 . 1 . 7P C 5I P : 1 9 2 . 1 6 8 . 1 . 6V l a n 1 0 0V l a n 2 0 0 V l a n 3 0 0 V l a n 1 0 0V l a n 2 0 0 V l a n 3 0 0F 0 / 1 F 0 / 2F 0 / 3 F 0 / 1 F 0 / 2 F 0 / 3F 0 / 1 2 F 0 / 1 2 PC 机的 IP 和端口对照表: 交换机名 端口名 PC 机 IP 地址 switchA FastEther0/1(fa0/1) PC1 FastEther0/2(fa0/2) PC2 FastEther0/3(fa0/3) PC3 switchB FastEther0/1(fa0/1) PC4 FastEther0/2(fa0/2) PC5 FastEther0/3(fa0/3) PC6 switchA 的 Fa0/12 端口与 switchB 的 Fa0/12 端口相连 根据网络拓朴 和以上的对照表 搭建好网络环境。 分别给 6 台 PC 机 配置好 IP地址,注意是同一网段, PC 机不用设置网关和 DNS 服务器 IP,只要设 IP 地址和子网掩码就可以。 6 台 PC 机 互相 ping 一下,应该是互通的。 配置交换机 A 和B,配置命令如下: 交换机 A 的配置: 把端口 1 加入 VLAN 100,端口 2 加入 VLAN 200,端口 12 配置为 trunk 模式。 Switchen Switchconf t Enter configuration mands, one per line. End with CNTL/Z. Switch(config)host SA SA(config)vlan 100 SA(configvlan)exit SA(config)vlan 200 SA(configvlan)exit SA(config)vlan 300 SA(configvlan)exit SA(config)int f0/1 SA(configif)swi acc vlan 100 SA(configif)exit SA(config)int f0/2 SA(configif)swi acc vlan 200 SA(configif)exit SA(config)int f0/3 SA(configif)swi acc vlan 300 SA(configif)exit SA(config)int f0/12 SA(configif)swi mode trunk %LINEPROTO5UPDOWN: Line protocol on Interface FastEther0/12, changed state to down %LINEPROTO5UPDOWN: Line protocol on Interface FastEther0/12, changed state to up SA(configif)end %SYS5CONFIG_I: Configured from console by console 交换机 B 的配置: 把端口 1 加入 VLAN 100,端口 2 加入 VLAN 200,端口 12 配置为 trunk 模式 Switchen Switchconf t Enter configuration mands, one per line. End with CNTL/Z. Switch(config)host SB SB(config)vlan 100 SB(configvlan)exit SB(config)vlan 200 SB(configvlan)exit SB(config)vlan 300 SB(configvlan)exit SB(config)int f0/1 SB(configif)swi acc vlan 100 SB(configif)exit SB(config)int f0/2 SB(configif)swi acc vlan 200 SB(configif)exit SB(config)int f0/3 SB(configif)swi acc vlan 300 SB(configif)exit SB(config)int f0/12 SB(configif)swi mode trunk SB(configif)end %SYS5CONFIG_I: Configured from console by console 测试结果: 同一 VLAN 下的连接到不同交换机的计算机可以互相 ping 通,不同 VLAN 下的计算机互相 ping 不通。 即 PC1 和 PC4 能 ping 通, PC2 和 PC5 能 ping 通, PC3 和PC6 能 ping 通,其他组合均 ping 不通。 以 PC1( IP: )为例进行测试,测试过程如下: 1. ping 同交换机 SA 不同 VLAN 的计算 机 PC2: ping ,不通。 2. ping 同交换机 SA 不同 VLAN 的计算 机 PC3: ping ,不通。 3. ping 另一交换机 SB 相同 VLAN 的计算 机 PC4: ping ,通。 4. ping 另一交换机 SB 不同 VLAN 的计算 机 PC5: ping ,不通。 5. ping 另一交换机 SB 不同 VLAN 的计算 机 PC6: ping ,不通。 注意事项: ( 1)如果同一 VLAN 下的计算机互相 ping 不通,先用 show ip int brief 命令查看交换机端口信息,看 3 个端口的状态是否是 up 的,如下所示。 SAshow ip int brief Interface IPAddress OK? Method Status Protocol FastEther0/1 unassigned YES unset up up FastEther0/2 unassigned YES unset up up FastEther0/3 unassigned YES unset up up FastEther0/4 unassigned YES unset down down FastEther0/5 unassigned YES unset down down FastEther0/6 unassigned YES unset down down FastEther0/7 unassigned YES unset down down FastEther0/8 unassigned YES unset down down FastEther0/9 unassigned YES unset down down FastEther0/10 unassigned YES unset down down FastEther0/11 unassigned YES unset down down FastEther0/12 unassigned YES unset up up Vlan1 unassigned YES manual administratively down down SBshow ip int brief Interface IPAddress OK? Method Status Protocol FastEther0/1 unassigned YES unset up up FastEther0/2 unassigned YES unset up up FastEther0/3 unassigned YES unset up up FastEther0/4 unassigned YES unset down down FastEther0/5 unassigned YES unset down down FastEther0/6 unassigned YES unset down down FastEther0/7 unassigned YES unset down down FastEther0/8 unassigned YES unset down down FastEther0/9 unassigned YES unset down down FastEther0/10 unassigned YES unset down down FastEther0/11 unassigned YES unset down down FastEther0/12 unassigned YES unset up up Vlan1 unassigned YES manual administratively down down ( 2)如果端口状态没问题,则用 show vlan 命令查看交换机的端口 vlan 划分是否正确,如下所示。 SAshow vlan VLAN Name Status Ports 1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。