1、实验一 一. 实验拓扑图 二. 实验要求 1、 在两台2950交换机上创立VLAN10、VLAN20、VLAN30和VLAN40。 2、 把两个交换机上的interface f0/21 分配给VLAN10,interface f0/22 分配给VLAN20,interface f0/23 分配给VLAN30,interface f0/24 分配给VLAN40。 3、 每台交换机的interface f0/5 配置为两台交换机的中继端口,实现VLAN数据传输。 4、 配置两台交换机的interface f0/1 ,interface f0/2 的端口做以太通道中继线路。 三.网
2、络接口 2950A接口1<--à2950B接口1 2950A接口2<--à2950B接口2 2950A接口5<--à2950B接口5 四.实验配置 2950交换机的配置: Switch>en //进入特权模式 Switch#config t //进入全局配置模式 Switch(config)#hostname 2950A //设置主机名为2950A 2950A(config)#no ip do lo
3、 //关闭域名解析功能 2950A(config)#line con 0 //进入控制线0 2950A(config-line)#logg syn //光标同步 2950A(config-line)#exec-time 0 0 //对Console口进行空闲超时时间的配置 2950A(config-line)#exit // 返回全局配置模式 2950A(config)#end //返
4、回特权模式 2950A#vlan database //进入VLAN数据库 2950A(vlan)#vlan 10 //创建VLAN10 VLAN 10 added: Name: VLAN0010 2950A(vlan)#vlan 20 //创建VLAN20 VLAN 20 added: Name: VLAN0020 2950A(vlan)#vlan 30 //创建VLAN30 VLAN 30 added: Na
5、me: VLAN0030 2950A(vlan)#vlan 40 //创建VLAN40 VLAN 40 added: Name: VLAN0040 2950A(vlan)#exit //退出 APPLY completed. Exiting.... //将端口划分到vlan里 2950A#conf t //进入端口配置模式 2950A(config)#int fa0/21 //进入fa0/21接口 29
6、50A(config-if)#switchport mode access //配置接口模式为access 2950A(config-if)#switchport access vlan 10 //把fa0/21加入VLAN10 2950A(config-if)#no shutdown //开启接口 2950A(config-if)#exit //退出 2950A(config)#int fa0/22
7、 //进入fa0/22接口 2950A(config-if)#switchport mode access //配置接口模式为access 2950A(config-if)#switchport access vlan 20 //把fa0/22加入VLAN20 2950A(config-if)#no shutdown //开启接口 2950A(config-if)#exit //退出 2950A(config)#int fa0/23
8、 //进入fa0/23接口 2950A(config-if)#switchport mode access //配置接口模式为access 2950A(config-if)#switchport access vlan 30 //把fa0/23加入VLAN30 2950A(config-if)#no shutdown //开启接口 2950A(config-if)#exit //退出 2950A(config)#int fa0/24
9、 //进入fa0/24接口 2950A(config-if)#switchport mode access //配置接口模式为access 2950A(config-if)#switchport access vlan 40 //把fa0/24加入VLAN40 2950A(config-if)#no shutdown //开启接口 2950A(config-if)#exit //退出 //做干道 2950A(config
10、)#int fa0/5 // 进入fa0/5接口 2950A(config-if)#switchport mode trunk //配置接口模式为trunk 2950A(config-if)#switchport trunk encapsulation dot1q //配置封装协议 2950A(config-if)#no shutdown //开启接口 2950A(config-if)#exit //退出 //做以太
11、通道中继线路 2950A(config)#int range fa0/1 – 2 //进入fa0/1 和fa0/ 2接口 2950A(config-if-range)#channel-group 1 mode on // 配置二层的端口汇聚 Creating a port-channel interface Port-channel1 //创建以太通道的接口 2950A(config-if-range)#no shutdown //开启接口 2950A(config-if-range)#exit
12、 //返回全局配置模式 2950A(config)#end //退出 2950A#show running-config //查看配置情况 Building configuration... Current configuration : 1079 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption
13、 hostname 2950A ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 ! ! ip cef ! ! no ip domain lookup ! ! ! ! ! interface Port-channel1 ! interface FastEthernet0/0 ! interface FastEthernet0/1 channel-group 1 mode on ! interface FastEthe
14、rnet0/2 channel-group 1 mode on ! interface FastEthernet0/3 ! interface FastEthernet0/4 ! interface FastEthernet0/5 switchport mode trunk ! interface FastEthernet0/6 ! 2950A#show running-config Building configuration... Current configuration : 1079 bytes ! version 12
15、4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname 2950A ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 ! ! ip cef ! ! no ip domain lookup ! ! ! ! ! interface Port-cha
16、nnel1 2950B交换机的配置: Switch>en //进入特权模式 Switch#conf t //进入全局配置模式 Switch(config)#hostname 2950B //设置主机名为2950B 2950B(config)#no ip do lo //关闭域名解析功能 2950B(config)#line con 0 //进入控制线0 2950B(config-line)#logg sy
17、n //光标同步 2950B(config-line)#exec-time 0 0 //对Console口进行空闲超时时间的配置 2950B(config-line)#exit //返回特权模式 2950B(config)#end // 返回全局配置模式 //创建vlan 2950B#vlan database //进入VLAN数据库 2950B(vlan)#vlan 10 //创建VLAN10 VLAN 1
18、0 added: Name: VLAN0010 2950B(vlan)#vlan 20 //创建VLAN20 VLAN 20 added: Name: VLAN0020 2950B(vlan)#vlan 30 //创建VLAN30 VLAN 30 added: Name: VLAN0030 2950B(vlan)#vlan 40 //创建VLAN40 VLAN 40 added: Name: VLAN0040 2950B
19、vlan)#exit //退出 APPLY completed. Exiting.... //把端口划分到vlan里 2950B#conf t //进入端口配置模式 2950B(config)#int fa0/21 //进入fa0/21接口 2950B(config-if)#switchport mode access //配置接口模式为access 2950B(config-if
20、)#switchport access vlan 10 //把fa0/21加入VLAN10 2950B(config-if)#no shutdown //开启接口 2950B(config-if)#exit //退出 2950B(config)#int fa0/22 //进入fa0/22接口 2950B(config-if)#switchport mode access
21、 //配置接口模式为access 2950B(config-if)#switchport access vlan 20 //把fa0/22加入VLAN20 2950B(config-if)#no shutdown //开启接口 2950B(config-if)#exit //退出 2950B(config)#int fa0/23 //进入fa0/23接口 2950B(config-if)#swi
22、tchport mode access //配置接口模式为access 2950B(config-if)#switchport access vlan 30 //把fa0/22加入VLAN30 2950B(config-if)#no shutdown //开启接口 2950B(config-if)#exit //退出 2950B(config)#int fa0/24 //进入fa0/24接口 2950B(config-if)#switchport
23、mode access //配置接口模式为access 2950B(config-if)#switchport access vlan 40 //把fa0/22加入VLAN40 2950B(config-if)#no shutdown //开启接口 2950B(config-if)#exit //退出 //做干道 2950B(config)#int fa0/5 // 进入fa0/5接口 2950B(config-if)#switchport mod
24、e trunk //配置接口模式为trunk 2950B(config-if)#switchport trunk encapsulation dot1q //配置封装协议 2950B(config-if)#no shutdown //开启接口 2950B(config-if)#exit //退出 //做以太通道中继线路 2950B(config)#int range fa0/1 – 2 //进入fa0/1 和fa0/ 2接口 2950B(config-if-range)#channel
25、group 1 mode on // 配置二层的端口汇聚 Creating a port-channel interface Port-channel1 //创建以太通道的接口 2950B(config-if-range)#no shutdown //开启接口 2950B(config-if-range)#exit //返回特权模式 2950B(config)#end //退出 2950B#show running-config //查看配置情况 Buildi
26、ng configuration... Current configuration : 1079 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname 2950B ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 ! ! ip ce
27、f ! ! no ip domain lookup ! ! ! ! ! interface Port-channel1 ! interface FastEthernet0/0 ! interface FastEthernet0/1 channel-group 1 mode on ! interface FastEthernet0/2 channel-group 1 mode on ! interface FastEthernet0/3 ! interface FastEthernet0/4 ! interface FastEt
28、hernet0/5 switchport mode trunk ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 switchport access vlan 10 ! interface FastEthernet0/12 switchport access vlan
29、20 ! interface FastEthernet0/13 switchport access vlan 30 ! interface FastEthernet0/14 switchport access vlan 40 ! interface FastEthernet0/15 ! interface Vlan1 no ip address ! ip http server ! ! ! ! ! control-plane ! ! line con 0 exec-timeout 0 0 logging synchronous line aux 0 line vty 0 4 ! end






