当前位置:文档之家› 第三层交换机配置

第三层交换机配置

第三层交换机配置设置PC1,PC2,PC3的IP地址:PC1IP: 192.168.1.2 Submark: 255.255.255.0 Gateway: 192.168.1.1 PC2IP: 192.168.2.2 Submark: 255.255.255.0 Gateway: 192.168.2.1 PC3IP: 192.168.1.3 Submark: 255.255.255.0 Gateway: 192.168.1.1 拓扑结果如下:2960-24TT switch0的配置:Switch>enSwitch#conf tSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#vlan 3Switch(config-vlan)#exitSwitch(config)#int fa 0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#int fa 0/3Switch(config-if)#switchport access vlan 3Switch(config-if)#exitSwitch(config)#int fa 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#Switch(config-if)#exitSwitch(config)#exitSwitch#Switch#show vlanS3560-24PS Multilayer Switch0的配置如下:Switch>enSwitch#conf tSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#vlan 3Switch(config-vlan)#exitSwitch(config)#int fa 0/1Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#int fa 0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#interSwitch(config)#interface vlan 2Switch(config-if)#Switch(config-if)#ip addSwitch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interSwitch(config)#interface vlan 3Switch(config-if)#Switch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exit ^Switch(config)#exitSwitch#Switch#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, Vlan2C 192.168.2.0/24 is directly connected, Vlan3Switch#show vlanVLAN Name Status Ports---- -------------------------------- ----------------------------------------1 default active Fa0/3, Fa0/4, Fa0/5,Fa0/6Fa0/7, Fa0/8, Fa0/9,Fa0/10Fa0/11, Fa0/12, Fa0/13, Fa0/14Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/24, Gig0/1, Gig0/22 VLAN0002 active Fa0/23 VLAN0003 active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 01003 tr 101003 1500 - - - - - 0 01004 fdnet 101004 1500 - - - ieee - 0 01005 trnet 101005 1500 - - - ibm - 0 0Remote SPAN VLANs------------------------------------------------------------------------------Primary Secondary Type Ports------- --------- -----------------------------------------------------------Switch#PC3 Ping PC1 的结果显示:Ping 192.168.1.2Packet Tracer PC Command Line 1.0PC>ping 192.168.1.2Pinging 192.168.1.2 with 32 bytes of data:Reply from 192.168.1.2: bytes=32 time=0ms TTL=128Reply from 192.168.1.2: bytes=32 time=15ms TTL=128Reply from 192.168.1.2: bytes=32 time=0ms TTL=128Reply from 192.168.1.2: bytes=32 time=0ms TTL=128Ping statistics for 192.168.1.2:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 15ms, Average = 3msPC3 Ping PC2的结果显示如下:PC>ping 192.168.2.2Pinging 192.168.2.2 with 32 bytes of data:Reply from 192.168.2.2: bytes=32 time=16ms TTL=127Reply from 192.168.2.2: bytes=32 time=0ms TTL=127Reply from 192.168.2.2: bytes=32 time=0ms TTL=127Reply from 192.168.2.2: bytes=32 time=0ms TTL=127Ping statistics for 192.168.2.2:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 16ms, Average = 4ms。

相关主题