Cisco路由交换基本配置命令


(注:红色为变量)

 

1、路由配置ipr1config#interface f0/0
r1
config-if#ipadd 192.168.1.1255.255.255.0

 

r1(config-if)#no sh

 

2、交换机配置IPsw1config#interfacevlan 1

 

Sw1config-if#ip add 192.168.1.1255.255.255.0
sw2(config-if)#no sh

 

3、配置主机名:r1(或者sw1config#host name

 

4、显示系统及IOS名称及版本信息:sw1#shver

 

5、查看当前配置信息:sw1#showrun

 

6、查看以保存信息:sw1#showstar

 

7、保存当前配置:sw1#copyrunstar

 

8、删除已保存信息:sw1#erasenvram(真实机)/erasestartup-config(虚拟机)

 

9、永不超时:sw1config-line#exec-timeout00

 

10、显示同步:sw1config-line# logging synchronous

 

11、禁止dns查找:sw1config#noipdomain-10

 

12、指定接口的双工模式:sw1config-if#duplexfull / half /auto

 

13、指定接口的通信速率:swconfig-if#speed10/100/1000/auto

 

14、查看路由表:r1#showiproute

 

15、配置默认路由:r1config#iproute0.0.0.00.0.0.0 192.168.1.1

 

16、配置console口密码:r1(或sw1config#lineconsole 0

 

config-line#passwordcisco

 

config-line#login

 

17、配置特权模式密码:r1(或sw1config#enablepasswordcisco/明文显示

 

r1(或sw1config#servicepassword-encryption/加密明文密码

 

 

 

18、路由器密码恢复:a、重启路由器,按ctrl+breack brommom>config0x2142c、在重启。Rommom>reset.Drouter#copystartup-configrunning-config

 

E、修改密码。Frouterconfig#config-register 0x2102

 

Routerconfig#exitrouter#copyrunning-configstartup-config

 

19、交换机密码恢复:a、把电源插头。B、按“mode cswitchflash_initdswitchrenameflashconfig.txtflashconfig.oldeswitchbootfswitch#renameflashconfig.oldflashconfig.textgswitch#copyflashconfig.Textsystemrunning-configh、修改密码并保存

 

20、设置VTY密码:sw1config#line vty 0 4

 

Sw1config-line#passwordcisco

 

Sw1config-line#login

 

21、登录交换机:C\>telnet192.168.1.10

 

22、配置默认网关:sw1config#ip default-getway 192.168.2.254

 

23、升级路由IOSrouter#copytftpflash

 

备份IOSrouter#copyflashtftp

 

24在交换机上配置DHCP
配置地址池:Ø
(config)# ip dhcp pool t114
配置网段:Ø
(dhcp-config)# network 192.168.1.0 255.255.255.0
Ø配置默认网关:
(dhcp-config)#default-route 192.168.1.1
Ø配置dns:
(dhcp-config)#dns-server 202.0.0.1
Ø配置租期:
(dhcp-config)#lease 2
配置静态预留地址:Ø
(config)#ip dhcp excluded-address 192.168.1.30

相关内容