Talen
Hao LINUX 學習筆記系列■■■■■
第8章
第二層交換和生成樹協定(STP)
系統:cisco
一:打開cisco交換機管理功能(即管理VLAN)
進入接口模式vlan
1:
Switch>enable
Switch#config
t
Enter
configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface
vlan 1
Switch(config-if)#ip
address 192.168.0.1 255.255.255.0
Switch(config-if)#no
shutdown
Switch(config-if)#
%LINK-5-CHANGED:
Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN:
Line protocol on Interface Vlan1, changed state to up
退出到全局模式,設定預設網關:
Switch(config)#ip
default-network 192.168.0.254
二:端口安全
Switch#configure
terminal
為端口設定靜态MAC:
range f0/1-13
Switch(config-if-range)#switchport
port-security maximum 1
port-security mac-address sticky
port-security violation shutdown
STP擴充特性:
portfast: switch(config-if-range)#spanning-tree
portfast
BPDUGuard(禁用啟用了portfast的接入層端口):(二選一)
switch(config-if-range)#spanning-tree
bpduguard enable
BPDUGuard(收到BPDU的端口禁用portfast):
bpdufilter enable
uplinkfast: switch(config)#spanning-tree
uplinkfast(全局指令)
backbonefast: switch(config)#spanning-tree
backbonefast
啟用帶上面所有特性的802.1w
RSTP
switch(config)#spanning-tree
mode rapid-pvst
Talen
Hao LINUX 學習筆記系列■■■■■