实验器材:STAR-3550-24两台,直通双绞线3根,PC机(winXP)2台。
1. 首先为PC1和PC2分配IP地址
PC1:\>ipconfig
Windows IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.1.10.8
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
PC2:\ >ipconfig
Windows IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.1.10.9
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
2. 将两台交换机相连,连接时应该使用交叉线,在RACK实验室中,只需要用一根直通线将配线架上的S124(S1的F0/24端口)和S224(S2的F0/24端口)相连即可。
3. 在S1上创建VLAN2,并将F0/1端口加入到VLAN2中,设置F0/24端口模式为Trunk;
在S2上创建VLAN2,并将F0/1端口加入到VLAN2中,设置F0/24端口模式为Trunk
s1#config t
s1(config)#vlan 2
s1(config-vlan)#exit
s1(config)#int f0/1
s1(config-if)#switchport access vlan 2
s1(config-if)#int f0/24
s1(config-if)#switchport mode trunk
S2上的配置过程参照S1
4. 在PC2上做测试 ping PC1
PC2:\>ping 10.1.10.8
Pinging 10.1.10.8 with 32 bytes of data:
Reply from 10.1.10.8: bytes=32 time<1ms TTL=64
Reply from 10.1.10.8: bytes=32 time<1ms TTL=64
Reply from 10.1.10.8: bytes=32 time<1ms TTL=64
Reply from 10.1.10.8: bytes=32 time<1ms TTL=64
Ping statistics for 10.1.10.8:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
5. 总结:
- 相同VLAN上的通信无须通过SVI接口的地址。
- 只需要将两台交换机上的端口划分给相同的VLANID,IP地址属于相同的网段,即PC1和PC2所在的网络地址相同即可。
- 交换机之间连接的端口F0/24模式应该设置为Trunk模式。