當前位置:學問君>人在職場>IT認證>

思科路由器設定方法和常見配置命令

學問君 人氣:1.25W

思科路由器怎麼設定,是我們經常遇到的問題,下面小編準備了關於思科路由器設定方法和常見配置命令,歡迎大家參考學習!

思科路由器設定方法和常見配置命令

一、基本設定方式

一般來說,可以用5種方式來設定Cisco思科路由器:

ole口接終端或執行終端仿真軟件的微機;

口接MODEM,透過電話線與遠方的終端或執行終端仿真軟件的微機相連;

3.透過Ethernet上的TFTP服務器;

4.透過Ethernet上的TELNET程序;

5.透過Ethernet上的SNMP網管工作站。

但Cisco思科路由器的第一次設定必須透過第一種方式進行,一般用超級終端透過com口進行控制。此時終端的硬件設定如下:

波特率 :9600

數據位 :8

停止位 :1

奇偶校驗: 無

二、命令操作

Cisco思科路由器所用的操作系統是IOS.共有以下幾種狀態:

1、router>

在router>提示符下,Cisco思科路由器處於用戶命令狀態,這時用戶可以看Cisco思科路由器的連接狀態,訪問其它網絡和主機,但不能看到和更改Cisco思科路由器的設定內容。此時輸入?並回車,可以檢視到在此狀態下可以用的命令。(IOS允許你在任何時候用這種方式檢視在某種狀態下可以用的命令)。在敲入enable並回車後,按照系統提示輸入密碼,(在新的Cisco思科路由器第一次進行調試的時候不需要輸入密碼,直接回車即可)進入#提示符,就可以對Cisco思科路由器進行各種操作了。

2、router#

Cisco思科路由器進入特權命令狀態router#後,不但可以執行所有的用戶命令,還可以看到和更改Cisco思科路由器的設定內容。此時就可以對Cisco思科路由器的名字、密碼等進行設定。

3、router(config)#

在router#提示符下鍵入configure terminal,出現提示符router(config)#,此時Cisco思科路由器處於全局設定狀態,這時可以設定Cisco思科路由器的全局參數。

4、router(config-if)#;

router(config-line)#;

router(config-router)#;…

Cisco思科路由器處於局部設定狀態,這時可以設定Cisco思科路由器某個局部的參數。

5、Cisco思科路由器處於RXBOOT狀態,在開機後60秒內按ctrl-break可進入此狀態,這時Cisco思科路由器不能完成正常的功能,只能進行軟件升級和手工引導。在此狀態下,可以進行口令恢復。

三、常用命令

1.幫助

在IOS操作中,無論任何狀態和位置,都可以鍵入“?”得到系統的幫助。系統會顯示此時可以使用的命令。

2.改變命令狀態

任務命令

進入特權命令狀態enable

退出特權命令狀態disable

進入設定對話狀態Setup

進入全局設定狀態config terminal

退出全局設定狀態End

進入端口設定狀態interface type slot/number

進入子端口設定狀態interface type nterface [point-to-point | multipoint]

進入線路設定狀態line type slot/number

進入路由設定狀態router protocol

退出局部設定狀態Exit

3.顯示命令

任務命令

檢視版本及引導資訊show version

檢視執行設定show running-config

檢視開機設定show startup-config

顯示端口資訊show interface type slot/number

顯示路由資訊show ip router

4.拷貝命令

用於IOS及CONFIG的備份和升級

5.網絡命令

任務命令

登入遠程主機telnet hostname|IP address

網絡偵測ping hostname|IP address

路由跟蹤Trace hostname|IP address

6.基本設定命令

任務命令

全局設定config terminal

設定訪問用戶及密碼username username password password

設定特權密碼enable secret password

設定Cisco思科路由器名hostname name

設定靜態路由ip route destination subnet-mask next-hop

啓動IP路由ip routing

啓動IPX路由Ipx routing

端口設定interface type slot/number

設定IP位址ip address address subnet-mask

設定IPX網絡Ipx network network

激活端口no shutdown

物理線路設定line type number

啓動登入進程login [local|tacacs server]

設定登入密碼password password

本文描述瞭如何進行思科路由器的基本設定,基本的命令操作以及常用命令進行操作和總體的.設定,並講述了一些基本的服務設定。

四、總體設定

在router#特權命令狀態下,可以用setup對Cisco思科路由器進行總體設計,利用這個設計過程可以省略手工設定的煩瑣。但它還不能完全代替手工設定,一些特殊的設定還必須透過手工輸入的方式完成。

進入設定對話過程後,Cisco思科路由器首先會顯示一些提示資訊:

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.

Use ctrl-c to abort configuration dialog at any prompt.

Default settings are in square brackets '[]'.

這是告訴你在設定對話過程中的任何地方都可以鍵入“?”得到系統的幫助,按ctrl-c可以退出設定過程,缺省設定將顯示在‘[]’中。然後Cisco思科路由器會問是否進入設定對話:

Would you like to enter the initial configuration dialog? [yes]:

如果按y或回車,Cisco思科路由器就會進入設定對話過程。首先你可以看到各端口當前的狀況:

First, would you like to see the current interface summary? [yes]:

Any interface listed with OK? value "NO" does not have a valid configuration

InterfaceIP-AddressOK?MethodStatusProtocol

Ethernet0unassignedNOunsetupup

Serial0unassignedNOunsetupup

……………………………

然後,Cisco思科路由器就開始全局參數的設定:

Configuring global parameters:

1.設定Cisco思科路由器名:

Enter host name [Router]:

2.設定進入特權狀態的密文(secret),此密文在設定以後不會以明文方式顯示:

The enable secret is a one-way cryptographic secret used

instead of the enable password when it exists.

Enter enable secret: cisco

3.設定進入特權狀態的密碼(password),此密碼只在沒有密文時起作用,並且在設定以後會以明文方式顯示:

The enable password is used when there is no enable secret

and when using older software and some boot images.

Enter enable password: pass

4.設定虛擬終端訪問時的密碼:

Enter virtual terminal password: cisco

5.詢問是否要設定Cisco思科路由器支援的各種網絡協議:

Configure SNMP Network Management? [yes]:

Configure DECnet? [no]:

Configure AppleTalk? [no]:

Configure IPX? [no]:

Configure IP? [yes]:

Configure IGRP routing? [yes]:

Configure RIP routing? [no]:

………

6.如果配置的是撥號訪問服務器,系統還會設定異步口的參數:

Configure Async lines? [yes]:]

1)設定線路的最高速度:

Async line speed [9600]:

2)是否使用硬件流控:

Configure for HW flow control? [yes]:

3)是否設定modem:

Configure for modems? [yes/no]: yes

4)是否使用默認的modem命令:

Configure for default chat script? [yes]:

5)是否設定異步口的PPP參數:

Configure for Dial-in IP SLIP/PPP access? [no]: yes

6)是否使用動態IP位址:

Configure for Dynamic IP addresses? [yes]:

7)是否使用缺省IP位址:

Configure Default IP addresses? [no]: yes

是否使用TCP頭壓縮:

Configure for TCP Header Compression? [yes]:

9)是否在異步口上使用路由表更新:

Configure for routing updates on async links? [no]: y

10)是否設定異步口上的其它協議。接下來,系統會對每個接口進行參數的設定。

iguring interface Ethernet0:

1)是否使用此接口:

Is this interface in use? [yes]:

2)是否設定此接口的IP參數:

Configure IP on this interface? [yes]:

3)設定接口的IP位址:

IP address for this interface:

4)設定接口的IP子網掩碼:

Number of bits in subnet field [0]:

Class C network is , 0 subnet bits; mask is /24

在設定完所有接口的參數後,系統會把整個設定對話過程的結果顯示出來:

The following configuration command script was created:

hostname Router

enable secret 5 $W5Oh$p6J7tIgRMBOIKVXVG53Uh1

enable password pass

…………

請注意在enable secret後面顯示的是亂碼,而enable password後面顯示的是設定的內容。就是說,secret密碼的優先級比較高,在兩個密碼都設了的情況下,secret密碼起作用。

顯示結束後,系統會問是否使用這個設定:

Use this configuration? [yes/no]: yes

如果回答yes,系統就會把設定的結果存入Cisco思科路由器的NVRAM中,然後結束設定對話過程,使Cisco思科路由器開始正常的工作。

五、廣域網協議設定

PPP

PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的繼承者,它提供了跨過同步和異步電路實現Cisco思科路由器到Cisco思科路由器(router-to-router)和主機到網絡(host-to-network)的連接。

CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol) (PAP)通常被用於在PPP封裝的串行線路上提供安全性認證。使用CHAP和PAP認證,每個Cisco思科路由器透過名字來識別,可以防止未經授權的訪問。

任務命令

設定PPP封裝encapsulation ppp1

設定認證方法ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]

指定口令username name password secret

設定DCE端線路速度clockrate speed