三层交换机实现Vlan间的

版权声明:本网站发表的文章,版权归原作者所有;不得转载。 https://blog.csdn.net/qq_41709494/article/details/82903805

在这里插入图片描述

建立Vlan步骤:

第一步:

3560:

Switch>enable

Switch#Vlan database

Switch(Vlan)#vtp domain zzx

2960:

Switch>enable

Switch#configure terminal

Switch(config)#vtp domain zzx

第二步:

2960:

Switch>enable

Switch#configure terminal

Switch(config)#vtp mode client

第三步:

3560:

Switch>enable

Switch#configure terminal

Switch(config)#interface f0/1

Switch(config-if)#switchport mode dynamic desirable

Switch(config-if)#exit

Switch(config)#interface f0/2

Switch(config-if)#switchport mode dynamic desirable

Switch(config-if)#exit

Switch(config)#interface f0/3

Switch(config-if)#switchport mode dynamic desirable

2960:

Switch>enable

Switch#configure terminal

Switch(config)#interface f0/1

Switch(config-if)#switchport mode trunk

注意:三个2960都要开中继链路

第四步:

3560:

Switch>enable

Switch#Vlan databse

Switch(vlan)#Vlan 10 name 10_zzx

Switch(vlan)#Vlan 20 name 20_zzx

Switch(vlan)#Vlan 30 name 30_zzx

Switch(vlan)#Vlan 40 name 40_zzx

第五步:

2960:

Switch>enable

Switch#configure terminal

Switch(config)#interface f0/2

Switch(config-if)#switchport access vlan 10

注意:这是对工程部Vlan10的所有端口的添加

Switch(config-if)#exit

Switch(config)#interface f0/3

Switch(config-if)#switchport access vlan 20

注意:这是对财政部Vlan20的所有端口的添加

Switch(config-if)#exit

Switch(config)#interface f0/4

Switch(config-if)#switchport access vlan 30

注意:这是对运维部Vlan30的所有端口的添加

Switch(config-if)#exit

Switch(config)#interface f0/4

Switch(config-if)#switchport access vlan 40

注意:这是对服务器Vlan40的添加

第六步:

3560:

Switch>enable

Switch#configure terminal

Switch(config)#interface vlan 10

Switch(config-if)#ip address 192.168.10.254 255.255.255.0

Switch(config-if)#exit

Switch(config-if)#interface vlan 20

Switch(config-if)#ip address 192.168.20.254 255.255.255.0

Switch(config-if)#exit

Switch(config-if)#interface vlan 30

Switch(config-if)#ip address 192.168.30.254 255.255.255.0

Switch(config-if)#exit

Switch(config-if)#interface vlan 40

Switch(config-if)#ip address 202.96.134.254 255.255.255.0

Switch(config-if)#exit

Switch(config)#ip routing

注意:三层交换机可以设置IP,但二层交换机不能设置IP

所有的vtp取相同域名:zzx

改变所有2960的vtp工作模式:client

打开所有连接交换机的端口的中继链路

在服务器3560上划分Vlan

在2960上把端口加入相应的Vlan

配置各个Vlan的网关

在这里插入图片描述

最后成功上网。

Switch(config)#spanning-tree mode
rapid-pvst

这是快速切换加不加入交换机都可以。

猜你喜欢

转载自blog.csdn.net/qq_41709494/article/details/82903805