实验目的:
随着企业内部流量的逐步增大,使用路由器的独臂路由功能来实现不同vlan间互访已不能满足企业用户的需求。这时我们可以使用转发速度较快的三层交换机来实现这些功能。通过在三层交换上配置相应的vlan地址(即网关地址),让不同vlan的用户通过三层交换的中继链路实现快速的互访。
实验步骤
v在2层交换机上配置VLAN
SW-2L(config)#vlan 2
SW-2L(config-vlan)#vlan 3
SW-2L(config-vlan)#exit
配置所需要的接口加入到vlan中
SW-2L(config)#interface range f0/2
SW-2L(config-if-range)#switchport mode access
SW-2L(config-if-range)#switchport access vlan 2
SW-2L(config)#interface range f0/3
SW
-2L(config-if-range)#switchport mode access
SW-2L(config-if-range)#switchport access vlan 3
v在2层交换机上配制Trunk接口
SW-2L(config)#interface f0/1
SW-2L(config-if)#switchport mode trunk
v 在3层交换机上配置与2层交换机相同的VLAN(配置步骤与方法相同,也可以配置一台交换机为VTP域服务器,其它交换机为VTP域客户端来自动学****vlan信息)
SW-3L(config)#vlan database
SW-3L(config-vlan)#vlan 2
SW-3L(config-vlan)#vlan 3
SW-3L(config-vlan)#exit
v在3层交换机上配置中继接口
SW-3L(config)#interface f0/1
SW-3L(config-if)#switchport trunk encapsulation dot1q
SW-3L(config-if)#switchport mode trunk
v在3层交换机上启动路由
SW-3L(config)#ip routing
v在3层交换机上配置各VLAN的IP地址
SW-3L(config)#interface vlan 1
SW-3L(config-if)#ip address
SW-3L(config-if)#no shut
SW-3L(config)#interface vlan 2
SW-3L(config-if)#ip address
SW-3L(config-if)#no shut
SW-3L(config)#interface vlan 3
SW-3L(config-if)#ip address
SW-3L(config-if)#no shut
v在3层交换机上查看路由表
SW-3L#show ip route
SW-3L
三层交换机实现VLAN互通 来自淘豆网www.taodocs.com转载请标明出处.