歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Cisco路由交換基本配置命令

Cisco路由交換基本配置命令

日期:2017/2/28 14:52:26   编辑:Linux教程

(注:紅色為變量)

1、路由配置ip:r1(config)#interface f0/0
r1(config-if)#ipadd 192.168.1.1255.255.255.0

r1(config-if)#no sh

2、交換機配置IP:sw1(config)#interfacevlan 1

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

3、配置主機名:r1(或者sw1)(config)#host name

4、顯示系統及IOS名稱及版本信息:sw1#shver

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

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

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

8、刪除已保存信息:sw1#erasenvram(真實機)/erasestartup-config(虛擬機)

9、永不超時:sw1(config-line)#exec-timeout00

10、顯示同步:sw1(config-line)# logging synchronous

11、禁止dns查找:sw1(config)#noipdomain-10

12、指定接口的雙工模式:sw1(config-if)#duplex{full / half /auto}

13、指定接口的通信速率:sw(config-if)#speed{10/100/1000/auto}

14、查看路由表:r1#showiproute

15、配置默認路由:r1(config)#iproute0.0.0.00.0.0.0 192.168.1.1

16、配置console口密碼:r1(或sw1)(config)#lineconsole 0

(config-line)#passwordcisco

(config-line)#login

17、配置特權模式密碼:r1(或sw1)(config)#enablepasswordcisco/明文顯示

r1(或sw1)(config)#servicepassword-encryption/加密明文密碼

18、路由器密碼恢復:a、重啟路由器,按ctrl+breack。 b、rommom>config0x2142c、在重啟。Rommom>reset.D、router#copystartup-configrunning-config

E、修改密碼。F、router(config)#config-register 0x2102

Router(config)#exitrouter#copyrunning-configstartup-config

19、交換機密碼恢復:a、把電源插頭。B、按“mode” c、switch:flash_initd、switch:renameflash:config.txtflash:config.olde、switch:bootf、switch#renameflash:config.oldflash:config.textg、switch#copyflash:config.Textsystem:running-configh、修改密碼並保存

20、設置VTY密碼:sw1(config)#line vty 0 4

Sw1(config-line)#passwordcisco

Sw1(config-line)#login

21、登錄交換機:C:\>telnet192.168.1.10

22、配置默認網關:sw1(config)#ip default-getway 192.168.2.254

23、升級路由IOS:router#copytftpflash

備份IOS:router#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

Copyright © Linux教程網 All Rights Reserved