思科模拟器:通过一台三层交换机及两台二层交换机和6台电脑划分3个VLAN,并建立三个网关让电脑之间互通

实验内容:通过一台三层交换机及两台二层交换机和6台电脑划分3个VLAN,并建立三个网关让电脑之间互通

实验工具:Cisco Packet Tracer 6.0

使用设备:

电脑六台(电脑1、电脑2、电脑3、电脑4、电脑5、电脑6、):

 

2950-24二层交换机两台(二层交换机1、二层交换机2):

 

3650-24PS三层交换机一台(三层交换机):

 

连接图:通过直连线将电脑于与交换机连接,通过交叉线将二层交换机与三层交换机连接

注:

电脑1的FastEthernet0接口连二层交换机1的FastEthernet0/1接口

电脑2的FastEthernet0接口连二层交换机1的FastEthernet0/2接口

电脑3的FastEthernet0接口连二层交换机2的FastEthernet0/1接口

电脑4的FastEthernet0接口连二层交换机2的FastEthernet0/2接口

电脑5的FastEthernet0接口连三层交换机的FastEthernet0/3接口

电脑6的FastEthernet0接口连三层交换机的FastEthernet0/4接口

二层交换机1的FastEthernet0/24接口连三层交换机的FastEthernet0/1接口

二层交换机2的FastEthernet0/24接口连三层交换机的FastEthernet0/2接口

 

实验步骤:

1.点击电脑1,切换到【桌面】界面,进行如图所以的IP配置

 

2.点击电脑2,切换到【桌面】界面,进行如图所以的IP配置

 

同样的操作,点击剩下的电脑,进行如下配置

电脑3:

 

电脑4:

 

电脑5:

 

电脑6:

 

3.点击二层交换机1,切换到【命令行】界面,按回车开始输入命令行,完整代码如下:

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#int fa0/1

Switch(config-if)#sw ac vl 10

Switch(config-if)#vlan 20

Switch(config-vlan)#int fa0/2

Switch(config-if)#sw ac vl 20

Switch(config-if)#int fa0/24

Switch(config-if)#sw mo tr

 

4.点击二层交换机2,切换到【命令行】界面,同二层交换机1相同命令:

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#int fa0/1

Switch(config-if)#sw ac vl 10

Switch(config-if)#vlan 20

Switch(config-vlan)#int fa0/2

Switch(config-if)#sw ac vl 20

Switch(config-if)#int fa0/24

Switch(config-if)#sw mo tr

 

5.点击二层交换机3,切换到【命令行】界面,输入以下命令:

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#int vlan 20

Switch(config-if)#no sh

Switch(config-if)#ip add 192.168.20.254 255.255.255.0

Switch(config-if)#int vlan 10

Switch(config-if)#ip add 192.168.10.254 255.255.255.0

Switch(config-if)#int vlan 30

Switch(config-if)#ip add 192.168.30.254 255.255.255.0

Switch(config-if)#exit

Switch(config)#ip routing

Switch(config)#vlan 10

Switch(config-vlan)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-vlan)#vlan 20

Switch(config-vlan)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-vlan)#vlan 30

Switch(config-vlan)#

%LINK-5-CHANGED: Interface Vlan30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up

Switch(config)#int fa0/3

Switch(config-if)#sw ac vl 20

Switch(config-if)#no sh

Switch(config-if)#int fa0/4

Switch(config-if)#sw ac vl 30

Switch(config-if)#no sh

 

 

7.此时,我们打开任意一台电脑的【命令行】界面,ping任意一台电脑的IP地址,均应该成功:(我们以电脑3来ping电脑6的IP地址为例)

 

猜你喜欢

转载自blog.csdn.net/qq_37400312/article/details/64440410