交換機部分:
兩臺三層交換機之間封裝以太通道,並且將以太通道配置成trunk
SW1:
interface range g0/1-2
channel-group 1 mode on
interface port-channel 1
switchport trunk encapsulation dot1q
switchport mode trunk
保證所有交換機之間接口爲trunk
SW2:
interface range f0/1-4
switchport trunk encapsulation dot1q
switchport mode trunk
接入交換機1-4
interface range f0/1-2
switchport mode trunk
在所有交換機上創建VLAN 10,20,30,40,50
並將相應PC劃分到相應的VLAN當中去
Core-sw1爲VLAN 10,30,50的根網橋-spanning-tree vlan 10,30,50 priority 0
Core-sw2爲VLAN 20,40的根網橋-spanning-tree vlan 20,40 priority 0
所有連接PC的接口配置速端口,加速生成樹的收斂
所有交換機全局模式下spanning-tree portfast default
二層安全--所有連接PC的接口需要開啓二層安全,能夠將第一個學習到的MAC
地址作爲合法MAC,當其他設備連接該接口,交換機會丟棄數據幀
進入連接PC和服務器接口
interface f0/1
switchport port-security
switchport port-security mac sticky
switchport port-security violation protect