国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 網絡通信 > 正文

Cisco IOS Cookbook 中文精簡版第一章路由器配置和文件管理

2019-11-05 00:10:21
字體:
來源:轉載
供稿:網友

<!--[if !supportLists]-->第一章    <!--[endif]-->路由器配置和文件治理

1.1.  通過TFTP來配置路由器

提問 使用TFTP來加載路由器的配置文件

回答

Router1#copy tftp://172.25.1.1/NEWCONFIG running-config

Destination filename [running-config]? <enter>

accessing tftp://172.25.1.1/NEWCONFIG...

Loading NEWCONFIG from 172.25.1.1 (via FastEthernet0/0.1): !

[OK - 24 bytes]

24 bytes copied in 0.192 secs (125 bytes/sec)

Router1#

注釋 IOS12.0版本以前使用的configure network命令,另外拷貝至路由器的配置文件應該以End結尾,否則會出現下面的錯誤提示信息:%PARSER-4-BADCFG: UneXPected end of configuration file.

1.2.  保存路由器配置到服務器

提問 保存路由器當前配置文件到TFTP服務器作為備份

回答

Freebsd% toUCh /tftpboot/router1-confg

Freebsd% chmod 666 /tftpboot/router1-confg

Freebsd% telnet Router1

Trying 172.25.1.5...

Connected to Router1.

Escape character is '^]'.

User Access Verification

PassWord: <vtypassword>

Router1>enable

Password: <enablepassword>

Router1#copy running-config tftp://172.25.1.1/router1-confg

Address or name of remote host [172.25.1.1]? <enter>

Destination filename [router1-confg]? <enter>

!!!

9640 bytes copied in 3.956 secs (2437 bytes/sec)

Router1#

注釋 確保TFTP服務器上的目錄和文件可寫


1.3.  使用遠端配置文件啟動路由器

提問 使用另外的配置文件來啟動路由器

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#service config

Router1(config)#boot network tftp Network-auto 172.25.1.1

Router1(config)#boot host tftp Router8-auto 172.25.1.1

Router1(config)#end

Router1#

注釋 service config缺省是關閉的,假如打開缺省會去查找的文件名為network-config, cisconet.cfg, router1-confg, router1.cfg等

1.4.  保存大于NVRAM大小的配置文件

提問 配置文件過大,超過了可用的NVRAM大小

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#service comPRess-config

Router1(config)#end

Router1#

注釋 可以使用show startup-config來驗證

Router1#show startup-config

Using 5068 out of 29688 bytes, uncompressed size = 9969 bytes

Uncompressed configuration from 5068 bytes to 9969 bytes

1.5.  清除啟動配置文件

提問 清除配置文件恢復到出廠設置

回答

Router1#erase nvram:  (erase startup-config

Erasing the nvram filesystem will remove all files! Continue? [confirm] <enter>

[OK]

Erase of nvram: complete

Router1#reload

System configuration has been modified. Save? [yes/no]: no

Proceed with reload? [confirm] <enter>

 

注釋 無

1.6.  加載新的IOS鏡像

提問 升級當前的IOS

回答

Router1#copy tftp://172.25.1.1/c2600-ik9o3s-mz.122-12a.bin Flash:

Destination filename [c2600-ik9o3s-mz.122-12a.bin]? <enter>

Accessing tftp://172.25.1.1/c2600-ik9o3s-mz.122-12a.bin...

Erase flash: before copying? [confirm] <enter>

Erasing the flash filesystem will remove all files! Continue? [confirm] <enter>


Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased

Erase of flash: complete

Loading c2600-ik9o3s-mz.122-12a.bin from 172.25.1.1 (via FastEthernet0/0.1):!!!!!!!!!!!!!!

[OK - 11135588 bytes]

Verifying checksum...  OK (0xE643)

11135588 bytes copied in 82.236 secs (135410 bytes/sec)

Router1# reload

Proceed with reload? [confirm] <enter>

注釋 無

1.7.  以另一個IOS鏡像文件啟動

提問 使用其它的IOS鏡像啟動

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#boot system flash:c3620-jk9o3s-mz.122-7a.bin

Router1(config)#boot system flash:c3620-jos56i-l.120-11.bin

Router1(config)#boot system slot0:c3620-ik9s-mz.122-13.bin

Router1(config)#boot system rom

Router1(config)#end

注釋 boot system命令的順序非常重要,假如使用新的IOS,建議先進行no boot system的操作。從IOS 12.3(4)T 后思科引入了boot markers的概念,所有的boot systme命令都會放在boot markers之間,比如:

Router1#show running-config include ^boot

boot-start-marker

boot system slot0:c3745-ipbasek9-mz.124-6.T.bin

boot system slot0:c3745-ipbasek9-mz.124-7.bin

boot system flash:

boot-end-marker

Router1#

 

1.8.  通過網絡啟動

提問 IOS太大本地Flash無法保存,使用保存在網絡上的IOS啟動

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#boot system tftp c2500-io-l.122-7a.bin 172.25.1.1

Router1(config)#boot system flash

Router1(config)#end

Router1#

注釋 無

1.9.  拷貝IOS鏡像文件到服務器

提問 保存一份IOS到TFTP服務器作為備份

回答

Freebsd% touch /tftpboot/c2600-ik9o3s-mz.122-12a.bin


Freebsd% chmod 666 /tftpboot/c2600-ik9o3s-mz.122-12a.bin

Freebsd% telnet Router1

Trying 172.25.1.5...

Connected to Router1.

Escape character is '^]'.

User Access Verification

Password: <vtypassword>

Router1>enable

Password: <enablepassword>

Router1#copy flash:c2600-ik9o3s-mz.122-12a.bin  tftp

Address or name of remote host []? 172.25.1.1

Destination filename [c2600-ik9o3s-mz.122-12a.bin]? <enter>

!!!!!!

11135588 bytes copied in 52.588 secs (211752 bytes/sec)

Router1#

注釋

1.10.  通過控制臺口拷貝IOS鏡像文件

提問 通過控制臺口和AUX端口來加載IOS

回答

Router1#copy xmodem: slot1:

                        **** WARNING ****

x/ymodem is a slow transfer protocol limited to the current speed

settings of the auxiliary/console ports. The use of the auxilary

port for this download is strongly recommended.

During the course of the download no exec input/output will be

available.

                        ---- ******* ----

Proceed? [confirm] <enter>

Destination filename []? c3620-ik9s-mz.122-12a.bin

Erase slot1: before copying? [confirm] <enter>

Use crc block checksumming? [confirm] <enter>

Max Retry Count [10]: <enter>

Perform image validation checks? [confirm] <enter>

Xmodem download using crc checksumming with image validation

Continue? [confirm]  <enter>

Ready to receive file...........CC  <start xmodem file transfer here>

4294967295 bytes copied in 1450.848 secs (1271445669961 bytes/sec)


Router1#

注釋 思科建議使用AUX口進行此步驟,因為AUX口支持硬件流控。為了提高拷貝速度,建議提前使用下述命令來設置端口速度

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#line aux 0

Router1(config-line)#speed 115200

Router1(config-line)#end

Router1#

1.11.  刪除Flash中的文件

提問 刪除Flash中的文件

回答

Router1#erase slot1:

Erasing the slot1 filesystem will remove all files! Continue? [confirm] <enter>

Erasing device... eeeeeeeeeeee ...erased

Erase of slot1: complete

Router1#

或者刪除單個文件

Router1#delete slot1:c3620-ik9s-mz.122-13.bin

Delete filename [c3620-ik9s-mz.122-13.bin]? <enter>

Delete slot1:c3620-ik9s-mz.122-13.bin? [confirm] <enter>

Router1#

注釋 并不是所有的路由器都支持erase命令,不行的話可以嘗試format命令,有些路由器在使用delete命令以后還可以使用undelete來恢復,同時也需要使用squeeze來徹底刪除文件

1.12.  對Flash進行分區

提問 對Flash進行分區

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#partition slot1: 2 8 8

Router1(config)#end

Router1#

注釋 假如erase不支持也可以試試partition命令

1.13.  配置路由器為TFTP服務器

提問 配置路由器為TFTP服務器

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#tftp-server flash:c2600-ik9o3s-mz.122-12a.bin

Router1(config)#end

Router1#

注釋 使用此命令并不能把路由器配置為全功能的TFTP服務器,此服務器只能用于文件下載,而不能進行上傳

1.14.  在路由器上使用FTP

提問 在路由器上使用FTP來進行文件的下載

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#ip ftp username neoshi


Router1(config)#ip ftp password ioscookbook

Router1(config)#end

Router1#copy ftp: running-config

Address or name of remote host [172.25.1.1]? 172.25.1.1

Source filename []? test

Destination filename [running-config]? <enter>

Accessing ftp://172.25.1.1/test...

Loading /test

[OK - 24/4096 bytes]

 

24 bytes copied in 0.276 secs (87 bytes/sec)

Router1#

當然也可以使用下面的簡化命令

copy ftp://neoshi:ioscookbook@172.25.1.1/c3620-ik9s-mz.122-10a.bin slot1:

注釋 假如沒有指定用戶名和密碼,路由器缺省會使用匿名登錄

1.15.  批量產生路由器配置文件

1.16.  同時改變多臺路由器的配置

1.17.  獲得設備的硬件信息

1.18.  備份路由器的配置

以上都是使用perl腳本來進行批量化操作,建議使用我推薦的圖形話綠色免費工具軟件

1.19.  熱重啟

提問 重啟路由器而對業務影響減少到最低

回答

Router1#configure  terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#warm-reboot

Router1(config)#end

Router1#

注釋 要使用熱啟動必須先冷啟動一次…無語了吧哈哈。此特性開始于12.3(2)T,根據實驗冷啟動要比熱啟動慢4分鐘。可以使用reload warm命令進行人工的熱重啟

1.20.  熱升級

提問 升級路由器IOS而對業務影響最小

回答

Router1#configure  terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#warm-reboot

Router1(config)#end

Router1#reload warm file slot0:c3745-ipbasek9-mz.124-7.bin

注釋 12.3(11)T開始支持此特性

1.21.  配置存檔特性

提問 自動對路由器配置進行存檔

回答

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#archive

Router1(config-archive)#path slot0:/configs/$h


Router1(config-archive)#write-memory

Router1(config-archive)#time-period 1440

Router1(config-archive)#end

Router1#

注釋 從12.3(4)T開始思科引入配置存檔特性,每次使用wr對配置進行保存的時候都會在路由器上生成一個存檔配置文件,當然也可以像示例那樣每1440分鐘保存一次,使用show archive命令來顯示當前的配置存檔,缺省保存14個文件,并且提供了配置比較命令 show archive config differences slot0:/configs/Router1-1 更提供了配置回滾的命令configure replace slot0:/configs/Router1-1 方便的回滾到以前的配置。對于保存的配置文件名可以$h來代表設備主機名$t來代表時間

1.22.  路由器配置鎖定

提問 防止同時多個用戶對路由器配置文件進行修改

回答

自動進行配置鎖定

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#configuration mode exclusive auto

Router1(config)#end

Router1#

按需進行配置鎖定

Router1#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router1(config)#configuration mode exclusive manual

Router1(config)#end                                

Router1#

注釋 12.3(14)T引入了此特性防止多個用戶同時對路由器配置進行修改,在配置為auto的模式下,假如有用戶進入了配置模式就自動對配置進行鎖定,在manual模式下可以使用configure terminal lock進行配置鎖定,可以使用show configuration lock來查看當前的配置鎖定信息,假如你確實需要進行配置,就把看到鎖定的人踢掉吧。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盐源县| 陈巴尔虎旗| 辛集市| 永清县| 綦江县| 子洲县| 张北县| 吴桥县| 旬阳县| 长乐市| 迭部县| 恩平市| 黄浦区| 中西区| 蚌埠市| 长宁县| 镇赉县| 潮安县| 麦盖提县| 舒城县| 当阳市| 新巴尔虎右旗| 五台县| 开原市| 漾濞| 佛坪县| 宁夏| 当涂县| 启东市| 鄄城县| 永嘉县| 舒城县| 报价| 开阳县| 通化县| 宁明县| 洛南县| 海丰县| 正镶白旗| 淳化县| 革吉县|