三层交换机和vtp协议的配置实验报告时间:2011年7月14日
地点:西一楼5实验机房
目的:1)了解三层交换机的原理及其的扩展应用,并掌握其配置方法。
2) 理解VTP协议的原理及应用,掌握VTP的配置技巧。
3)巩固对ACL列表的了解,并练习其配置方法。
内容:一、拓扑设计 二、设备配置 三、项目总结
一、拓扑图:
二、设备配置
1、初始化设备命令
en
conf t
no ip domain-look
line con 0
logging syn
exec 0 0
pass 0
login
line vty 0 4
pass 0
login
end
conf t
enable pass 0
2、三层交换机上的捆绑通道命令
Sw0上的端口封装:
conf t
int rang f0/1- 2
channel-protocol lacp
channel-group 1 mode active switchport trunk encapsulation dot1q switchport mode trunk
show的结果显示:
修改端口模式为trunk:
conf t
int rang f0/4-5
switchport trunk encapsulation dot1q switchport mode trunk
show的结果显示:
同理在Sw1上进行通道封装,三层交换机Sw1上的配置类似Sw0的配置。
3、在三层交换机Sw0和Sw1上 配置VTP协议
conf t
vtp domain test
vtp mode server
vtp pass 0
show命令显示结果:
Sw1的配置类似Sw0的配置。
在一般交换机sw0---sw3上配置VTP协议:
conf t
vtp domain test
vtp mode client
vtp pass 0
其余交换机的VTP配置类似Sw0的配置。
4、三层交换机SW0上vlan配置
conf t
vlan 2
vlan 3
vlan 4
vlan 5
end
显示结果:
5、启用路由
conf t
ip routing
end
6、三层交换机sw0和sw1上配置vlan间的网关IP conf t
int vlan 2
ip add 192.168.2.254 255.255.255.0
no sh
end
conf t
int vlan 3
ip add 192.168.3.254 255.255.255.0
no sh
end
conf t
int vlan 4
ip add 192.168.4.254 255.255.255.0
no sh
end
conf t
int vlan 5
ip add 192.168.5.254 255.255.255.0
no sh
end
7、三层交换路由RIP配置
conf t
int f0/3
no switch
ip add 40.1.1.1 255.255.255.0
no sh
exit
router rip
ver 2
net 192.168.2.0
net 192.168.3.0
net 40.1.1.0
no au
end
conf t
int f0/3
no switch
ip add 30.1.1.1 255.255.255.0
no sh
exit
router rip
ver 2
net 192.168.4.0
net 192.168.5.0
net 30.1.1.0
no au
end
8、在三层交换机Sw0上配置DHCP
conf t
ip dhcp pool vlan2
network 192.168.2.0 255.255.255.0 default-router 192.168.2.254
dns-server 202.196.1.1
exit
ip dhcp excluded-address 192.168.2.254
end
conf t
ip dhcp pool vlan3
network 192.168.3.0 255.255.255.0 default-router 192.168.3.254
dns-server 202.196.1.1
exit
ip dhcp excluded-address 192.168.3.254 end
show running 的显示结果(部分):
9、在三层交换机Sw1上配置DHCP
conf t
ip dhcp pool vlan4
network 192.168.4.0 255.255.255.0 default-router 192.168.4.254
dns-server 202.196.1.1
exit
ip dhcp excluded-address 192.168.4.254 end
conf t
ip dhcp pool vlan5
network 192.168.5.0 255.255.255.0 default-router 192.168.5.254
dns-server 202.196.1.1
exit
ip dhcp excluded-address 192.168.5.254 end
显示结果:
10、二层交换机配置trunk conf t
int f0/1
switch mo trunk
int f0/2
switch mo acc
switch acc vlan 2
end
conf t
int f0/1
switch mo trunk
int f0/2
switch mo acc
switch acc vlan 3
end
conf t
int f0/1
switch mo trunk
int f0/2
switch mo acc
switch acc vlan 4
end
conf t
int f0/1
switch mo trunk
int f0/2
switch mo acc
switch acc vlan 5
end
11、路由器router0和router1上的ip配置及配置ripv2协议:Router1的显示结果:
Router0的显示结果:
11、配置完成后各主机间的通信结果:1)源主机Ip是192.168.2.1时:
2)源主机Ip是192.168.4.1时:
3)源主机Ip是10.1.1.2时:
12、ACL 列表的应用、配置命令和完成后各主机间的通信结果:ACL配置
conf t
access-list 1 permit 192.168.5.0 0.0.0.255
access-list 1 deny any
int s1/0
ip access-group 1 out
源主机是:10.1.1.2时
源主机是:192.168.5.1时
源主机是:192.168.4.1时
源主机是:192.168.3.1时
源主机是:192.168.2.1时
三、项目总结
本次实验所做的是在三层交换机的基础上实现扩展的综合实验。要求首先实现四个vlan中4台主机以及路由连接外网中主机之间相互通信。其次,利用ACL列表的功能实现只有vlan5中的一台主机能与路由连接的一台主机通信。综合性的实验要求的技能较高,同时在实验过程中还的加倍的小心,有很多的小细节都会因不注意而被忽略,导致实验失败。在此实验中我因为忘记在三层交换机上应用路由的RIP协议,而导致在同一个二级交换机下连接的两个Vlan能通信,却不能与另一个二级交换机下的两个Vlan通信。