Switch(config-if)# switchport trunk allowed vlan remove 2 Switch(config-if)# end 配置Native VLAN(802.1q) configure terminal 进入配置状态
interface interface-id 进入配置成802.1qtrunk的端口 switchport trunk native vlan vlan-Id 配置native VLAN号 no switchport trunk native vlan 端口配置命令回到缺省的状态 配置基于端口权值的负载均衡
configure terminal 进入Switch 1配置状态 vtp domain domain-name 配置VTP域
vtp mode server 将Switch 1配置成VTP server. show vtp status 验证VTP的配置 show vlan 验证VLAN
configure terminal 进入配置状态
interface fastethernet 0/1 进入F0/1端口
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装 switchport mode trunk 配置成trunk
show interfaces fastethernet0/1 switchport 验证VLAN配置 按以上步骤对想要负载均衡的接口进行配置 在另一个交换机上进行此配置
show vlan 当trunk已经起来,在switch2上验证已经学到相的vlan配置 configure terminal 在Switch 1上进入配置状态 interface fastethernet0/1 进入要配置的端口
spanning-tree vlan 8 port-priority 10 将端口权值10赋与VLAN 8. spanning-tree vlan 9 port-priority 10 将端口权值10赋与VLAN 9. spanning-tree vlan 10 port-priority 10 将端口权值10赋与VLAN 10. interface fastethernet0/2 进入F0/2
spanning-tree vlan 3 port-priority 10 将端口权值10赋与VLAN 3. spanning-tree vlan 4 port-priority 10 将端口权值10赋与VLAN 4 spanning-tree vlan 5 port-priority 10 将端口权值10赋与VLAN 5 spanning-tree vlan 6 port-priority 10 将端口权值10赋与VLAN 10 end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
配置STP路径值的负载均衡
Trunk1走VLAN8-10,Trunk2走VLAN2-4
configure terminal 进入 Switch 1配置状态 interface fastethernet 0/1 进入F0/1
switchport trunk encapsulation {isl | dot1q | negotiate}配置封装 switchport mode trunk 配置Trunk,缺省是ISL封装 exit 退回
在F0/2口上重复2-4步骤 exit 退回
show running-config 验证配置 show vlan验证switch1 已经学到Vlan configure terminal 进入配置状态 interface fastethernet 0/1 进入F0/1
spanning-tree vlan 2 cost 30 设置Vlan2生成树路径值为30 spanning-tree vlan 3 cost 30 设置Vlan3生成树路径值为30 spanning-tree vlan 4 cost 30 设置Vlan4生成树路径值为30 end 退出
在switch1的F0/2上重复9-11步骤设置VLAN8,9,10生成树路径值为30 end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
补充:CISCO命令集——路由选择协议及排障 *ip route命令
Router(config)# ip route <目录网络或子网号> [子网掩码] <下一路由器IP地址 | 从本地出口的地址> [管理距离0~255,默认为1] (注:静态地址配置)
*ip default-network命令
Router(config)# ip default-network <目标网络号>
(注:配合路由协使用,用其中的一个动态路由号作默认路由配置)
Router(config)# ip route 0.0.0.0 0.0.0.0 <下一路由器IP地址 | 从本地出口的地址> (注:只有一个公网地址时,在出口路由器上的配置)
*内部路由选择协议
*使用router和network命令
Router(config)# router <路由协议rip | igrp | eigrp | ospf | is-is等> [自主系统号] Router(config-router)# network <直接相连的要用此路由协议的网络号> Router(config-router)# network <直接相连的要用此路由协议的网络号>
*路由信息协议RIP
Router(config)# router rip
Router(config-router)# network <直接相连的要用rip协议的有类别网络号> Router# show ip protocols Router# show ip route Router# debug ip rip
*内部网关路由协议IGRP
Router(config)# router igrp <自主系统号>
Router(config-router)# network <直接相连的要用igrp协议的有类别网络号> Router# show ip interface Router# show ip protocols Router# show ip route Router# debug ip rip
*排除网络故障
排除网络故障的一个总体模型
Router# ping <有故障的主机 | 有故障的IP地址> Router# show ip route
Router# show interface <有故障的接口> Router# show run
*IP的故故障排除
检查可用的路由
Router# show ip route <有故障的IP地址> 27.4.4 跟踪路由(Tracing the Route)
SUN-A> traceroute <有故障的主机 | 有故障的IP地址> C:\\windows\\> winipcfg C:\\windows\\> ipconfig C:\\windows\\> ipconfig / all
C:\\windows\\> tracert <有故障的主机 | 有故障的IP地址>
使用扩展的ping来跟踪连接性
Router# ping
*其它可能的故障
一个地址解析(ARP)的故障
Router# show arp
Router# show interface <有故障的接口> C:\\windows\\> arp -a SUN-A> arp –a
验证终端系统的路由表 C:\\windows\\> netstat –rn
C:\\windows\\> route –f add 0.0.0.0 mask 0.0.0.0 <需要添加入的网关地址>
C:\\windows\\> route [–f ] [[print | add | delete | change] [destination] [mask netmask] [gateway]]
C:\\windows\\> route add mask <网络掩码> <网关ip地址> C:\\windows\\> route delete mask <网络掩码> <网关ip地址> C:\\windows\\> nbtstat <相应的参数> SUN-A> netstat -rn路由器
cisco命令大全解释、注释



