3.Vlan和VTP的基础知识总结
一.VLAN相关知识总结
1.一个VLAN=一个广播域=逻辑网段(子网)
2.1002-1005划分给FDDI和令牌环
1-1001以太网
1006-4094扩展的vlan
3.VLAN类型
End-to-End Vlan(端到端vlan):用户可以被加入到VLAN中,而不关心所在的物理位置
local vlan(本地vlan)
4.端口只能被加入到一个vlan
5.主干链路可以支持多个VLAN的数据,特殊的封装格式支持不同的VLAN.
6.交换机对帧进行VLAN标记的时候有两种协议ISL(cisco)和802.1Q(IEEE)
(如果跨越cisco交换机和其他厂商的交换机来建立多个VLAN,必须使用802.1Q协议)


ISL:
优点:对原始数据帧不做额外处理
缺点:私有协议

7.Native Vlan(本帧Vlan)
针对于802.1q而言
穿越trunk时不打tag标签
vlan1
8.vlan范围

9.接口模式

10.如何配置Trunking


11.switchport nonegotiate //不发送DTP信息,你可是trunk,但不会协商
12.默认 情况下trunk链路允许所有的vlan通过
13.VTP(vlan trunking protocol)
作用:宣告vlan的配置信息,学vlan,传vlan,删除vlan
(cisco私有协议)
架构完毕后,就删除。
通过域名来控制,域名相同就传,不同不传。
只能在trunk链路上传。
支持认证
VTP的版本的意思:和rip里面的版本不同,这个是指更新版本,更新一次,版本增加一次

14.VTP模式

交换机命令总结
1.查看MAC地址表
Switch#show mac address-table
Switch#show mac-address-table(根据版本不同,有的有-,有的没有-)
2.查看vlan信息
Switch#show vlan brief
3.配置一个基本的VLAN
Switch(config)#vlan 10 //创建vlan
Switch(config-vlan)#name MyFistVlan //给vlan一个名字
4.配置trunk
Switch(config)#interface ethernet 0/0
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch#show interfaces trunk //查看trunk
5.Switchport有哪些接口模式
SW2(config-if)#switchport mode ?
access Set trunking mode to ACCESS unconditionally
dot1q-tunnel set trunking mode to TUNNEL unconditionally
dynamic Set trunking mode to dynamically negotiate access or trunk mode
private-vlan Set private-vlan mode
trunk Set trunking mode to TRUNK unconditionally
6.查看端口的trunk
SW2#show interfaces ethernet 0/0 trunk
7.修改native vlan
SW2(config-if)#switchport trunk native vlan xxx
8.trunk允许谁通过
SW2(config-if)#switchport trunk allowed vlan ?
WORD VLAN IDs of the allowed VLANs when this port is in trunking mode
add add VLANs to the current list
all all VLANs
except all VLANs except the following
none no VLANs
remove remove VLANs from the current list
9.查看端口信息
SW2#show interfaces ethernet 0/0 switchport
10.单臂路由
浙公网安备 33010602011771号