VLAN VTP配置
VLAN 的配置一、● VLAN 配置的步骤 全局配置模式下, 输入VLAN ID,进入VLAN 配置模式:Switch(config)#vlan {vlan-id}● 为VLAN 设置名字. 可选:
VLAN 的配置
一、
● VLAN 配置的步骤 全局配置模式下, 输入VLAN ID,进入VLAN 配置模式:
Switch(config)#vlan {vlan-id}
● 为VLAN 设置名字. 可选:
Switch(config-vlan)#name {vlan-name}
● 创建了以太网VLAN 之后, 接下来把交换机端口分配到特定的VLAN 里. 假如你把端口分配进了不存在的VLAN 里, 那么新的VLAN 将自动被创建. 进入接口配置模式: Switch(config)#interface {interface}
● 定义VLAN 端口的成员关系, 把它定义为层2接入端口:
Switch(config-if)#switchport mode access
● 把端口分配进特定的VLAN 里:
Switch(config-if)#switchport access vlan {vlan-id}
● 配置中继端口, 定义中继模式:
Switch(config-if)#switchport trunk encapsulation
{isl|dot1q|negotiate}
● 定义端口为层2的中继端口:
Switch(config-if)#switchport mode {dynamic auto|dynamic desirable|trunk}
,二、 配置示例
交换机Asuqa 配置如下:
Asuqa#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Asuqa(config)#vlan 2
Asuqa(config-vlan)#name Sales Asuqa(config-vlan)#vlan 3
Asuqa(config-vlan)#name Tech Asuqa(config-vlan)#interface f0/2 Asuqa(config-if)#switchport mode access Asuqa(config-if)#switchport access vlan 2 Asuqa(config-if)#no shutdown Asuqa(config-if)#interface f0/3
Asuqa(config-if)#switchport mode access Asuqa(config-if)#switchport access vlan 3 Asuqa(config-if)#no shutdown Asuqa(config-if)#interface f0/1 Asuqa(config-if)#switchporttrunk
encapsulation dot1q
Asuqa(config-if)#switchport mode trunk Asuqa(config-if)#no shutdown Asuqa(config-if)#end
Asuqa#
三、 switch#

show vlan biref
交换机Aiko 配置如下:
Aiko#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Aiko(config)#vlan 2
Aiko(config-vlan)#name Sales Aiko(config-vlan)#vlan 3
Aiko(config-vlan)#name Tech Aiko(config-vlan)#interface f0/3 Aiko(config-if)#switchport mode access Aiko(config-if)#switchport access vlan 2 Aiko(config-if)#no shutdown Aiko(config-if)#interface f0/5
Aiko(config-if)#switchport mode access Aiko(config-if)#switchport access vlan 3 Aiko(config-if)#no shutdown Aiko(config-if)#interface f0/1 Aiko(config-if)#switchport
trunk
encapsulation dot1q
Aiko(config-if)#switchport mode trunk Aiko(config-if)#no shutdown Aiko(config-if)#end
Aiko#
,VTP 协议
(VLAN Trunking Protocol )
四、
●
●
●
● VTP 概述 一个能够宣告VLAN 配置信息的信息系统 通过一个共有的管理域,维持VLAN 配置信息的一致性 VTP 只能在主干端口发送要宣告的信息 支持混合的介质主干连接(快速以太网, FDDI, ATM)
五、 VTT 的3种模式


六、 VTP 是如何工作的?
VTP 裁剪——通过阻止不必要数据的泛洪传送来增加可用的带宽


七、
●
VTP 配置步骤
全局配置模式下, 定义VTP 模式:
Switch(config)#vtp mode {server|client|transparent}
●
定义VTP 域名, 在同一VLAN 管理域的交换机的VTP 域名必须相同. 该域名长度为1到32字符:
Switch(config)#vtp domain {domain-name}
●
设置VTP 域的密码, 同一VTP 域里的交换机的VTP 域的密码必须一致, 密码长度为8到64字符. 可选:
Switch(config)#vtp password {password}
八、
配置示例
交换机Asuqa 配置如下: Asuqa#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Asuqa(config)#vtp domain Aiko Changing VTP domain name from NULL to Aiko
Asuqa(config)#vtp mode server Device mode already VTP SERVER. Asuqa(config)#vtp password Asuqa Setting device VLAN database password to Asuqa
Asuqa(config)#end
交换机Aiko 配置如下: Aiko#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Aiko(config)#vtp domain Aiko
Changing VTP domain name from NULL to Aiko
Aiko(config)#vtp mode client Setting device to VTP CLIENT mode. Aiko(config)#no vlan 2
VTP VLAN configuration not allowed when device is in CLIENT mode.
Aiko(config)#vtp password Asuqa Setting device VLAN database password to Asuqa
Aiko(config)#end
