Cisco路由器配置命令大全Word文档格式.docx

上传人:b****3 文档编号:18009651 上传时间:2022-12-12 格式:DOCX 页数:25 大小:27.46KB
下载 相关 举报
Cisco路由器配置命令大全Word文档格式.docx_第1页
第1页 / 共25页
Cisco路由器配置命令大全Word文档格式.docx_第2页
第2页 / 共25页
Cisco路由器配置命令大全Word文档格式.docx_第3页
第3页 / 共25页
Cisco路由器配置命令大全Word文档格式.docx_第4页
第4页 / 共25页
Cisco路由器配置命令大全Word文档格式.docx_第5页
第5页 / 共25页
点击查看更多>>
下载资源
资源描述

Cisco路由器配置命令大全Word文档格式.docx

《Cisco路由器配置命令大全Word文档格式.docx》由会员分享,可在线阅读,更多相关《Cisco路由器配置命令大全Word文档格式.docx(25页珍藏版)》请在冰豆网上搜索。

Cisco路由器配置命令大全Word文档格式.docx

showhistory查看历史记录

showterminal查看终端记录大小

hostname+主机名配置路由器或交换机的标识

configmemory修改保存在NVRAM中的启动配置

exectimeout00设置控制台会话超时为0

servicepassword-encryptin手工加密所有密码

enablepassword+密码配置明文密码

enasec+密码配置密文密码

linevty04/15进入telnet接口

password+密码配置telnet密码

lineaux0进入AUX接口

password+密码配置密码

linecon0进入CON接口

bandwidth+数字配置带宽

noipaddress删除已配置的IP地址

showstartupconfig查看NVRAM中的配置信息

copyrun-configatartupconfig保存信息到NVRAM

write保存信息到NVRAM

erasestartup-config清除NVRAM中的配置信息

showipinterfacebrief查看接口的谪要信息

bannermotd#+信息+#配置路由器或交换机的描素信息

description+信息配置接口听描素信息

vlandatabase进入VLAN数据库模式

vlan+vlan号+名称创建VLAN

switchportaccessvlan+vlan号为VLAN为配接口

interfacevlan+vlan号进入VLAN接口模式

ipadd+ip地址为VLAN配置管理IP地址

vtp+service/tracsparent/client配置SW的VTP工作模式

vtp+domain+域名配置SW的VTP域名

vtp+password+密码配置SW的密码

switchportmodetrunk启用中继

novlan+vlan号删除VLAN

showspamming-treevlan+vlan号查看VLA怕生成树议

2.路由器配置命令

iproute+非直连网段+子网掩码+下一跳地址配置静态/默认路由

showiproute查看路由表

showprotocols显示出所有的被动路由协议和接口上哪些协议被设置

showipprotocols显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用

的定时器

等信息

routerrip激活RIP协议

network+直连网段发布直连网段

interfacelookback0激活逻辑接口

passive-interface+接口类型+接口号配置接口为被动模式

debugip+协议动态查看路由更新信息

undebugall关闭所有DEBUG信息

routereigrp+as号激活EIGRP路由协议

network+网段+子网掩码发布直连网段

showipeigrpneighbors查看邻居表

showipeigrptopology查看拓扑表

showipeigrptraffic查看发送包数量

routerospf+process-ID激活OSPF协议

network+直连网段+area+区域号发布直连网段

showipospf显示OSPF的进程号和ROUTER-ID

encapsulation+封装格式更改封装格式

noipadmain-lookup关闭路由器的域名查找

iprouting在三层交换机上启用路由功能

showuser查看SW的在线用户

clearline+线路号清除线路

3.三层交换机配置命令

配置一组二层端口

configureterminal进入配置状态

nterfacerange{port-range}进入组配置状态

配置三层端口

interface{{fastethernet|gigabitethernet}interface-id}|{vlanvlan-id}|{port-

channelport-channel-number}进入端口配置状态

noswitchport把物理端口变成三层口

ipaddressip_addresssubnet_mask配置IP地址和掩码

noshutdown激活端口

例:

Switch(config)#interfacegigabitethernet0/2

Switch(config-if)#noswitchport

Switch(config-if)#ipaddress192.20.135.21255.255.255.0

Switch(config-if)#noshutdown

配置VLAN

vlanvlan-id输入一个VLAN号,然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改

namevlan-name可选)输入一个VLAN名,如果没有配置VLAN名,缺省的名字是VLAN号前面用0填满

的4位数,如VLAN0004是VLAN4的缺省名字

mtumtu-size(可选)改变MTU大小

Switch#configureterminal

Switch(config)#vlan20

Switch(config-vlan)#nametest20

Switch(config-vlan)#end

Switch#vlandatabase

Switch(vlan)#vlan20nametest20

Switch(vlan)#exit

将端口分配给一个VLAN

interfaceinterface-id进入要分配的端口

switchportmodeaccess定义二层口

switchportaccessvlanvlan-id把端口分配给某一VLAN

Switch#configureterminal

Enterconfigurationmands,oneperline.EndwithTL/Z.

Switch(config)#interfacefastethernet0/1

Switch(config-if)#switchportmodeaccess

Switch(config-if)#switchportaccessvlan2

Switch(config-if)#end

Switch#

配置VLANtrunk

interfaceinterface-Id进入端口配置状态

switchporttrunkencapsulation{isl|dot1q|negotiate}配置trunk封装ISL或802.1Q或

自动协商

switchportmode{dynamic{auto|desirable}|trunk}配置二层trunk模式。

dynamicauto—自动协商是否成为trunk

dynamicdesirable—把端口设置为trunk如果对方端口是trunk,desirable,配置NativeVLAN

(802.1q)

或自动模式,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunk

switchportaccessvlanvlan-id可选)指定一个缺省VLAN,如果此端口不再是trunk

switchporttrunknativevlanvlan-id指定802.1QnativeVLAN号

Switch(config)#interfacefastethernet0/4

Switch(config-if)#switchportmodetrunk

Switch(config-if)#switchporttrunkencapsulationdot1q

定义TRUNK允许的VLAN

configureterminal子进入配置状态

interfaceinterface-id进入端口配置

switchportmodetrunk配置二层口为trunk

switchporttrunkallowedvlan{add|all|except|remove}vlan-list可选)配置trunk允

许的VLAN.使用add,all,except,remove关健字

noswitchporttrunkallowedvlan允许所有VLAN通过

Switch(config)#interfacefastethernet0/1

Switch(config-if)#switchporttrunkallowedvlanremove2

Switch(config-if)#end

配置NativeVLAN(802.1q)

interfaceinterface-id进入配置成802.1qtrunk的端口

switchporttrunknativevlanvlan-Id配置nativeVLAN号

noswitchporttrunknativevlan端口配置命令回到缺省的状态

配置基于端口权值的负载均衡

configureterminal进入Switch1配置状态

vtpdomaindomain-name配置VTP域

vtpmodeserver将Switch1配置成VTPserver.

showvtpstatus验证VTP的配置

showvlan验证VLAN

interfacefastethernet0/1进入F0/1端口

switchporttrunkencapsulation{isl|dot1q|negotiate}配置trunk封装

switchportmodetrunk配置成trunk

showinterfacesfastethernet0/1switchport验证VLAN配置

按以上步骤对想要负载均衡的接口进行配置

在另一个交换机上进行此配置

showvlan当trunk已经起来,在switch2上验证已经学到相的vlan配置

configureterminal在Switch1上进入配置状态

interfacefastethernet0/1进入要配置的端口

spanning-treevlan8port-priority10将端口权值10赋与VLAN8.

spanning-treevlan9port-priority10将端口权值10赋与VLAN9.

spanning-treevlan10port-priority10将端口权值10赋与VLAN10.

interfacefastethernet0/2进入F0/2

spanning-treevlan3port-priority10将端口权值10赋与VLAN3.

spanning-treevlan4port-priority10将端口权值10赋与VLAN4

spanning-treevlan5port-priority10将端口权值10赋与VLAN5

spanning-treevlan6port-priority10将端口权值10赋与VLAN10

end退出

showrunning-config验证配置

copyrunning-configstartup-config保存配置

配置STP路径值的负载均衡

Trunk1走VLAN8-10,Trunk2走VLAN2-4

configureterminal进入Switch1配置状态

interfacefastethernet0/1进入F0/1

switchporttrunkencapsulation{isl|dot1q|negotiate}配置封装

switchportmodetrunk配置Trunk,缺省是ISL封装

exit退回

在F0/2口上重复2-4步骤

showvlan验证switch1已经学到Vlan

spanning-treevlan2cost30设置Vlan2生成树路径值为30

spanning-treevlan3cost30设置Vlan3生成树路径值为30

spanning-treevlan4cost30设置Vlan4生成树路径值为30

在switch1的F0/2上重复9-11步骤设置VLAN8,9,10生成树路径值为30

补充:

CISCO命令集——路由选择协议及排障

*iproute命令

Router(config)#iproute<

目录网络或子网号>

[子网掩码]<

下一路由器IP地址|从本地出口

的地址>

[管理距离0~255,默认为1]

(注:

静态地址配置)

*ipdefault-network命令

Router(config)#ipdefault-network<

目标网络号>

配合路由协使用,用其中的一个动态路由号作默认路由配置)

Router(config)#iproute0.0.0.00.0.0.0<

下一路由器IP地址|从本地出口的地址>

只有一个公网地址时,在出口路由器上的配置)

*内部路由选择协议

*使用router和network命令

Router(config)#router<

路由协议rip|igrp|eigrp|ospf|is-is等>

[自主系统号]

Router(config-router)#network<

直接相连的要用此路由协议的网络号>

*路由信息协议RIP

Router(config)#routerrip

直接相连的要用rip协议的有类别网络号>

Router#showipprotocols

Router#showiproute

Router#debugiprip

*内部网关路由协议IGRP

Router(config)#routerigrp<

自主系统号>

直接相连的要用igrp协议的有类别网络号>

Router#showipinterface

*排除网络故障

排除网络故障的一个总体模型

Router#ping<

有故障的主机|有故障的IP地址>

Router#showinterface<

有故障的接口>

Router#showrun

*IP的故故障排除

检查可用的路由

Router#showiproute<

有故障的IP地址>

27.4.4跟踪路由(TracingtheRoute)

SUN-A>

traceroute<

C:

\windows\>

winipcfg

ipconfig

ipconfig/all

tracert<

使用扩展的ping来跟踪连接性

Router#ping

*其它可能的故障

一个地址解析(ARP)的故障

Router#showarp

arp-a

arp–a

验证终端系统的路由表

netstat–rn

route–fadd0.0.0.0mask0.0.0.0<

需要添加入的网关地址>

route[–f][[print|add|delete|change][destination][mask

netmask][gateway]]

routeaddmask<

网络掩码>

<

网关ip地址>

routedeletemask<

nbtstat<

相应的参数>

netstat-rn路由器

CISCO交换机配置命令大全2009-08-1321:

131.在基于IOS的交换机上设置主机名/系统名:

switch(config)#hostnamehostname

在基于CLI的交换机上设置主机名/系统名:

switch(enable)setsystemnamename-string

2.在基于IOS的交换机上设置登录口令:

switch(config)#enablepasswordlevel1password

在基于CLI的交换机上设置登录口令:

switch(enable)setpassword

switch(enable)setenalbepass

3.在基于IOS的交换机上设置远程访问:

switch(config)#interfacevlan1

switch(config-if)#ipaddressip-addressnetmask

switch(config-if)#ipdefault-gatewayip-address

在基于CLI的交换机上设置远程访问:

switch(enable)setinterfacesc0ip-addressnetmaskbroadcast-address

switch(enable)setinterfacesc0vlan

switch(enable)setiproutedefaultgateway

4.在基于IOS的交换机上启用和浏览CDP信息:

switch(config-if)#cdpenable

switch(config-if)#nocdpenable

为了查看Cisco邻接设备的CDP通告信息:

switch#showcdpinterface[typemodle/port]

switch#showcdpneighbors[typemodule/port][detail]

在基于CLI的交换机上启用和浏览CDP信息:

switch(enable)setcdp{enable|disable}module/port

switch(enable)showcdpneighbors[module/port][vlan|duplex|capabilities|detail]

5.基于IOS的交换机的端口描述:

switch(config-if)#descriptiondescription-string

基于CLI的交换机的端口描述:

switch(enable)setportnamemodule/numberdescription-string

6.在基于IOS的交换机上设置端口速度:

switch(config-if)#speed{10|100|auto}

在基于CLI的交换机上设置端口速度:

switch(enable)setportspeedmoudle/number{10|100|auto}

switch(enable)setportspeedmoudle/number{4|16|auto}

7.在基于IOS的交换机上设置以太网的链路模式:

switch(config-if)#duplex{auto|full|half}

在基于CLI的交换机上设置以太网的链路模式:

switch(enable)setportduplexmodule/number{full|half}

8.在基于IOS的交换机上配置静态VLAN:

switch#

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1