(4)在模式选择栏选择模拟操作模式,单击
图3.3 交换机端口配置界面
4.交换机命令行配置过程 (1)Switch0配置过程
Switch>enable;输入命令“enable”,进入特权模式。
Switch#configure terminal;特权模式下输入命令“configure terminal”,进入全局配置模式。 Switch(config)#vlan 2;创建VLAN,其编号为2。
Switch(config-vlan)#name vlan2;进入VLAN配置模式,为新创建的VLAN分配名字:vlan2。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。 Switch(config)#vlan 4;创建VLAN,其编号为4。
Switch(config-vlan)#name vlan4;进入VLAN配置模式,为新创建的VLAN分配名字:vlan4。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。
Switch(config)#interface FastEthernet0/1;进入接口配置模式,配置接口FastEthernet0/1。 Switch(config-if)#switchport access vlan 2;将接口FastEthernet0/1作为非标记端口分配给编号
为2的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/2;进入接口配置模式,配置接口FastEthernet0/2。 Switch(config-if)#switchport access vlan 2;将接口FastEthernet0/2作为非标记端口分配给编号
为2的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。
Switch(config)#interface FastEthernet0/3;进入接口配置模式,配置接口FastEthernet0/3。 Switch(config-if)#switchport access vlan 4;将接口FastEthernet0/3作为非标记端口分配给编号
为4的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/4;进入接口配置模式,配置接口FastEthernet0/4。 Switch(config-if)#switchport mode trunk;将接口FastEthernet0/4定义为标记端口。
Switch(config-if)#switchport trunk allowed vlan 2,4;vlan2和vlan4共享标记端口
FastEthernet0/4。
Switch(config-if)#exit;退回到全局配置模式。 (2)Switch1配置过程
Switch>enable;输入命令“enable”,进入特权模式。
Switch#configure terminal;特权模式下输入命令“configure terminal”,进入全局配置模式。 Switch(config)#vlan 2;创建VLAN,其编号为2。
Switch(config-vlan)#name vlan2;进入VLAN配置模式,为新创建的VLAN分配名字:vlan2。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。 Switch(config)#vlan 3;创建VLAN,其编号为3。
Switch(config-vlan)#name vlan3;进入VLAN配置模式,为新创建的VLAN分配名字:vlan3。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。 Switch(config)#vlan 4;创建VLAN,其编号为4。
Switch(config-vlan)#name vlan4;进入VLAN配置模式,为新创建的VLAN分配名字:vlan4。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。
Switch(config)#interface FastEthernet0/1;进入接口配置模式,配置接口FastEthernet0/1。 Switch(config-if)#switchport mode trunk;将接口FastEthernet0/1定义为标记端口。
Switch(config-if)#switchport trunk allowed vlan 2,4;vlan2和vlan4共享标记端口
FastEthernet0/1。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/2;进入接口配置模式,配置接口FastEthernet0/2。 Switch(config-if)#switchport mode trunk;将接口FastEthernet0/2定义为标记端口。
Switch(config-if)#switchport trunk allowed vlan 3,4;vlan3和vlan4共享标记端口
FastEthernet0/2。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/3;进入接口配置模式,配置接口FastEthernet0/3。 Switch(config-if)#switchport access vlan 2;将接口FastEthernet0/3作为非标记端口分配给编号
为2的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/4;进入接口配置模式,配置接口FastEthernet0/4。 Switch(config-if)#switchport access vlan 3;将接口FastEthernet0/4作为非标记端口分配给编号
为3的VLAN。
Switch(config-if)#exit;退回到全局配置模式。 (3)Switch2配置过程
Switch>enable;输入命令“enable”,进入特权模式。
Switch#configure terminal;特权模式下输入命令“configure terminal”,进入全局配置模式。 Switch(config)#vlan 3;创建VLAN,其编号为3。
Switch(config-vlan)#name vlan3;进入VLAN配置模式,为新创建的VLAN分配名字:vlan3。
Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。 Switch(config)#vlan 4;创建VLAN,其编号为4。
Switch(config-vlan)#name vlan4;进入VLAN配置模式,为新创建的VLAN分配名字:vlan4。 Switch(config-vlan)#exit;退出VLAN配置模式,重新回到全局配置模式。
Switch(config)#interface FastEthernet0/1;进入接口配置模式,配置接口FastEthernet0/1。 Switch(config-if)#switchport access vlan 4;将接口FastEthernet0/1作为非标记端口分配给编号
为4的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/2;进入接口配置模式,配置接口FastEthernet0/2。 Switch(config-if)#switchport access vlan 3;将接口FastEthernet0/2作为非标记端口分配给编号
为3的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/3;进入接口配置模式,配置接口FastEthernet0/3。 Switch(config-if)#switchport access vlan 3;将接口FastEthernet0/3作为非标记端口分配给编号
为3的VLAN。
Switch(config-if)#exit;退回到全局配置模式,以便进入另一个接口的接口配置模式。 Switch(config)#interface FastEthernet0/4;进入接口配置模式,配置接口FastEthernet0/4。 Switch(config-if)#switchport mode trunk;将接口FastEthernet0/4定义为标记端口。
Switch(config-if)#switchport trunk allowed vlan 3,4;vlan3和vlan4共享标记端口
FastEthernet0/4。
Switch(config-if)#exit;退回到全局配置模式。
实验五 静态路由配置实验
1、实验目的
(1)掌握路由器配置方法 (2)理解路由器工作原理
2、实验内容
(1)配置路由器。 (2)查看路由表。
(3)验证两个终端之间的连通性。
3.实验步骤
(1)如图所示拖放好实验网络中的各个设备:
(2)左键单击Router0的图标,在Physical选项卡下,单击右方实物图上的电源开关部分以关闭路由器,然后在左边找到WIC-2T,拖动到右边合适的空槽,打开电源。结果如图。依次操作,给Router1和Router2也加上这个设备以便路由器之间的连接。
(3)如图所示,用连线中的Copper Straight-Through把PC、交换机、路由器三者连接起来,连接的时候选的都是FastEthernet口。然后用Serial DCE把3个路由器之间互相连接起来,连接的时候选择Serial口。注意接口的编号,在后边配置的时候需要对应。