一、 图例说明:
(S1、S2 、S3 、S4、S5、S6 、S7 、S8 、S9为二层交换,S0为三层交换)。
二、 拓扑图分析:
该网络拓扑是根据宿舍楼的真实环境搭建的(根据图示文字提示标记):
1. 宿舍内部网【每个宿舍一个VLAN,由很多个VLAN 组成】。
2. 接入网(宿舍交换机接入到楼层交换机,楼层交换机接入到宿舍楼的三层交换机)。
三、 要求
1. 使用vtp协议让交换机学到VLAN。
2. 将楼层交换下层的宿舍交换加入到VLAN 。
3. 在宿舍楼的三层交换为VLAN 网段配置地址。
4. 最终使得全网通,宿舍之间通信。
一、 操作步骤:
1.打开三层交换S0的trunk口
S0#conf t
S0(config)#int fa 0/1
S0(config-if)#switchport trunk encapsulation dot1q
S0(config-if)#switchport mode trunk
S0(config-if)#exit
S0(config)#int fa 0/2
S0(config-if)#switchport trunk encapsulation dot1q
S0(config-if)#switchport mode trunk
S0(config-if)#exit
S0(config)#int fa 0/3
S0(config-if)#switchport trunk encapsulation dot1q
S0(config-if)#switchport mode trunk
1.打开S1交换的trunk口
S1#conf t
S1(config)#int fa 0/1
S1(config-if)#switchport mode trunk
2.打开S2交换的trunk口
S2#conf t
S2(config)#int fa 0/1
S2(config-if)#switchport mode trunk
3.打开S3交换的trunk口
S3#conf t
S3(config)#int fa 0/1
S3(config-if)#switchport mode trunk
4.创建VLAN 并启动VTP
S1#vlan database
S1(vlan)#vtp domain liu
Changing VTP domain name from a to liu
R1(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
R1(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
R1(vlan)#vlan 4
VLAN 4 added:
Name: VLAN0004
R1(vlan)#vlan 5
VLAN 5 added:
Name: VLAN0005
R1(vlan)#vlan 6
VLAN 6 added:
Name: VLAN0006
R1(vlan)#vlan 7
VLAN 7 added:
Name: VLAN0007
5.将端口加入到VLAN
S1(config)#int fa 0/2
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 2
S1(config)#int fa 0/3
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 3
S2(config)#int fa 0/3
S2(config-if)#switchport mode access
S2(config-if)#switchport access vlan 4
S2(config)#int fa 0/2
S2(config-if)#switchport mode access
S2(config-if)#switchport access vlan 5
S3(config)#int fa 0/2
S3(config-if)#switchport mode access
S3(config-if)#switchport access vlan 6
S3(config)#int fa 0/3
S3(config-if)#switchport mode access
S3(config-if)#switchport access vlan 7
6.在三层交换S0上配置VLAN的IP地址
S0#conf t
S0(config)#int vlan 2
S0(config-if)#ip address 192.168.2.1 255.255.255.0
S0(config)#int vlan 3
S0(config-if)#ip address 192.168.3.1 255.255.255.0
S0(config)#int vlan 4
S0(config-if)#ip address 192.168.4.1 255.255.255.0
S0(config)#int vlan 5
S0(config-if)#ip address 192.168.5.1 255.255.255.0
S0(config)#int vlan 6
S0(config-if)#ip address 192.168.6.1 255.255.255.0
S0(config)#int vlan 7
S0(config-if)#ip address 192.168.7.1 255.255.255.0
7.在三层交换S0上配置DHCP服务
S0(config)#ip dhcp pool 2
S0(dhcp-config)#network 192.168.2.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.2.1
S0(config)#ip dhcp pool 3
S0(dhcp-config)#network 192.168.3.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.3.1
S0(config)#ip dhcp pool 4
S0(dhcp-config)#network 192.168.4.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.4.1
S0(config)#ip dhcp pool 5
S0(dhcp-config)#network 192.168.5.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.5.1
S0(config)#ip dhcp pool 6
S0(dhcp-config)#network 192.168.6.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.6.1
S0(config)#ip dhcp pool 7
S0(dhcp-config)#network 192.168.7.0 255.255.255.0
S0(dhcp-config)#default-router 192.168.7.1
8.在三层交换S0上查看路由表
S0(config)#ip routing
S0#show ip route