公司又扩大了,部门人数逐渐增多,一台交换机已经无法满足公司的需求,我们采购了多台交换机,现在需要在这些交换机上配置多个VLAN,是不是感觉工作量特大,有什么好的办法吗?

项目拓扑

项目拓扑如图:

需求分析

通过最简单的方法,在3台交换上增加相同的VLAN。
如果交换之间可以互相学习,就能减少很大的工作量。

项目方案

VTP英文全称VLAN Trunk Protocol,中文名VLAN中继协议。用于在多台交换机间同步VLAN数据。
VTP有三种模式:

  1. 服务模式(可以管理VLAN数据库,并向外发送VLAN数据)
  2. 透明模式(只负责传输VLAN数据,并不学习)
  3. 客户模式(学习服务端VLAN数据,但不可以添加)

注意:数据通过开启透明模式的交换设备时,需该设备具备对应的VLAN。

方案步骤

Switch0交换机:

1
2
3
4
5
6
7
8
1. Switch>enable
2. Switch#configure terminal
3. Switch(config)#interface fastEthernet 0/1
4. Switch(config-if)#switchport mode trunk
5. Switch(config-if)#exit
6. Switch(config)#vtp domain cjk
7. Switch(config)#vtp mode server
8. Switch(config)#vtp password cjk

Switch1交换机:

1
2
3
4
5
6
7
8
1. Switch>enable
2. Switch#configure terminal
3. Switch(config)#interface fastEthernet 0/2
4. Switch(config-if)#switchport mode trunk
5. Switch(config-if)#exit
6. Switch(config)#vtp domain cjk
7. Switch(config)#vtp mode transparent
8. Switch(config)#vtp password cjk

Switch2交换机:

1
2
3
4
5
1. Switch>enable
2. Switch#configure terminal
3. Switch(config)#vtp domain cjk
4. Switch(config)#vtp mode client
5. Switch(config)#vtp password cjk

方案测试


注意:上图为服务端,在上面添加VLAN。

注意:上图为中继端,只传输不学习。

注意:上图为客户端,学习服务端VLAN数据。

项目扩展

  1. show vlan
    注意:查询VLAN的数据,在特权模式下执行上面命令。