定义VTP的工作模式 switch#trunk on 启用干道
switch#show trunk b
switch#show trunk b allowed-vlans 查看干道信息 配置VLAN
switch#vlan 10 dept1 switch#vlan 20 dept2 switch#vlan 30 dept3 switch#vlan 40 dept4 定义所需VLAN switch#showvlan 查看VLAN信息 switch#showvlan switch#showvtp 查看VTP的信息
switch#int e0/1
switch#vlan-membership static 10 switch#int e0/2
switch#vlan-membership static 20 switch#int e0/3
switch#vlan-membership static 30 switch#int e0/4
switch#vlan-membership static 40 把接口划入各自VLAN 配置spanning tree switch#spantreevlan1 对vlan1启用生成树协议 switch#shspantreevlan1 查看生成树信息 switch#nospantreevlan1 关闭生成树协议 switch#shspantreevlan1 查看生成树信息
交换机上屏蔽个别MAC地址方法 configure terminal
interface gigabitEthernet 0/20 switchport sw mode acc sw port-sec
sw port-sec mac-add [macaddress] sw port-sec max 1
sw port-sec violation restrict 部分命令缩写要看详细按tab键