『壹』 求Cisco交換機STP(生成樹協議)具體配置實例
3台交換機,拓撲就不畫了。只是注意下埠,用f0/1 - 3。
交換機比較少,直接在三個交換機輸入命令,創建vlan 2
開始命令基本一樣
Switch>en
Switch#vlan d
Switch(vlan)#vlan 2
Switch(vlan)#^Z
Switch#conf t
Switch(config)#int r
Switch(config)#int range f0/1 - 3
Switch(config-if-range)#sw mode t
Switch(config-if-range)#no shutdown
至此,vlan 2 在三台上設置好了,在SW1上設置vlan2 的根網橋
SW1#conf terminal
SW1(config)#spanning-tree vlan 2 root primary
SW1(config)#^Z
設置好了,查看
SW1#show spanning-tree vlan 2
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 24578
Address 0009.7C82.5992
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24578 (priority 24576 sys-id-ext 2)
Address 0009.7C82.5992
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
『貳』 怎樣配cisco交換機的STP,並給出實例並附帶講解
你的原理不透徹,這是我上CCNA的筆記
STP 生成樹協議為了解決冗餘帶來的問題
配置之前要搞清楚這幾個問題:
1。交換機是如何發現網路是否存在環路的
2。交換機埠角色的選舉
3。埠狀態的轉換
不知道你這幾個清楚不?
就比如埠狀態就有5種 disable--》 blocking --》listening--》learning--》forwarding
交換機之間傳遞的是BPDU(橋協議數據單元)有倆中 1.、配置PBDU,用於基本的生成樹計算
2.、TNCPBDU 用於拓撲改變通告(一般就介紹第一種)
配置pb它的參數有1、橋ID,包含 橋優先順序 32768 交換機埠的MAC地址
2。根路徑開銷 cost 3
3、埠id 包含 埠優先順序 128 埠編號
STP演算法或者選舉過程我就不說了,都是最小原則。
根交換機
在網路中選舉一個橋ID最優的交換機作為根交換機。則比較首先比較優先順序,優先順序數值越小越優先;如果優先順序相同,則比較交換機的MAC地址,MACD地址越小的交換機越小越優先。
根埠
在網路中所有非根交換機上選擇一個埠,首先選擇到達根路徑開銷最小的埠,如果cost值相同。則比較BPDU 發送方 的橋ID,越小越優。如果橋Id相同在比較 發送方的埠ID。以此類推,一級一級的比較,越小越好。
指定埠:也是這樣的,在每條鏈路上都選擇一條。
下面就是命令,都是,基於你的要求和原理。
1、查看拓撲的生成樹 show spanning-tree
2、修改交換機的stp優先順序 (優先順序必須是4096的倍數,最大不超過65535)
spanning-tree vlan * priority *****
3、修改交換機的埠的cost spanning-tree vlan * cost *****
4、修改交換機的埠的優先順序 spanning-tree vlan * priority *****
『叄』 思科交換機STP的配置
http://www.netemu.cn/bbs/thread-10032-1-1.html
用上這個模擬器應該就能理解一些基本的東西了
『肆』 交換機的常用配置命令
a、更改遠程TELNNET密碼
Switch#configure terminal
Switch(config)#line vty 0 4
Switch(config-line)#password qycx123
Switch(config-line)#login
Switch(config-line)#exit
b、更改進入全局配置模式時的密碼
Switch#configure terminal
Switch(config)#enable secret qycx123
思科交換機常用命令——創建並劃分VLAN
a、創建VLAN
Switch#vlan database
Switch(vlan)#vlan 99 name office (創建vlan 99 並命名為office)
b、將埠劃分至vlan
Switch(config)#interface fastEthernet 0/8
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 99 (將8號快速以太口劃分至vlan 99)
思科交換機常用命令——調試命令
a、顯示所有配置命令:Switch#show run
b、顯示所有介面狀態:Switch#show ip int brief
c、顯示所有VLAN的信息:Switch#show vlan brief
cisco交換機還是比較常用的,於是我研究了一下Cisco交換機命令的大總結,在這里拿出來和大家分享一下,希望對大家有用。我所針對的都是Cisco的設備而言的,華為的可以跟據手冊來查,配置都是差不多的,這里華子就不多寫華為的設備了,了解的也不是很多。
Cisco交換機命令之使用Telnet遠程式管理
switch(config)#interface vlan 1 進入vlan 1
switch(config-if)#ip address 設置IP地址
switch(config-if)#ip default-gateway 設置默認網關
switch(config)#line vty 0 4 進入虛擬終端
switch(config-line)#login 允許登錄
switch(config-line)#password xx 設置登錄口令
switch#exit 返回命令
Cisco交換機命令之控制台口令
switch(config)#line console 0 進入控制台口
switch(config-line)#login 允許登錄
switch(config-line)#password xx 設置登錄口令
switch#exit 返回命令
Cisco交換機命令之基本介面配置
switch(config)#interface f0/1 進入f0/1介面
switch(config-if)#plex full 配置全雙工模式
switch(config-if)#speed 100 配置速率
switch(config-if)#description to ***** 介面描述
switch(config)#ip domain-name ***.com 設置或名伺服器
switch(config)#mac-address-table aging-time 設置mac表超時時間
switch#write 保存配置信息
switch# running-config startup-config 保存當前配置nvram
switch#erase startup-config 清除配置文件
Cisco交換機命令之交換機VLAN設置:
switch#vlan database 進入VLAN設置
switch(vlan)#vlan 2 建VLAN 2
switch(vlan)#name 名字 建VLAN 2的名稱
switch(vlan)#no vlan 2 刪vlan 2
注:刪除vlan時原屬於此vlan的埠處於非激活狀態,直到重新分配為止。
switch(config)#int f0/1 進入埠1
switch(config-if)#switchport mode access 當前埠工作莫試
switch(config-if)#switchport access vlan 2 當前埠加入vlan 2
switch(config-if)#switchport mode trunk 設置為干線
switch(config-if)#switchport trunk encapsulation dot1q 設置vlan 中繼協議
switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干線
switch(config-if)#switchport trunk allowed vlan add 1,2 ; 從Trunk中添加vlans
switch(config-if)#switchport trunk allowed vlan remove 1,2 ;從Trunk中刪除vlans
switch(config-if)#switchport trunk pruning vlan remove 1,2 ;從Trunk中關閉局部修剪
Cisco交換機命令之乙太網通道配置
switch(config)#interface range fasternet0/1 - 2 將fasternet0/1和0/2 口捆綁
switch(config-if)#channel-group 1 mode on 配置以太通道模式
switch(config-if)#port-channel load-balance {dst-mac | src-mac}在鏈路間實現負載均衡
switch#show etherchannel 1 summary 查看通道信息
switch#show etherchannel load-balance 查看通道信息
Cisco交換機命令之vtp配置
switch(config)#vtp domain 設置vtp域名
switch(config)#vtp password 設置vtp密碼
switch(config)#vtp mode server 設置vtp伺服器模式
switch(config)#vtp mode client 設置vtp客戶機模式
switch(config)#vtp mode transparent 設置vtp 透明模式
switch(config)#vtp version 設置vtp版本
switch(config)#vtp pruning 啟用vtp修解
switch(config)#no vtp pruning 關閉vtp修解
注:要想從vtp中減少一台交換機只需將該交換機vtp 名更改
Cisco交換機命令之生成樹stp:
switch(config)#spanning-tree vlan 啟用stp生成樹(基於vlan)
switch(config)#spanning-tree vlan root primary 指定根交換機(基於vlan)
switch(config)#spanning-tree vlan root secondary 指定備用根交換機(基於vlan)
switch(config)#spanning-tree vlan priority 指定交換機優先順序(基於vlan)
switch(config)#no spanning-tree vlan priority 將交換機的優先順序恢復默認值(基於vlan)
switch(config-if)#spanning-tree vlan cost 指定埠成本(起用trunk的埠模式下)
switch(config-if)#spanning-tree vlan port-prioty 指定交換機埠優先順序(基於vlan)
switch(config-if)#spanning-tree portfast 配置速埠(連接終端設備的埠狀態)如pc機
switch(config)#spanning-tree uplinkfast 配置上行速埠
switch(config)#spanning-tree vlan hello-time 配置交換機hello時間(基於vlan)
switch(config)#spanning-tree vlan forward-time 修改轉發延遲計時器(基於vlan)
switch(config)#spanning-tree vlan max-time 修改最大老化時間(基於vlan)
switch#show spanning-tree summery 檢測vlan生成樹配置
switch#show spanning-tree vlan detail 瀏覽詳細生成樹配置信息
switch#show spanning-tree interface detail 瀏覽詳細生成樹埠配置信息
Cisco交換機命令之交換機顯示命令:
switch#show vtp status 查看vtp配置信息
switch#show running-config 查看當前配置信息
switch#show vlan 查看vlan配置信息
switch#show interface 查看埠信息
switch#show int f0/0 查看指定埠信息
switch#dir flash: 查看快閃記憶體
switch#show version 查看當前版本信息
switch#show mac-address-table aging-time 查看mac超時時間
switch#show cdp cisco設備發現協議 (可以查看聆接設備)
switch#show cdp traffic 杳看接收和發送的cdp包統計信息
switch#show cdp neighbors 查看與該設備相鄰的cisco設備
switch#show interface f0/1 switchport 查看有關switchport的配置
switch#show cdp neighbors 查看與該設備相鄰的cisco設備
『伍』 1. 思科交換機常用的配置命令有哪些
enable , config t , vlan ,interface , ip address ,
『陸』 思科路由器如何設置生成樹模式
Switch(config)#spanning-tree ?
mode Spanning tree operating mode
portfast Spanning tree portfast options
vlan VLAN Switch Spanning Tree
Switch(config)#spanning-tree vlan n ?
priority Set the bridge priority for the spanning tree
root Configure switch as root
<cr>
Switch(config)#spanning-tree vlan 3 root ?
primary Configure this switch as primary root for this spanning tree
secondary Configure switch as secondary root
Switch(config)#spanning-tree vlan 3 root p
Switch(config)#spanning-tree vlan 3 root primary
pt上不知道命令的話就打?號,下面會出來相應的命令
有問題Q我
『柒』 STP配置問題
stp
有很多種mode,
如果是普通的stp,就直接在交換機上起用stp命令就行了,因為這種模式的stp只根物理鏈路有關,與
vlan無關,它會自動阻塞一個埠,如果不配埠優先順序的話,它會選擇f0/23埠做為阻塞埠。配置命令與廠商有關,思科交換機的是默認開啟的,而且不是這種模式,華為的是:
stp
enable。
如果是思科的交換機,可以使用stp
pvst模式,或者stp
pvst+模式,該模式是根據vlan而定的,可以通過修改埠優先順序,讓其在某個vlan阻塞f0/23,另外的vlan阻塞f0/24埠,修改埠優先順序的命令如下:
interface
f0/23
spanning-tree
cost
****(該值由你設置)
也可以通過指定根橋命令來確定你想要的根交換機。命令如下:
spanning-tree
pri
vlan
1
如果是mstp(國際標准多生成樹協議),則需要創建instance
來確定你在某些vlan中需要阻塞的埠。
一般不建議使用這種mode,如果是兩個不同廠商的交換機互聯成環時才使用。
『捌』 cisco思科stp如何配置,請給出詳細命令
『玖』 思科交換機詳細配置方法和命令
思科交換機的基本配置命令學習
一、交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname csico ;設置交換機的主機名
switch(config)#enable secret
csico1 ;設置特權加密口令
switch(config)#enable password csico8 ;設置特權非密口令
switch(config)#line console 0 ;進入控制台口
switch(config-line)#line vty 0 4
;進入虛擬終端
switch(config-line)#login ;虛擬終端允許登錄
switch(config-line)#password
csico6 ;設置虛擬終端登錄口令csico6
switch#exit ;返回命令
二、交換機顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當前配置信息
switch#show
vlan ;查看vlan配置信息
switch#show interface ;查看埠信息
switch#show int f0/0
;查看指定埠信息
switch#show int f0/0 status;查看指定埠狀態
switch#dir flash: ;查看快閃記憶體
Cisco路由器配置命令大全網路 2010-06-26 06:43:44 閱讀657 評論0 字型大小:大中小 訂閱 .
(1)模式轉換命令
用戶模式----特權模式,使用命令"enable"
特權模式----全局配置模式,使用命令"config
t"
全局配置模式----介面模式,使用命令"interface+介面類型+介面號"
全局配置模式----線控模式,使用命令"line+介面類型+介面號"
注:
用戶模式:查看初始化的信息.
特權模式:查看所有信息、調試、保存配置信息
全局模式:配置所有信息、針對整個路由器或交換機的所有介面
介面模式:針對某一個介面的配置
線控模式:對路由器進行控制的介面配置
(2)配置命令
show running config 顯示所有的配置
show
versin 顯示版本號和寄存器值
shut down 關閉介面
no shutdown 打開介面
ip add +ip地址
配置IP地址
secondary+IP地址 為介面配置第二個IP地址
show interface+介面類型+介面號 查看介面管理性
show controllers interface 查看介面是否有DCE電纜
show history 查看歷史記錄
show
terminal 查看終端記錄大小
hostname+主機名 配置路由器或交換機的標識
config memory
修改保存在NVRAM中的啟動配置
exec timeout 0 0 設置控制台會話超時為0
service password-encryptin
手工加密所有密碼
enable password +密碼 配置明文密碼
ena sec +密碼 配置密文密碼
line vty 0
4/15 進入telnet介面
password +密碼 配置telnet密碼
line aux 0 進入AUX介面
password
+密碼 配置密碼
line con 0 進入CON介面
password +密碼 配置密碼
bandwidth+數字 配置帶寬
no ip address 刪除已配置的IP地址
show startup config 查看NVRAM中的配置信息
run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase
startup-config 清除NVRAM中的配置信息
show ip interface brief 查看介面的謫要信息
banner
motd # +信息 + # 配置路由器或交換機的描素信息
description+信息 配置介面聽描素信息
vlan database
進入VLAN資料庫模式
vlan +vlan號+ 名稱 創建VLAN
switchport access vlan +vlan號
為VLAN為配介面
interface vlan +vlan號 進入VLAN介面模式
ip add +ip地址 為VLAN配置管理IP地址
vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名
vtp +password +密碼 配置SW的密碼
switchport mode trunk 啟用中繼
no vlan +vlan號
刪除VLAN
show spamming-tree vlan +vlan號 查看VLA怕生成樹議
三. 路由器配置命令
ip
route+非直連網段+子網掩碼+下一跳地址 配置靜態/默認路由
show ip route 查看路由表
show protocols
顯示出所有的被動路由協議和介面上哪些協議被設置
show ip protocols 顯示了被配置在路由器上的路由選擇協議,同時給出了在路由選擇協議中使用
的定時器
等信息
router rip 激活RIP協議
network +直連網段 發布直連網段
interface lookback 0 激活邏輯介面
passive-interface +介面類型+介面號 配置介面為被動模式
debug ip +協議 動態查看路由更新信息
undebug all 關閉所有DEBUG信息
router eigrp +as號
激活EIGRP路由協議
network +網段+子網掩碼 發布直連網段
show ip eigrp neighbors 查看鄰居表
show ip eigrp topology 查看拓撲表
show ip eigrp traffic 查看發送包數量
router
ospf +process-ID 激活OSPF協議
network+直連網段+area+區域號 發布直連網段
show ip ospf
顯示OSPF的進程號和ROUTER-ID
encapsulation+封裝格式 更改封裝格式
no ip admain-lookup
關閉路由器的域名查找
ip routing 在三層交換機上啟用路由功能
show user 查看SW的在線用戶
clear line
+線路號 清除線路
四. 三層交換機配置命令
配置一組二層埠
configure terminal 進入配置狀態
nterface range {port-range} 進入組配置狀態
配置三層埠
configure terminal 進入配置狀態
interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} |
{port-
channel port-channel-number} 進入埠配置狀態
no switchport
把物理埠變成三層口
ip address ip_address subnet_mask 配置IP地址和掩碼
no shutdown 激活埠
例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)#
no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0
Switch(config-if)# no shutdown
配置VLAN
configure terminal 進入配置狀態
vlan vlan-id 輸入一個VLAN號, 然後進入vlan配態,可以輸入一個新的VLAN號或舊的來進行修改
『拾』 求助多VLAN中STP配置
stp 有很多種mode, 如果是普通的stp,就直接在交換機上起用stp命令就行了,因為這種模式的stp只根物理鏈路有關,與 vlan無關,它會自動阻塞一個埠,如果不配埠優先順序的話,它會選擇f0/23埠做為阻塞埠。配置命令與廠商有關,思科交換機的是默認開啟的,而且不是這種模式,華為的是: stp enable。如果是思科的交換機,可以使用stp pvst模式,或者stp pvst+模式,該模式是根據vlan而定的,可以通過修改埠優先順序,讓其在某個vlan阻塞f0/23,另外的vlan阻塞f0/24埠,修改埠優先順序的命令如下:interface f0/23spanning-tree cost ****(該值由你設置)也可以通過指定根橋命令來確定你想要的根交換機。命令如下:spanning-tree pri vlan 1如果是mstp(國際標准多生成樹協議),則需要創建instance 來確定你在某些vlan中需要阻塞的埠。一般不建議使用這種mode,如果是兩個不同廠商的交換機互聯成環時才使用。