‘壹’ 求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,如果是两个不同厂商的交换机互联成环时才使用。