技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁 > 教程 > 硬件教程 >

路由器需要什么配置

來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2018-08-22 06:25┆點(diǎn)擊:

  路由器是計(jì)算機(jī)網(wǎng)絡(luò)的橋梁,是連接IP網(wǎng)的核心設(shè)備。它不僅可以連通不同的網(wǎng)絡(luò),還能選擇數(shù)據(jù)傳送的路徑,并能阻隔非法訪問。路由器是工作在OSI參考模型第三層——網(wǎng)絡(luò)層的數(shù)據(jù)包轉(zhuǎn)發(fā)設(shè)備,路由器通過轉(zhuǎn)發(fā)數(shù)據(jù)包來實(shí)現(xiàn)網(wǎng)絡(luò)互連。對(duì)初學(xué)者來說,路由器的配置并不易。本文以我院選購使用的硬件Cisco 2800路由器為例,探討利用Console端口進(jìn)行配置方法。

  1 路由器的基本功能

  1.1 路由器的概念

  所謂“路由[1]”,是指把數(shù)據(jù)從一個(gè)地方傳送到另一個(gè)地方的行為和動(dòng)作,是一種連接多個(gè)網(wǎng)絡(luò)或網(wǎng)段的網(wǎng)絡(luò)設(shè)備,路由器是在網(wǎng)絡(luò)層實(shí)現(xiàn)網(wǎng)絡(luò)互聯(lián)的設(shè)備,路由器依靠轉(zhuǎn)發(fā)網(wǎng)絡(luò)層數(shù)據(jù)包來實(shí)現(xiàn)網(wǎng)絡(luò)互聯(lián)。

  1.2 路由器的基本功能

  簡單的講,路由器主要有以下幾種功能[1]:第一,網(wǎng)絡(luò)互連,路由器支持各種局域網(wǎng)和廣域網(wǎng)接口,主要用于互連局域網(wǎng)和廣域網(wǎng),實(shí)現(xiàn)不同網(wǎng)絡(luò)互相通信;第二,數(shù)據(jù)處理,提供包括分組過濾、分組轉(zhuǎn)發(fā)、優(yōu)先級(jí)、復(fù)用、加密、壓縮和防火墻等功能;第三,網(wǎng)絡(luò)管理,路由器提供包括配置管理、性能管理、容錯(cuò)管理和流量控制等功能。

  2 路由器的配置方式

  路由器可以支持多種方式進(jìn)行配置[2],本文重點(diǎn)介紹是利用Console端口進(jìn)行配置以及其口令、接口IP等相關(guān)配置方法,用戶可以選擇適合自身網(wǎng)絡(luò)連接方式對(duì)路由器進(jìn)行配置:① 利用終端通過Console端口進(jìn)行本地配置;② 利用異步連接Modem 進(jìn)行遠(yuǎn)程配置;③ 通過Telnet方式進(jìn)行本地或者遠(yuǎn)程配置;④ 通過TFTP方式進(jìn)行網(wǎng)絡(luò)配置;⑤通過Web頁面進(jìn)行配置。

  3 搭建本地配置環(huán)境

  以下利用Console端口搭建本地配置環(huán)境的介紹,在使用路由器之前,必須對(duì)路由器進(jìn)行相關(guān)的配置,于是本文采用通過Console端口方式對(duì)路由器進(jìn)行配置。

  3.1 路由器配置接口

  路由器的配置端口有兩個(gè),分別是Console”和“AUX”,“Console”通常是用來進(jìn)行路由器的基本配置時(shí)通過專用連線與計(jì)算機(jī)連用的,而“AUX”是用于路由器的遠(yuǎn)程配置連接用的。準(zhǔn)備一條微機(jī)的串口線通過標(biāo)準(zhǔn)的RS232電纜和路由器的Console端口連接。如圖1所示。

路由器需要什么配置 三聯(lián)

  3.2 配置終端參數(shù)

  電纜連接完成之后,進(jìn)入終端參數(shù)配置。首先,在微機(jī)上運(yùn)行終端仿真程序,以Windows系統(tǒng)自帶“超級(jí)終端”建立新連接,選擇實(shí)際連接時(shí)使用的微機(jī)rs232串口,便可設(shè)置終端參數(shù)進(jìn)行路由相關(guān)配置。

  基本的配置步驟:用鼠標(biāo)點(diǎn)擊開始 --> 所有程序 --> 附件 --> 通訊 --> 超級(jí)終端”,選擇用于連接的串口設(shè)備,系統(tǒng)彈出如圖2、圖3、圖4所示的連接說明界面。

點(diǎn)擊查看原圖

點(diǎn)擊查看原圖

  設(shè)置終端通信參數(shù)為:9600波特、8位數(shù)據(jù)位、1位停止位、無校驗(yàn)、無流控,選擇終端仿真類型vt100,如圖5所示。最后單擊【確定】按鈕就完成了超級(jí)終端的設(shè)置。

  3.3 啟動(dòng)路由器

  接上電源,路由器啟動(dòng)后即將在終端屏幕上看到自檢信息,自檢結(jié)束后提示用戶鍵入回車,直到出現(xiàn)命令行提示符“Router﹥*****”。

  第一次啟動(dòng)Cisco路由器,進(jìn)入信息讀取模式:

  -------------------------------------

  Cisco Router and Security Device Manager (SDM) is installed on this device. This

  feature requires the one time use, initial credentials, of username "cisco"

  with password "cisco".

  Please change these publicly known initial credentials through SDM or IOS CLI.

  Here's the Cisco IOS command:

  no username cisco

  NOTE: Please add a new username to be able to launch SDM for router management.

  For more information about SDM please follow the instructions in the QUICK

  START GUIDE for your router or at

  

  --------------------------------------

  4 配置Cisco 2800路由器[3]

  4.1 基本命令模式

  這時(shí)便可以在終端上查看路由器的運(yùn)行狀態(tài),鍵入“?”可在線幫助,如Router>? ;

  進(jìn)行路由器的當(dāng)前配置:

  Router> enable

  Password:*******

  Router# conf terminal //切換到配置狀態(tài)

  Router(conf)# enable secret my-root-password //定義超級(jí)口令

  Router(conf)# ip host router-sgyy //定義路由器名

  Router(conf)# ip domain-name yourdomain.com //定義所屬域名稱

  Router(conf)# http server

  Router# show run //顯示路由器的當(dāng)前配置

  Router# show ip route//查路由表

  Router# show ip interface bri //查看連接狀態(tài)

  4.2 口令配置

  用戶可以通過口令控制對(duì)路由器的訪問,以下是設(shè)置訪問口令:

  Router> enable

  Router# configure terminal

  Router(config)# line console 0

  Router(config-line)# login

  Router(config-line)# password ******

  Router(config-line)# end

  Router# exit

  密碼設(shè)置完成后,重新啟動(dòng)路由器時(shí),路由器登錄需密碼驗(yàn)證訪問:

  ^C

  !

  line con 0

  password *******

  login

  line aux 0

  line vty 0 4

  privilege level 15

  password *******

  login

  transport input telnet

  line vty 5 15

  privilege level 15

  password *******

  login

  transport input telnet

  scheduler allocate 20000 1000

  end

  4.3 接口配置

  根據(jù)我院需求網(wǎng)絡(luò)系統(tǒng)要求,配置以太網(wǎng)絡(luò)接口[3]的IP地址。

  查看以太網(wǎng)接口0的狀態(tài) :

  Router> enable

  Password: ******

  Router# show interface Ethernet 0 //顯示以太網(wǎng)接口0的狀態(tài)。

  進(jìn)入配置模式信息:

  Router> enable//進(jìn)入特權(quán)模式

  Password: //特權(quán)用戶口令

  Router# configure terminal //進(jìn)入配置模

  式

  Enter configuration commands

  Router?(config)# interface Ethernet 0//進(jìn)入外部以太網(wǎng)口配置

  Router?(config-if) # ip address

  192.168.1.1 255.255.255.0 //進(jìn)入AUI0接口的IP地址配置為192.168.1.1,子網(wǎng)掩碼為255.255.255.0。

  5 Cisco 2800路由器接口配置信息

  Cisco 2800路由器作為搭建我院OA服務(wù)器和網(wǎng)絡(luò)安全策略的硬件設(shè)備[4],配置Cisco 2800路由器接口信息如下所示:

  Building configuration...

  Current configuration : 2355 bytes

  version 12.3

  service timestamps debug datetime msec

  service timestamps log datetime msec

  no service password-encryption

  hostname Router

  boot-start-marker

  boot-end-marker

  logging buffered 51200 warnings

  enable password ******

  username cisco privilege 15 secret 5 $1$sSWy$k0lsLJFTmyqdIf0xToY05/

  username sgyy privilege 15 secret 5 $1$up6r$XThcUXV.UaJYbQelF3Gke0

  no network-clock-participate aim 0

  no network-clock-participate aim 1

  no aaa new-model

  ip subnet-zero

  ip cef

  ip domain name yourdomain.com

  no ftp-server write-enable

  interface GigabitEthernet0/0

  ip address 192.168.1.1 255.255.255.0

  ip nat inside

  duplex auto

  speed auto

  interface GigabitEthernet0/1

  ip address 10.1.1.1 255.255.255.0

  duplex auto

  speed auto

  interface Serial0/1/0

  ip address 102.105.101.102 255.255.255.240

  ip nat outside

  encapsulation ppp

  !

  ip classless

  ip route 0.0.0.0 0.0.0.0 102.105.101.101

  ip http server

  ip http authentication local

  ip nat pool NATOUT 102.105.101.102 102.105.101.102 netmask 255.255.255.240

  ip nat inside source list 1 pool NATOUT overload

  ip nat inside source static tcp 192.168.1.10 80 102.105.101.102 80 extendable

  ip nat inside source static tcp 192.168.2.10 80 102.105.101.102 8080 extendable

  !

  access-list 1 permit 192.168.0.0 0.0.255.255

  control-plane

  banner login ^C

  6 結(jié)論