思科认证 百分网手机站

思科三层交换机配置命令(2)

时间:2017-06-18 19:23:06 思科认证 我要投稿

思科三层交换机配置命令大全

  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路由器