实验项目(1):VLAN间的路由配置
                                                                             
 
完成标准:  
实现在不同VLAN之间的主机能够通信.
 
实验拓扑图如下:

单臂路由,三层交换配置

 
 
操作步骤如下:
1.交换机的配置
SW1:
>en
#conf t
(config)#host sw1
(config)#exit
#vlan database
(vlan)#vlan 2
(vlan)#vlan 3
(vlan)#vtp domain abc
(vlan)#vtp mode server
(vlan)#exit
#conf t
(config)#int f0/1
(config-if)#switchport access vlan 2
(config-if)#exit
(config)#int f0/2
(config-if)#switchport access vlan 3
(config-if)#exit
(config)#int range f0/11 - 12
(config-if)#switchport mode trunk
(config-if)#end
#show vtp status
#show vlan brief
 
SW2:
>en
#conf t
(config)#host sw2
(config)#exit
#vlan database
(vlan)#vtp domain abc
(vlan)#vtp mode client
(vlan)#exit
#conf t
(config)#int f0/11
(config-if)#switchport mode trunk
(config-if)#end
#show vtp status
#show vlan brief
 
2.路由器的配置
R1:
>en
#conf t
(config)#host R1
(config)#int f0/0
(config-if)#no sh
(config-if)#exit
(config)#int f0/0.1
(config-subif)#encapsulation dot1q 2   vlan 2封装成dot1q协议
(config-subif)#ip address 10.0.0.1 255.0.0.0
(config-subif)#no sh
(config-subif)#exit
(config)#int f0/0.2
(config-subif)#encapsulation dot1q 3
(config-subif)#ip address 20.0.0.1 255.0.0.0
(config-subif)#no sh
(config-subif)#end
 
3.PC机的配置
PC1:ip address 10.0.0.2 255.0.0.0  ip default-gateway 10.0.0.1
PC2:ip address 20.0.0.2 255.0.0.0 ip default-gateway 20.0.0.1
PC3:ip address 10.0.0.3 255.0.0.0  ip default-gateway 10.0.0.1
PC4:ip address 20.0.0.3 255.0.0.0 ip default-gateway 20.0.0.1
 
经验证:
不同VLAN的主机能够ping通。
 
 
实验项目(2):三层交换机的配置
完成标准:
实现VLAN之间能够通信.
 
实验拓扑图如下:

单臂路由,三层交换配置

操作步骤如下:
1.二层交换机的配置
SW-2L:
>en
#conf t
(config)#host SW-2L
(config)#exit
#vlan database
(vlan)#vlan 2
(vlan)#vlan 3
(vlan)#exit
#conf t
(config)#int f0/2
(config-if-)#switchport access vlan 2
(config-if)#exit
(config)#int f0/3
(config-if)#switchport access vlan 3
(config-if)#exit
(config)#int f0/15
(config-if)#switchport mode trunk
(config-if)#end
 
 
2.三层交换机的配置
SW-3L:
>en
#conf t
(config)#host SW-3L
(config)#exit
#vlan database
(vlan)#vlan 2
(vlan)#vlan 3
(vlan)#exit
#conf t
(config)#ip routing
(config)#int f0/15
(config-if)#switchport mode trunk
(config-if)#exit
(config)#int vlan 1
(config-if)#ip address 192.168.1.1 255.255.255.0
(config-if)#no sh
(config-if)#exit
(config)#int vlan 2
(config-if)#ip address 192.168.2.1 255.255.255.0
(config-if)#no sh
(config-if)#exit
(config)#int vlan 3
(config-if)#ip address 192.168.3.1 255.255.255.0
(config-if)#no sh
(config-if)#end
#show ip route
 

单臂路由,三层交换配置

#show ip cef
 

单臂路由,三层交换配置

#show adjacency detail
 
 

单臂路由,三层交换配置

3PC机的配置
PC1:ip address 192.168.1.10 255.255.255.0  ip default-gateway 192.168.1.1
PC2:ip address 192.168.2.10 255.255.255.0 ip default-gateway 192.168.2.1
PC3:ip address 192.168.3.10 255.255.255.0 ip default-gateway 192.168.3.1
 

单臂路由,三层交换配置

 

单臂路由,三层交换配置

 
 

单臂路由,三层交换配置

 
经验证:
如上图所示不同VLAN的主机之间能够相互通信.