【正文】
: 1) 是否使用此接口: Is this interface in use? [yes]: 2) 是否設(shè)置此接口的IP參數(shù): Configure IP on this interface? [yes]: 3) 設(shè)置接口的IP地址: IP address for this interface: 4) 設(shè)置接口的IP子網(wǎng)掩碼: Number of bITs in subnet field [0]: Class C network is , 0 subnet bITs。首先你可以看到各端口當(dāng)前的狀況: First, would you like to see the current interface summary? [yes]: Any interface listed wITh OK? value NO does not have a valid configuration Interface IPAddress OK? Method Status Protocol Ethernet0 unassigned NO unset up up Serial0 unassigned NO unset up up ……… ……… … …… … … 然后,路由器就開始全局參數(shù)的設(shè)置: Configuring global parameters: 1.設(shè)置路由器名: Enter host name [Router]: 2.設(shè)置進(jìn)入特權(quán)狀態(tài)的密文(secret),此密文在設(shè)置以后不會(huì)以明文方式顯示: The enable secret is a oneway cryptographic secret used instead of the enable password when IT exists. Enter enable secret: cisco 3.設(shè)置進(jìn)入特權(quán)狀態(tài)的密碼(password),此密碼只在沒有密文時(shí)起作用,并且在設(shè)置以后會(huì)以明文方式顯示: 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.設(shè)置虛擬終端訪問時(shí)的密碼: Enter virtual terminal password: cisco 5.詢問是否要設(shè)置路由器支持的各種網(wǎng)絡(luò)協(xié)議: 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.如果配置的是撥號(hào)訪問服務(wù)器,系統(tǒng)還會(huì)設(shè)置異步口的參數(shù): Configure Async lines? [yes]: 1) 設(shè)置線路的最高速度: Async line speed [9600]: 2) 是否使用硬件流控: Configure for HW flow control? [yes]: 3) 是否設(shè)置modem: Configure for modems? [yes/no]: yes 4) 是否使用默認(rèn)的modem命令: Configure for default chat script? [yes]: 5) 是否設(shè)置異步口的PPP參數(shù): Configure for Dialin IP SLIP/PPP Access? [no]: yes 6) 是否使用動(dòng)態(tài)IP地址: Configure for Dynamic IP addresses? [yes]: 7) 是否使用缺省IP地址: Configure Default IP addresses? [no]: yes 8) 是否使用TCP頭壓縮: Configure for TCP Header Compression? [yes]: 9) 是否在異步口上使用路由表更新: Configure for routing updates on async links? [no]: y 10) 是否設(shè)置異步口上的其它協(xié)議。. 這是告訴你在設(shè)置對(duì)話過程中的任何地方都可以鍵入“?”得到系統(tǒng)的幫助,按ctrlc可以退出設(shè)置過程,缺省設(shè)置將顯示在‘[]’中。 for help. Use ctrlc to abort configuration dialog at any prompt. Default settings are in square brackets 39。 進(jìn)入設(shè)置對(duì)話過程后,路由器首先會(huì)顯示一些提示信息: System Configuration Dialog At any point you may enter a question mark 39。 6. 設(shè)置對(duì)話狀態(tài) 這是一臺(tái)新路由器開機(jī)時(shí)自動(dòng)進(jìn)入的狀態(tài),在特權(quán)命令狀態(tài)使用SETUP命令也可進(jìn)入此狀態(tài),這時(shí)可通過對(duì)話方式對(duì)路由器進(jìn)行設(shè)置。… 路由器處于局部設(shè)置狀態(tài),這時(shí)可以設(shè)置路由器某個(gè)局部的參數(shù)。 router(configline)。 3. router(config) 在router提示符下鍵入configure terminal,出現(xiàn)提示符router(config),此時(shí)路由器處于全局設(shè)置狀態(tài),這時(shí)可以設(shè)置路由器的全局參數(shù)。技術(shù)一一、命令狀態(tài) 1. router 路由器處于用戶命令狀態(tài),這時(shí)用戶可以看路由器的連接狀態(tài),訪問其它網(wǎng)絡(luò)和主機(jī),但不能看到和更改路由器的設(shè)置內(nèi)容。 2. router 在router提示符下鍵入enable,路由器進(jìn)入特權(quán)命令狀態(tài)router,這時(shí)不但可以執(zhí)行所有的用戶命令,還可以看到和更改路由器的設(shè)置內(nèi)容。 4. router(configif)。 router(configrouter)。 5. 路由器處于RXBOOT狀態(tài),在開機(jī)后60秒內(nèi)按ctrlbreak可進(jìn)入此狀態(tài),這時(shí)路由器不能完成正常的功能,只能進(jìn)行軟件升級(jí)和手工引導(dǎo)。 二、設(shè)置對(duì)話過程 1. 顯示提示信息 2. 全局參數(shù)的設(shè)置 3. 接口參數(shù)的設(shè)置 4. 顯示結(jié)果 利用設(shè)置對(duì)話過程可以避免手工輸入命令的煩瑣,但它還不能完全代替手工設(shè)置,一些特殊的設(shè)置還必須通過手工輸入的方式完成。?39。[]39。然后路由器會(huì)問是否進(jìn)入設(shè)置對(duì)話: Would you like to enter the inITial configuration dialog? [yes]: 如果按y或回車,路由器就會(huì)進(jìn)入設(shè)置對(duì)話過程。 接下來,系統(tǒng)會(huì)對(duì)每個(gè)接口進(jìn)行參數(shù)的設(shè)置。 mask is /24 在設(shè)置完所有接口的參數(shù)后,系統(tǒng)會(huì)把整個(gè)設(shè)置對(duì)話過程的結(jié)果顯示出來: The following configuration mand script was created: hostname Router enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1 enable password pass ………… 請(qǐng)注意在enable secret后面顯示的是亂碼,而enable password后面顯示的是設(shè)置的內(nèi)容。 三、常用命令 1. 幫助 在IOS操作中,無論任何狀態(tài)和位置,都可以鍵入“?”得到系統(tǒng)的幫助。 3. 使用可變長的子網(wǎng)掩碼 通過使用可變長的子網(wǎng)掩碼可以讓位于不同接口的同一網(wǎng)絡(luò)編號(hào)的網(wǎng)絡(luò)使用不同的掩碼,這樣可以節(jié)省IP地址,充分利用有效的IP地址空間。 4. 使用網(wǎng)絡(luò)地址翻譯(NAT) NAT(Network Address Translation)起到將內(nèi)部私有地址翻譯成外部合法的全局地址的功能,它使得不具有合法IP地址的用戶可以通過NAT訪問到外部Internet. 當(dāng)建立內(nèi)部網(wǎng)的時(shí)候,建議使用以下地址組用于主機(jī),這些地址是由Network Working Group(RFC 1918)保留用于私有網(wǎng)絡(luò)地址分配的. l Class A: to l Class B: to l Class C: to 命令描述如下: 任務(wù) 命令 定義一個(gè)標(biāo)準(zhǔn)訪問列表 accesslist Accesslistnumber permIT source [sourcewildcard] 定義一個(gè)全局地址池 ip nat pool name startip endip {netmask netmask | prefixlength prefixlength} [type rotary] 建立動(dòng)態(tài)地址翻譯 ip nat inside source {list {Accesslistnumber | name} pool name [overload] | static localip globalip} 指定內(nèi)部和外部端口 ip nat {inside | outside} 如下圖所示, 路由器的Ethernet 0端口為inside端口,即此端口連接內(nèi)部網(wǎng)絡(luò),并且此端口所連接的網(wǎng)絡(luò)應(yīng)該被翻譯,Serial 0端口為outside端口,其擁有合法IP地址(由NIC或服務(wù)提供商所分配的合法的IP地址),,經(jīng)由Serial 0口訪問Internet。命令ip nat pool c2501 netmask 。 任務(wù) 命令 建立靜態(tài)路由 ip route prefix mask {address | interface} [distance] [tag tag] [permanent] Prefix :所要到達(dá)的目的網(wǎng)絡(luò) mask :子網(wǎng)掩碼 address :下一個(gè)跳的IP地址,即相鄰路由器的端口地址。 ,。 Router1: ip route Router3: ip route ip route 同時(shí)由于路由器Router3除了與路由器Router2相連外,不再與其他路由器相連,所以也可以為它賦予一條默認(rèn)路由以代替以上的二條靜態(tài)路由, ip route 即只要沒有在路由表里找到去特定目的地址的路徑,。 1. 有關(guān)命令 端口設(shè)置 任務(wù) 命令 設(shè)置HDLC封裝 encapsulation hdlc 設(shè)置DCE端線路速度 clockrate speed 復(fù)位一個(gè)硬件接口 clear interface serial unIT 顯示接口狀態(tài) show interfaces serial [unIT] 1 注:. Routershow interface serial 0 Serial 0 is up, line protocol is up Hardware is MCI Serial Internet address is , subnet mask is MTU 1500 bytes, BW 1544 KbIT, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, looPBack not set, keepalive set (10 sec) Last input 0:00:07, output 0:00:00, output hang never Output queue 0/40, 0 drops。 當(dāng)鏈路為E1時(shí), channelgroup編號(hào)為030, Timeslot范圍131. controllers e1觀察controller狀態(tài),以下為幀類型為crc4時(shí)controllers正常的狀態(tài). Router show controllers e1 e1 0/0 is up. Applique type is Channelized E1 unbalanced Framing is CRC4, Line Code is HDB3 No alarms detected. Data in current interval (725 seconds elapsed): 0 Line Code Violations, 0 Path Code Violations 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs Total Data (last 24 hours) 0 Line Code Violations, 0 Path Code