① H3C的交換機STP邊緣埠用什麼命令配置
int eth 1/0/1
stp disable
stp edged-port enable
最後全局起
stp bp-protection
邊緣埠(portfast)是指不直接與任何交換機連接,也不通過埠所連接的網路間接與任何交換機相連的埠。 可以通過下面兩種途徑來配置埠為邊緣埠或者非邊緣埠。
② 接交換機的pc不想收到bp報文,同時為了減少流量泛洪,怎麼做
將交換機接PC的介面配置為BPDU filter埠,則該埠將不發送任何的BPDU報文並忽略所有接收到的BPDU報文。
華為交換機配置命令:stp bp-filter enable
思科交換機配置命令:spanning-tree bpfilter enable
③ 邊緣埠的bpguard應用
將SWITCH的埠設置為spanning-tree portfast後,如果這個埠接到其他SWITCH或者HUB上就可能造成環路問題。加上spanning-tree bpguard enable之後,當這個埠在收到BPDU包後就會進入errdisable狀態,從而避免環路。BPDU GUARD的功能是當這個埠收到任何的BPDU就馬上設為Error-Disabled狀態。
Portfast和bpguard配置:
switch(config)#interface range f0/1 - 5
switch(config-if-range)#spanning-tree portfast
switch(config-if-range)#spanning-tree bpguard enable
BPDU Guard使具備PortFast特性的埠在接收到BPDU時進入err-disable狀態來避免橋接環路,其可在全局或介面下進行配置(默認關閉),可使用errdisable recovery cause bpguard命令開啟埠狀態的自動恢復。
BPDU GUARD工作原理:當交換機STP功能啟用的時候,默認所有埠都會參與STP,並發送和接受BPDU,當BPDU GUARD開啟後,在正常情況下,一個下聯的埠是不會收到任何BPDU的,因為PC和非網管換機都不支持STP,所以不會收發BPDU。當這個埠下如果有自回環的環路,那麼它發出去的BPDU在非網管換機上回環後就會被自己接收到,這個時候BPDU GUARD就會把它立刻設為Error-Disabled狀態,這個埠就相當於被關閉了,不會轉發任何數據,也就切斷了環路,保護了整個網路。BPDU Guard特性可以全局啟用也可以基於基於介面的啟用,兩種方法稍有不同. 當在啟用了Port Fast特性的埠收到了BPDU後,BPDU Guard將關閉該埠,使該埠處於err-disable狀態,這時必須手動才能把此埠回復為正常狀態。 不同於BPDU防護,BPDU Filter配置於全局/介面模式時,功能有所不同,當啟用於PortFast埠模式時,交換機將不發送任何BPDU,並且把接收到的所有BPDU都丟棄;而啟用於全局模式時,埠在接收到任何BPDU時,將丟棄PortFast狀態和BPDU過濾特性,更改回正常的STP操作,BPDU Filter特性默認關閉。
當同時啟用bpguard與bpfilter時,bpfilter優先順序較高,bpguard將失效 。
BPDU Filtering特性和BPDU Guard特性非常類似.通過使用BPDU Filtering,將能夠防止交換機在啟用了Port Fast特性的埠上發送BPDU給主機。 如果全局配置了BPDU Filtering,當某個Port Fast埠接收到了BPDU,那麼交換機將禁用Port Fast和BPDU Filtering特性,把埠更改回正常的STP狀態.如果在單獨的Port Fast埠啟用BPDU Filtering,此埠將不發送任何的BPDU並忽略所有接收到的BPDU. 注意,如果在連接到其他交換機的埠(不是連的主機的埠)上配置了BPDUFiltering,那麼就有可能導致層2環路(Prevent from sending and receiving BPDU).另外,如果在與啟用了BPDU Filtering的相同埠上配置了BPDU Guard特性,所以BPDU Guard將不起作用,起作用的將是BPDU Filtering.
配置BPDU Filtering:
Switch(config)# spanning-tree portfast bpfilter default /---在啟用了Port Fast特性的埠上啟用BPDU Filtering---/
Switch(config-if)# spanning-tree bpfilter enable /---在不啟用Port Fast特性的情況下啟用BPDU Filtering---/ LOOP Guard主要用來避免阻塞埠錯誤地過渡到轉發狀態而產生橋接環路的情況;當交換機在啟用loop guard特性的非指定埠上停止接收BPDU時,交換機將使得埠進入STP「不一致環路(inconsistentports)阻塞狀態,當不一致埠再次收到BPDU時,埠將根據BPDU自動過濾到STP狀態。通過sh spanning-tree inconsistentports命令可以查看不一致埠狀態。loopguard特性默認開啟。
Loop Guard:防止一個阻斷的埠由於鏈路不正常(不能雙向通信等)接不到BPDU後變成轉發,配了此項後,即使接不到BPDU也是阻斷的loop-inconsistent blocking state(啟用loop guard時自動關閉root guard);
Loop guard在RP介面或替代埠啟用:
Switch(config-if)# spanning-tree guard loop
全局啟用:
Switch(config)#spantree global-default loopguard enable
如果在一個啟用了root guard的埠上啟用loop guard,loop guard將禁用root guard功能。
④ H3C S5500-EI中 bp guard如何配置
2012-06-05 09:06 BPDU Guard(BPDU保護) BPDU保護僅用在PortFast模式。它被網路設計者用來加強STP域邊界,通常來對接入終端的邊緣埠進入配置,從而保持交換網路的拓撲不受影響。在啟用STP PortFast埠之後的設備被禁止影響STP拓撲。通過配置BPDU保護後,埠如果收到BPDU,將會把埠狀態調整到Err-Disable.如下是一個出錯信息:
2000 May 12 15:13:32 %SPANTREE-2-RX_PORTFAST:Received BPDU on PortFast enable port. Disabling 2/1
2000 May 12 15:13:32 %PAGP-5-PORTFROMSTP:Port 2/1 left bridge port 2/1
如圖所示,A的優先順序為10,為該vlan的根橋,B的優先順序為20,為備份根橋,B和A之間的鏈路為Gbit/s鏈路,正確的BPDU流向,如下圖如果D為一台基於Linux的軟體網橋,可以發送BPDU報文,並將自身BID的優先順序設置為0,此時,D將成為根橋,故BPDU流向變為右圖, A,B間的Gbit/s鏈路被阻塞,通過C走100Mbit/s鏈路。此時會超負載出現丟包的情況, BPDU保護的目的就是基於這種情況,防止接入設備對整個網路拓撲的影響。 配置方式:
在全局模式:
Switch(config)#spanning-tree portfast bpguard default
介面模式:
Switch(config-if)#spanning-tree bpguard enable
注意在全局模式配置了portfast默認打開BPDU保護,需要在相應的介面上打開portfast才能啟用
⑤ 如何配置bp-tunnel透傳bp報文
配置IOS重新激活errdisable的介面,使用以下命令:sw1(config)#errdisable recovery cause bpguard sw1(config)#errdisable recovery cause ? all Enable timer to recover from all causes bpguard Enable timer to recover from BPDU Guard error disable state channel-misconfig Enable timer to recover from channel misconfig disable state dhcp-rate-limit Enable timer to recover from dhcp-rate-limit error disable state dtp-flap Enable timer to recover from dtp-flap error disable state gbic-invalid Enable timer to recover from invalid GBIC error disable state l2ptguard Enable timer to recover from l2protocol-tunnel error disable state link-flap Enable timer to recover from link-flap error disable state loopback Enable timer to recover from loopback detected disable state pagp-flap Enable timer to recover from pagp-flap error disable state psecure-violation Enable timer to recover from psecure violation disable state ...展開配置IOS重新激活errdisable的介面,使用以下命令:sw1(config)#errdisable recovery cause bpguard sw1(config)#errdisable recovery cause ? all Enable timer to recover from all causes bpguard Enable timer to recover from BPDU Guard error disable state channel-misconfig Enable timer to recover from channel misconfig disable state dhcp-rate-limit Enable timer to recover from dhcp-rate-limit error disable state dtp-flap Enable timer to recover from dtp-flap error disable state gbic-invalid Enable timer to recover from invalid GBIC error disable state l2ptguard Enable timer to recover from l2protocol-tunnel error disable state link-flap Enable timer to recover from link-flap error disable state loopback Enable timer to recover from loopback detected disable state pagp-flap Enable timer to recover from pagp-flap error disable state psecure-violation Enable timer to recover from psecure violation disable state security-violation Enable timer to recover from 802.1x violation disable state udld Enable timer to recover from udld error disable state unicast-flood Enable timer to recover from unicast flood disable state vmps Enable timer to recover from vmps shutdown error disable收起
⑥ 華為交換機命令解析。請高手幫我逐條解析一下,謝謝!
system-view 進入系統視圖
vlan batch 109 209 創建vlan109到vlan209
dhcp enable 打開dhcp
dhcp snooping enable 打開dhcp snooping
stp bp-protection 啟動bp保護功能
stp enable 打開stp
interface Eth-Trunk1 進入 Eth-Trunk1介面
stp disable 顯示stp信息
port link-type trunk 設置為trunk借口
trunkport GigabitEthernet 0/1/1 0/1/2 加入GigabitEthernet 0/1/1 0/1/2
undo port trunk allow-pass vlan 1 trunk介面不允許vlan1通過
port trunk allow-pass vlan 109 209 trunk介面允許vlan109-209通過
dhcp snooping trusted 設置dhcp snoping 信任埠
description to S5728_SZVE3BSLHW02_G0/0/1_G1/0/1 10.170.27.5 描述語句,與 S5728_SZVE3BSLHW02_G0/0/1連接,對端IP為10.170.27.5
quit 退出到上一級
vlan 109 進入vlan109
dhcp snooping enable 打開dhcp
dhcp snooping trusted interface Eth-Trunk1 應用到trusted介面interface Eth-Trunk1上
vlan 209 進入vlan209
dhcp snooping enable 打開dhcp
dhcp snooping trusted interface Eth-Trunk1 應用到trusted介面interface Eth-Trunk1上
return 返回用戶視圖
system-view 進入系統視圖
info-center loghost 10.72.52.25 facility local1 將info-center的log消息(運行信息文件 例如埠up down,ospf,bgp的信息等)保存在日至伺服器上,日至伺服器地址為10.72.52.25
sysname szve3bslhw08 系統名稱命名為szve3bslhw0
super password level 3 cipher hr1ycfl!1314 設置超級管理員cipher認證密碼hr1ycfl!1314
interface Vlanif 109 進入Vlanif 109介面
ip address 10.170.27.6 255.255.255.0 設置介面IP為10.170.27.6,24位掩碼
quit 退出到上一級
ip route-static 0.0.0.0 0.0.0.0 10.170.27.1 設置靜態路由,指向10.170.27.1
FTP server enable 打開ftp服務
⑦ 誰能幫我逐條解釋華為交換機的配置命令,謝謝!!
>system\\進入用戶視圖
] sysname C2960\\更改交換機名為C2960
] vlan batch 2 to 4094\\創建2至4094號vlan
] stp bp-protection\\啟用BPDU保護邊緣埠
] domain abc\\AAA RADIUS HWTACACS命令
] domain abc1 admin\\AAA RADIUS HWTACACS命令
] undo http server enable\\關閉設備web網管功能
] aaa\\本地認證授權
aaa] local-user abc password cipher cisco\\新建本地用戶賬號名abc 登錄密碼cisco 密文加密
aaa] local-user abc privilege level 15\\賬號abc 許可權級別為15(最高許可權)
aaa] local-user abc service-type telnet\\賬號abc 登錄方式為 telnet
aaa] quit\\退出aaa配置模式
] interface Vlanif100\\進入vlan 100 配置交換機管理ip
vlanif100] ip address 192.168.1.1 255.255.255.0\\配置vlan100為交換機默認管理vlan,設置管理地址ip為192.168.1.1 255.255.255.0
vlanif100] undo shut\\啟用vlan100
vlanif100] quit\\退出vlan100配置
] ip route-static 0.0.0.0 0.0.0.0 192.168.10.254\\設置交換機網關默認路由
]user-interface con 0\\進入交換機console 0口配置模式
console0] user privilege level 15\\連接console 0的用戶許可權級別為15 (最高許可權)
console0] authentication-mode password\\設置接入console 0口時用戶需要輸入密碼
console0] set authentication password cipher cisco\\配置接入console 0口的用戶密碼為cisco 密文加密
console0] quit\\退出 console 0口配置模式
] user-interface vty 0 4\\配置遠程telnet
vty0-4] user privilege level 15\\telnet 0-4口 接入的用戶級別為15(最高級別)
vty0-4] authentication-mode aaa\\認證模式為aaa
vty0-4] idle-timeout 10\\10分鍾內用戶與設備間沒有信息交互 設備將斷開遠程連接
vty0-4] quit\\退出telnet配置模式
] ntp-service unicast-server 192.168.1.2\\進入配置NTP伺服器192.168.1.2 時間同步
] header login information ^\\設置登錄時的顯示信息
⑧ 什麼是BPDU防護它起什麼作用它和BPDU過濾有什麼區別
bp:
bridge protocol data unit,橋接協議數據單元
對於參與stp的一個擴展的區域網中的所有交換機,他們都通過數據消息的交換來獲取網路中的其他交換機的信息,這些消息被稱為bp
bp一旦出現異常,這個stp區域中的交換機將可能全部陷入混亂
如果介面啟用了stp portfast,這個介面將不會經過監聽、學習兩個狀態,在接入設備之後會立刻進入轉發狀態,這個時候如果接入的設備是其他的網路中的stp根橋,這個時候就會造成交換機的混亂
bp保護就是針對stp portfast的意外接入非法設備所進行的處理
bp保護在stp portfast埠上一旦接收了bp數據,就會立刻使這個介面進入「err-disable」狀態,必須由管理員手動重新啟用「arr-disable」狀態的介面。
要啟用bp保護功能
在全局控制模式下鍵入
spanning-tree portfast bpguard
就可以啟用該功能,關閉此功能在前面+no
⑨ cisco交換機是否有tc-bp保護功能,命令是什麼
TC保護,華3、華為有這個命令。思科木有!
⑩ 華三接入層交換機需注意配置的幾項細節
1、查看交換機上應用的配置文件
[h3c]dis startup
Current startup saved-configuration file: flash:/config.cfg
Next main startup saved-configuration file: flash:/config.cfg
Next backup startup saved-configuration file: NULL
2、配置主備配置文件
<h3c>startup saved-configuration config.cfg ?
backup Backup config file
main Main config file
<cr>
3、Telnet 用戶認證方式登錄
user-interface vty 0 4
authentication-mode scheme
user privilege level 3
Telnet 密碼方式登錄
user-interface aux 0
user-interface vty 0 4
user privilege level 3
set authentication password simple abc
新建用戶
local-user admin
password simple abcpassword
service-type telnet
level 3
4、配置MSTP
stp enable
stp region-configuration
region-name abc
revision-level 1
instance 1 vlan 200
active region-configuration
*********************************************************
5 、配置接入層交換機只接電腦,不能接交換機,避免已經配置好的生成樹受新添加的交換機影響造成網路的不穩定。
stp bp-protection
對於接入層設備,接入埠一般直接與用戶終端(如PC機)或文件伺服器相連,此時接入埠被設置為邊緣埠以實現這些埠的快速遷移。當這些邊緣埠接收到配置消息後,系統會自動將這些埠設置為非邊緣埠,重新計算生成樹,這樣就引起網路拓撲的震盪。
正常情況下,邊緣埠應該不會收到生成樹協議的配置消息。如果有人偽造配置消息惡意攻擊交換機,就會引起網路震盪。BPDU保護功能可以防止這種網路攻擊。交換機上啟動了BPDU保護功能以後,如果邊緣埠收到了配置消息,系統就將這些埠關閉,同時通知網管這些埠被MSTP關閉。被關閉的邊緣埠只能由網路管理人員恢復。
配置埠為邊緣埠
[h3c]interface Ethernet1/0/5
[h3c-Ethernet1/0/5]stp edged-port enable
對於直接與終端相連的埠,請將該埠設置為邊緣埠,同時啟動BPDU保護功能。這樣既能夠使該埠快速遷移到轉發狀態,也可以保證網路的安全。
**********************************************************
6、DHCP Snooping防止非法DHCP伺服器分發地址影響正常網路
例:
開啟交換機DHCP Snooping功能
[h3c]DHCP Snooping
配置合法的DHCP伺服器轉發埠
[h3c]interface Ethernet1/0/5
[h3c-Ethernet1/0/5]dhcp-snooping trust
配置防DHCP伺服器仿冒功能
例:
開啟交換機DHCP Snooping功能
[h3c]DHCP Snooping
開啟防DHCP伺服器仿冒功能
[h3c]interface Ethernet1/0/5
[h3c-Ethernet1/0/5]dhcp-snooping server-guard enable
意思是在埠上啟用仿冒功能,萬一有非法DHCP伺服器進入即觸發預設置的策略
配置防DHCP伺服器仿冒功能的處理策略
[h3c-Ethernet1/0/5]dhcp-snooping server-guard method { trap | shutdown }
預設情況下,交換機防DHCP伺服器仿冒功能的處理策略為trap
顯示DHCP伺服器仿冒相關信息
display dhcp-snooping server-guard
其實配置snooping和仿冒功能效果都是一樣,防止非法的DHCP伺服器進入網路,只是h3c交換機不同型號支持的方法不同。
匯總有點亂,都是平時配置接入層交換機時經常用到的,也解決了不少問題,現在發上來,一個是自己留個記錄,二是也給大家參考一下,或者大家看後,覺得還有什麼需要補充的配置,盡管說,共同學習。