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

首頁 > 學(xué)院 > 網(wǎng)絡(luò)通信 > 正文

Cisco IOS Cookbook 中文精簡版第二章路由器管理

2019-11-05 00:10:17
字體:
供稿:網(wǎng)友

<!--[if !supportLists]-->第二章    <!--[endif]-->路由器治理

2.1.  創(chuàng)建命令別名

提問 為常用的命令創(chuàng)建簡潔的別名

回答

Router1#configure terminal

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

Router1(config)#alias exec rt show ip route

Router1(config)#alias exec on show ip ospf neighbor

Router1(config)#end

Router1#

注釋 show aliases命令可以輸出當(dāng)前配置的別名

 

2.2.  治理路由器ARP緩存

提問 修改ARP表條目超時時長

回答

Router1#configure terminal

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

Router1(config)#interface Ethernet0

Router1(config-if)#arp timeout 600

Router1(config-if)#end

Router1#

注釋 缺省情況為4個小時,同時思科沒有提供命令能單獨的清除某個ARP緩存,只能通過clear arp 命令來清除整個ARP表

 

2.3.  路由器Buffer調(diào)整

提問 手動調(diào)整路由器Buffer分配來使其工作的更高效

回答 路由器維護(hù)兩個Buffer池,public buffers和interface buffers

調(diào)整public buffers

Router1#configure terminal

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

Router1(config)#buffers big initial 100

Router1(config)#buffers big max-free 200

Router1(config)#buffers big min-free 50

Router1(config)#buffers big permanent 50

Router1(config)#end

Router1#

調(diào)整interface buffers

Router1#configure terminal

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

Router1(config)#buffers Ethernet0 initial 200

Router1(config)#buffers Ethernet0 max-free 300


Router1(config)#buffers Ethernet0 min-free 50

Router1(config)#buffers Ethernet0 permanent 50

Router1(config)#end

Router1#

注釋 一般不建議修改,假如修改,建議首先使用show buffers命令來查看當(dāng)前buffer使用情況,調(diào)整完以后建議使用show memory來查看內(nèi)存使用情況

 

2.4.  自動調(diào)整路由器Buffer

提問 希望路由器根據(jù)自己的情況自動進(jìn)行buffer分配調(diào)整

回答

Router#configure terminal

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

Router(config)#buffers tune automatic

Router(config)#end                    

Router#

注釋 此命令引自IOS 12.3(14)T,使用show buffers tune命令來查看自動調(diào)整情況

 

2.5.  使用CDP協(xié)議

提問 希望獲得相連網(wǎng)絡(luò)設(shè)備的信息

回答

Router1#configure terminal

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

Router1(config)#cdp run

Router1(config)#interface Serial0/0

Router1(config-if)#cdp enable

Router1(config-if)#exit

Router1(config)#interface FastEthernet0/0

Router1(config-if)#no cdp enable

Router1(config-if)#exit

Router1(config)#interface FastEthernet1/0

Router1(config-if)#cdp enable

Router1(config-if)#end

Router1#

注釋 CDP(Cisco Discovery PRotocol)是思科專有的協(xié)議,用于發(fā)現(xiàn)相連的思科設(shè)備,幫助了解網(wǎng)絡(luò)拓樸,缺省是啟用的,使用show cdp neighbor detail 命令可以查看相連設(shè)備的具體信息

 

2.6.  禁止CDP協(xié)議

提問 為了安全期間不想讓鄰近設(shè)備發(fā)現(xiàn)自己設(shè)備的信息

回答

Router1#configure terminal

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

Router1(config)#cdp run

Router1(config)#interface FastEthernet0/0

Router1(config-if)#no cdp enable


Router1(config-if)#end

Router1#

 

注釋 為了安全期間可以在邊界設(shè)備上禁止CDP

2.7.  小服務(wù)的開啟

提問 開啟或者禁用一些類似finger的小服務(wù)

回答

Router1#configure terminal

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

Router1(config)#service tcp-small-servers   (no service tcp-small-servers

Router1(config)#service udp-small-servers    (no sercie udp-small-servers)

Router1(config)#end

Router1#

Router1#configure terminal

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

Router1(config)#ip finger  (no ip finger)

Router1#

注釋 tcp和udp的小服務(wù)指開啟路由器的echo,discard,daytime和chargen服務(wù),為了安全期間都建議將其關(guān)閉

 

2.8.  啟用路由器HTTP訪問

提問 通過瀏覽器來配置和治理路由器

回答

Router1#configure terminal

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

Router1(config)#access-list 75 permit 172.25.1.1

Router1(config)#access-list 75 deny any

Router1(config)#ip http server

Router1(config)#ip http access-class 75

Router1(config)#end

Router1#

 

注釋 由于IOS 12.1(5)之前存在HTTP訪問的高危漏洞,所以假如你的IOS版本小于此版本建議不要開啟此服務(wù)

 

2.9.  啟用路由器安全HTTPS訪問

提問 通過加密的訪問HTTP訪問路由器

回答

Core#configure terminal

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

Core(config)#ip http secure-server

Core(config)#end

Core#

 

注釋 IOS 12.2(14)S之后引入此特性,建議先用no ip http server命令關(guān)閉非加密的HTTP訪問,然后開啟安全的訪問,同時可以使用ip http secure-port  8080


命令來更改訪問端口

2.10.  使用靜態(tài)主機(jī)名映射

提問 在路由器上配置靜態(tài)的主機(jī)映射表,從而使用主機(jī)名而不是IP地址來訪問設(shè)備

回答

Router1#configure terminal

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

Router1(config)#ip host freebsd 172.25.1.1

Router1(config)#ip host router2 10.1.1.1 172.22.1.4

Router1(config)#end

Router1#

注釋 可以對一個主機(jī)名映射很多IP地址來提供冗余訪問,show hosts命令來驗證

 

2.11.  啟用DNS服務(wù)

提問 路由器使用DNS服務(wù)器來解析主機(jī)名

回答

Router1#configure terminal

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

Router1(config)#ip domain-lookup

Router1(config)#ip domain-name oreilly.com

Router1(config)#ip name-server 172.25.1.1

Router1(config)#ip name-server 10.1.20.5 

Router1(config)#end

Router1#

 

注釋 從IOS 12.2開始,思科使用了ip domain lookup.來代替ip domain-lookup 類似的ip domain-nameip domain name代替

 

2.12.  禁用域名解析

提問 禁用域名解析,防止路由器自動對打錯的命令的進(jìn)行DNS查詢

回答

Router1#configure terminal

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

Router1(config)#no ip domain-lookup

Router1(config)#end

Router1#

假如需要啟用DNS查詢主機(jī)名,但是又為了避免打錯命令查詢的情況可以使用如下的變通方法

Router1#configure terminal

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

Router1(config)#line vty 0 4

Router1(config-line)#transport preferred none

Router1(config-line)#end

Router1#

注釋 對后一個命令的稍微解釋一下,正常情況下都知道可以直接使用主機(jī)名回車路由器會認(rèn)為時telnet 到此設(shè)備,可以省略掉telnet的命令,原因是因為transport preferred缺省是telnet,假如配置為none就必須使用telnet命令來進(jìn)行設(shè)備登錄,命令打錯也不會出現(xiàn)地址解析的問題了。


2.13.  配置路由器特定時間重啟

提問 需要路由器在特定時間自動重啟

回答

Router1#reload in 20

Reload scheduled for 11:33:53 EST Sat Feb 1 2003 (in 20 minutes)

Proceed with reload? [confirm] <enter>

Router1#

Router1#reload at 14:00 Feb 2

Reload scheduled for 14:00:00 EST Sun Feb 2 2003 (in 26 hours and 44 minutes)

Proceed with reload? [confirm] <enter>

Router1#

注釋 很有用的命令,當(dāng)你在對路由器配置進(jìn)行修改前可以先行輸入此命令,然后進(jìn)行修改但是不保存配置,這樣可以防止把自己鎖在路由器之外。可以使用reload cancel命令來取消定時重啟

2.14.  定時執(zhí)行配置命令

提問 周期性的定時執(zhí)行某個命令

回答

Router#configure terminal  

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

Router(config)#kron policy-list  NEOSHI

Router(config-kron-policy)#cli  write memory

Router(config-kron-policy)#exit

Router(config)#kron occurrence  DAILYat5  at  17:00  recurring

Router(config-kron-occurrence)#policy-list  NEOSHI

Router(config-kron-occurrence)#end

Router#

 

注釋 從IOS12.3(1)開始引入了這個類似Unix Cron的特性,不過也有一些缺點,只能運行EXEC模式下的命令,不能運行配置模式下的命令,同時輸入的命令不能是交互性的,比如不能輸入copy running-config startup-config來保存配置,因為是需要確認(rèn)的,必須使用write memory來代替

2.15.  顯示路由器CPU利用率的歷史數(shù)據(jù)

提問 顯示歷史的路由器CPU利用率

回答

Router# show processes cpu history

Router   03:48:18 PM Monday Apr 17 2006 EDT

                                                             


                                         555559999999999999999

    5                                    444449999999999999999

100                                           ******************

 90                                           ******************

 80                                           ******************

 70                                           ******************

 60                                           ******************

 50                                      ***********************

 40                                      ***********************

 30                                      ***********************


 20                                      ***********************

 10 *                                    ***********************

   0....5....1....1....2....2....3....3....4....4....5....5....

             0    5    0    5    0    5    0    5    0    5   

               CPU% per second (last 60 seconds)

                                                             

    99   1                                                9999

    99   1                                     4          9999

100 **                                                    ***#*#

 90 **                                                    **##*#

 80 #*                                                    *###*#


 70 #*                                                    *###*#

 60 #*                                                    *###*#

 50 #*                                                    *#####

 40 #*                                                    *#####

 30 #*                                                    ######

 20 ##                                                    ######

 10 ##   *                                                ######

   0....5....1....1....2....2....3....3....4....4....5....5....

             0    5    0    5    0    5    0    5    0    5   

               CPU% per minute (last 60 minutes)


              * = maximum CPU%   # = average CPU%

  ……………………………….(由于顯示問題省去此圖).

                   CPU% per hour (last 72 hours)

                  * = maximum CPU%   # = average CPU%

 

注釋 從IOS12.2(2)T以后思科為show process cpu命令增加了history的選項,這樣可以看到最長3天的CPU利用率,而以前最多可以看到5分鐘的。輸出圖很不輕易看懂,簡單的說最左邊是最新的數(shù)據(jù),然后歷史數(shù)據(jù)會向右移,在每分鐘和每小時的會有峰值和平均值,峰值為現(xiàn)在每列的上端,不過是豎著排列的。

2.16.  生成意外導(dǎo)出文件(Exception Dump Files)

提問 在路由器發(fā)生意外當(dāng)機(jī)的情況下生成導(dǎo)出文件發(fā)給TAC進(jìn)行處理

回答

Router1#configure terminal

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

Router1(config)#ip FTP source-interface Loopback0

Router1(config)#ip ftp username ijbrown

Router1(config)#ip ftp passWord ijpassword

Router1(config)#exception protocol ftp

Router1(config)#exception region-size 65536

Router1(config)#exception dump 172.25.1.3

Router1(config)#end

Router1#

 

注釋 缺省情況下路由器會使用tftp命令進(jìn)行傳送,不過TFTP有16M的限制所以建議換為FTP協(xié)議。另外為了防止當(dāng)機(jī)導(dǎo)致文件不能生成,所以使用了exception region-size 65536 來提前保留部分內(nèi)存給該命令使用。可以先使用write core命令來提前實驗下生成此文件

2.17.  生成接口信息報告

2.18.  生成路由表報告

2.19.  生成ARP表報告

2.20.  生成主機(jī)表報告

以上都是使用perl腳本來進(jìn)行命令輸出的匯總操作,腳本略去



發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宝坻区| 象州县| 图木舒克市| 海兴县| 大关县| 屏边| 武胜县| 任丘市| 浮梁县| 张家界市| 通道| 嵊泗县| 垦利县| 吉木萨尔县| 泽州县| 达尔| 清新县| 祁阳县| 长葛市| 本溪市| 盐山县| 古丈县| 太和县| 贡嘎县| 云和县| 葵青区| 正定县| 凯里市| 永顺县| 建平县| 常熟市| 富阳市| 睢宁县| 广南县| 石城县| 华坪县| 赫章县| 灵寿县| 聂拉木县| 巴林左旗| 阳信县|