您的位置:首页 > 其它

三层交换机的路由功能实现VALN间通信

2016-12-22 18:54 344 查看
交换机是交换数据,只能识别MAC地址,而交换机可以转发数据包,能够识别IP地址,所以能够转发数据包。而三层交换机的也有路由功能,所以也能转发数据包。今天这堂课就有三层交换机实现不同vlan间通信来加以验证。
器材:三层交换机一台,二层交换机一台。电脑三台,带水晶头双绞线若干。 过程: 1:连线,把PC1,PC2分别连到三层交换机的fa0/1,fa0/6.把PC3连到二层交换机fa0/1。再用一根线一端连到二层交换机的fa0/10,另一端连到三层交换机fa0/10.
2:对交换机进行配置:
二层交换机的配置Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#int fa0/10Switch(config-if)#sw mode accSwitch(config-if)#sw mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to upSwitch(config-if)#exSwitch(config)#vlan 10Switch(config-vlan)#exSwitch(config)#int fa0/1Switch(config-if)#sw acc vlan 10Switch(config-if)#exSwitch(config)#host 2chensw三层交换机的配置Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#host 3chensw3chensw(config)#vlan 103chensw(config-vlan)#exi3chensw(config)#vlan 203chensw(config-vlan)#ex3chensw(config)#int fa0/13chensw(config-if)#sw acc vlan 103chensw(config-if)#ex3chensw(config)#int fa0/23chensw(config-if)#sw acc vlan 203chensw(config-if)#ex3chensw(config)#int fa0/103chensw(config-if)#sw mode trunkCommand rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.3chensw(config-if)#sw mode acc3chensw(config-if)#sw mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to up3chensw(config-if)#int vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up3chensw(config-if)#ip add 10.10.10.254 255.255.255.03chensw(config-if)#no shut3chensw(config-if)#ex3chensw(config)#int vlan 20%LINK-5-CHANGED: Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up3chensw(config-if)#ip add 20.20.20.254 255.255.255.03chensw(config-if)#no shut3:PC1,PC2,PC3的IP分别设为:10.10.10.1,20.20.20.1,10.10.10.2.4:测试:用PC1分别PING PC2,PC3.PC>ping 10.10.10.2Pinging 10.10.10.2 with 32 bytes of data:Reply from 10.10.10.2: bytes=32 time=32ms TTL=128Reply from 10.10.10.2: bytes=32 time=13ms TTL=128Reply from 10.10.10.2: bytes=32 time=18ms TTL=128Ping statistics for 10.10.10.2:Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 13ms, Maximum = 32ms, Average = 21msPC>ping 20.20.20.1Pinging 20.20.20.1 with 32 bytes of data:Request timed out.Reply from 20.20.20.1: bytes=32 time=5ms TTL=127Reply from 20.20.20.1: bytes=32 time=3ms TTL=127Reply from 20.20.20.1: bytes=32 time=3ms TTL=127 验证完成,PC1,PC2间实现了 VLAN10和 VALN 20 之间的通信,以及通过设配串口fa0/10,实现在跨交换机之间通信。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息