CISCO交换机和路由器基本配置.docx

上传人:b****0 文档编号:985072 上传时间:2022-10-14 格式:DOCX 页数:16 大小:23.52KB
下载 相关 举报
CISCO交换机和路由器基本配置.docx_第1页
第1页 / 共16页
CISCO交换机和路由器基本配置.docx_第2页
第2页 / 共16页
CISCO交换机和路由器基本配置.docx_第3页
第3页 / 共16页
CISCO交换机和路由器基本配置.docx_第4页
第4页 / 共16页
CISCO交换机和路由器基本配置.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

CISCO交换机和路由器基本配置.docx

《CISCO交换机和路由器基本配置.docx》由会员分享,可在线阅读,更多相关《CISCO交换机和路由器基本配置.docx(16页珍藏版)》请在冰豆网上搜索。

CISCO交换机和路由器基本配置.docx

CISCO交换机和路由器基本配置

一CISCO交换机和路由器基本配置

交换机的配置

1用户模式

switch>

2进入特权模式

switch>enable  

3进入全局配置模式,全局模式的配置对整个交换机生效.

switch#configterminal  

switch(config)#

4进入接口模式,配置只对当前的接口生效

switch(config)#interfacef0/1  

switch(config-if)#

进入line模式,这个模式主要用来对控制台做相应的配置

5switch(config)#lineconsole0

switch(config-line)

6配置主机名

switch(config)#hostname主机名

7配置使能口令

switch(config)#enablepassword密码

8配置加密使能口令

switch(config)#enablesecret密码

9配置ip地址

switch(config)#interfacevlan1

switch(config)#ip  addip地址子网掩码

switch(config)#noshutdown

10配置交换机的网关

switch(config)#ipdefault-gatewayip地址

11保存配置

switch#copyruning-configstartup-config

switch#write

12清空配置

switch#erasestartup-config

13清空接口配置

switch(config)#interfacef0/1

switch(config-if)#defaultinterfacef0/1

14清空交换机密码

(1)关闭电源.

(2)开启电源,并且按住交换机的mode键,当交换机进入

................................

................................

     flash_init

     load_helper

     boot

switch:

(3)在switch后执行flash_init命令

switch:

flash-init

(4)在查看flash中的文件

switch:

dirflash:

/

(5)把config.text文件后缀名改了就可以,并且重新启动.(交换机重启后不会在读取配置文件了)

switch:

renameflash:

config.textconfig.old

switch:

boot

(6)启动后进入特权模式查看flash里面的文件,并且把config.text文件改回来.并且把flash里面的文件复制到内存中

switch#renameflash:

config.oldflash:

config.text

switch#copystartup-configrunning-config

15创建vlan2

switch(config)#vlan2

16删除vlan2

switch(config)#novlan2

17把端口f0/5到10添加到vlan2

switch(config)#interfacerangef0/5-10

switch(config)#switchportaccessvlan2

18将f0/1设置成中trunk

switch(config)#interfacef0/1

switch(config)#switchportmodetrunk

19将f0/1设置成期望型或自动型

switch(config)#switchportdynamicdesirable/auto

20如果不需要trunk传送vlan2的数据,可以将vlan2从trunk中删除.

switch(config)#interfacef*/*  (trunk接口)

switch(cofnig-if)#switchprottrunkallowedvlanremovevlan2

21也可以添加vlan2

switch(config)#interfacef*/*  (trunk接口)

switch(config)#switchprottrunkallowedvlanaddvlan2

二交换机的查看命令

switch#showmac-address-table   查看本机的mac地址表

switch#showcdpneighbors  列出与本设备相连的cisco设备

switch#showrunning-config查看交换机的配置

switch#showvlanbrief  查看vlan的详细信息

switch#show  Internet   trunk可以查看生成树协议

三路由器配置命令

1配置默认路由

route(config)#iproute0.0.0.00.0.0.0下一跳

2配置静态路由

route(config)#iproute目的ip子网掩码下一跳

3对所有密码进行加密

route(config)#enable  password-encryption

4如果要使enable密码也以加密的形式保存在running-config中,中需运行

route(config)#servicepassword-encryption

5接口

route(config-if)#speed  10/100/auto(配置速率)

route(config-if)#duplex  auto/full/half(工作模式,自动/半双工/全双工)

route(config-if)#description文本(接口模式为当前接口列出希望跟踪的信息文本)

6对接口进行标识

route(config)#interfacef0/1

route(config)#description内容

7配置超时

route(route)#lineconsole0

route(route_line)#exec-timeout00(第一个0代表分钟,第二个0代表秒)

8配置telnet

route(route)#linevty05   (配置同时登陆的个数)

route(route)#password  密码(配置telnet密码)

route(route)#login

9配置ssh

route(route)#linevty05

route(route-line)#transport   ipput  telnet   ssh(同时接受telnet和ssh登陆)

route(route)#username   用户名  password  密码(配置用户名和密码)

route(route)#ip  domain-name域名(配置一个dns域名)

route(route)#cryptokeygenerate  RSA   (配置交换机生成一对匹配的公钥和私钥,以及一个共享的加密密钥)

route#showcryptokey  mypubkeyrsa(查看ssh密钥的副本)

route#showrunning-config|begin  linevty(查看当前运行的配置,从包含第一个linebty开始)

10显示同步

route(config)#lineocnsole0

route(config_line)#loggingsynchronous

11配置禁用dns

route(config)#no  ipdomain-lookup

12路由器的密码恢复

(1)重新启动路由器,在启动的60s内按下ctrl+break使路由器进入rommonitor模式

(2)在提示符下输入命令修改配置寄存器的值,然后程序启动

rommon1>confreg0x2142

rommon2>reset

route>enable

route#copystartup-config  running-config  (然后修改密码在保存)

route#config-register0x2102  (上系统在启动时读取配置文件)

route#write

13路由器和交换机的单臂路由

route(config)#interface接口类型槽位/接口序号.子接口

route(config-subif)#ipaddip地址子网掩码

route(config-subif)#encapsolation  dot1qvlan-id

14rip路由协议的配置

ripv2的配置

route(config)#route  rip

route(config-route)#version2

route(config-route)#nouato-summary

route(config-route)#network  主网络   宣告主网络号

四路由器查看命令

route#showinterface接口   查看接口的状态

route#show  ipint  b查看接口起用状态

route#showiproute  查看路由表

route#showversion查看路由器的版本信息

route#show  clock查看路由器当前的时间

route#showip  protocol  查看路由协议配置

route#showprotocols   显示配置的协议

route#showdebugiprip开启调试命令

route#Traceip地址  跟踪ip路由

五备份los和上传los

route#copy  startup-configtftp  备份los

route#copytftp   startup-config   上传los

route#copyrunning-configtftp备份配置文件

route#copytftp  running-config下载配置文件

六组合键

ctrl+shift+6中止解析

ctrl+z取消上一次操作

七vtp协议

1vtp协议慨述

vtp是vlan.中继协议,vtp协议是cisco的专用协议,做作用如下:

(1)保持vlan配置的一致性

(2)提供从一个交换机在正规管理域增加虚拟局域网的方法

2  vtp的工作原理

要使用vtp,就必须为每台交换机指定vtp域名一台交换机只能属于一个vtp域,不同域中的交换机不能共享vtp信息.vtp服务器上进行了vlan配置变更后,所做的vtp域内的所有交换机上.vtp消息通过所有的中继连接进行传播.域内的交换机都必须使用相同的vtp域

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

当前位置:首页 > 党团工作 > 入党转正申请

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

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