实验三、路由器的基本配置

一、 实验目的

1. 掌握路由器配置前的准备

2. 掌握路由器的机器名的配置

3. 接口IP 地址、基本封装类型

二、 应用环境

1. 在执行配置之前,本节学习的基本配置,是其他任务的基础。

2. 主要学习机器名、接口地址、特权模式密码等方法

三、 实验设备

1. DCR-1751 两台

2. CR-V35MT 一条

3. CR-V35FC 一条

4. 网线 两条

四、 实验拓扑

clip_image002

五、 实验要求

配置表

Router-A Router-B

接口 类型 IP 地址 接口 类型 IP 地址

S1/1 DCE 192.168.1.1 S0/0 DTE 192.168.1.2

F0/0 192.168.2.1

六、 实验步骤

路由器A 的基本配置:

第一步:恢复出厂设置

Router>enable !进入特权模式

Router#2004-1-1 00:32:10 User DEFAULT enter privilege mode from console 0, level = 15

Router#show running-config !查看当前配置

Building configuration...

Current configuration:

!

!version 1.3.2E

<省略>

Router#delete !删除配置文件

this file will be erased,are you sure?(y/n)y

Router#reboot !重新启动

Do you want to reboot the router(y/n)?y

Please wait…..

第二步:设置接口IP 地址、DCE 的时钟频率以及验证

Router&gt;enable !进入特权模式

Router #config !进入全局配置模式

Router _config#hostname Router-A !修改机器名

Router-A_config#interface s1/1 !进入接口模式

Router-A_config_s1/0#ip address 192.168.1.1 255.255.255.0 !配置IP 地址

Router-A_config_s1/0#physical-layer speed 64000 !配置DCE 时钟频率

Router-A_config_s1/0#no shutdown

Router-A_config_s1/0#^Z !按ctrl + z 进入特权模式

Router-A#show interface s1/1 !查看接口状态

Serial1/0 is up, line protocol is down !对端没有配置,所以协议是DOWN

Mode=Sync DCE Speed=64000 !查看DCE

DTR=UP,DSR=UP,RTS=UP,CTS=DOWN,DCD=UP

Interface address is 192.168.1.1/24 !查看IP 地址

MTU 1500 bytes, BW 64 kbit, DLY 2000 usec

Encapsulation prototol HDLC, link check interval is 10 sec !查看封装协议

Octets Received0, Octets Sent 0

Frames Received 0, Frames Sent 0, Link-check Frames Received0

Link-check Frames Sent 89, LoopBack times 0

Frames Discarded 0, Unknown Protocols Frames Received 0, Sent failuile 0

Link-check Timeout 0, Queue Error 0, Link Error 0,

60 second input rate 0 bits/sec, 0 packets/sec!

60 second output rate 0 bits/sec, 0 packets/sec!

0 packets input, 0 bytes, 8 unused_rx, 0 no buffer

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

8 packets output, 192 bytes, 0 unused_tx, 0 underruns

error:

0 clock, 0 grace

PowerQUICC SCC specific errors:

0 recv allocb mblk fail 0 recv no buffer

0 transmitter queue full 0 transmitter hwqueue_full

Router-A#config

Router-A_config#interface f0/0

Router-A_config_f0/0#ip address 192.168.2.1 255.255.255.0

Router-A_config_f0/0#no shutdown

Router-A_config_f0/0#^Z

Router-A#show interface f0/0

FastEthernet0/0 is up, line protocol is up

address is 00e0.0f18.1a70

Interface address is 192.168.2.1/24

MTU 1500 bytes, BW 100000 kbit, DLY 10 usec

Encapsulation ARPA, loopback not set

Keepalive not set

ARP type: ARPA, ARP timeout 04:00:00

60 second input rate 0 bits/sec, 0 packets/sec!

60 second output rate 6 bits/sec, 0 packets/sec!

Full-duplex, 100Mb/s, 100BaseTX, 1 Interrupt

0 packets input, 0 bytes, 200 rx_freebuf

Received 0 unicasts, 0 lowmark, 0 ri, 0 throttles

0 input errors, 0 CRC, 0 framing, 0 overrun, 0 long

1 packets output, 46 bytes, 50 tx_freebd, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collisions, 0 deferred, 0 err600

0 lost carrier, 0 no carrier 0 grace stop 0 bus error

0 output buffer failures, 0 output buffers swapped out

第三步:设置特权模式密码

Router-A_config#enable password 0 digitalchina !0 表示明文

Router-A_config#^Z

Router-A#2004-1-1 16:38:49 Configured from console 0 by DEFAULT

Router-A#exit

Router-A&gt;enable !再次进入特权模式

Password: !需要输入密码

Access deny !

Router-A&gt;enable

Password: !注意输入时不显示

Router-A#2004-1-1 16:39:14 User DEFAULT enter privilege mode from console 0, level = 15

Router-A#

第四步:保存

Router-A#write !保存配置

Saving current configuration...

OK!

第五步:查看配置序列

Router-A#show running-config

Building configuration...

Current configuration:

!

!version 1.3.2E

service timestamps log date

service timestamps debug date

no service password-encryption

!

hostname Router-A !查看机器名

!

enable password 0 digitalchina level 15 !注意到密码可以显示

!

interface FastEthernet0/0

ip address 192.168.2.1 255.255.255.0 !查看IP 地址

no ip directed-broadcast

!

< 省略….>

interface Serial1/1

ip address 192.168.1.1 255.255.255.0 !查看IP 地址

no ip directed-broadcast

physical-layer speed 64000

!

interface Async0/0

no ip address

no ip directed-broadcast

!

路由器B 的配置(命令解释参照路由器A 的配置)

第一步:恢复出厂设置

Router&gt;enable !进入特权模式

Router#2004-1-1 00:32:10 User DEFAULT enter privilege mode from console 0, level = 15

Router#show running-config !查看当前配置

Building configuration...

Current configuration:

!

!version 1.3.2E

<省略>

Router#delete !删除配置文件

this file will be erased,are you sure?(y/n)y

Router#reboot !重新启动

Do you want to reboot the router(y/n)?y

Please wait…..

第二步:设置IP 地址及验证

Router&gt;enable

Router#2004-1-1 01:04:14 User DEFAULT enter privilege mode from console 0, level = 15

Router#config

Router_config#hostname Router-B

Router-B_config#interface s1/0

Router-B_config_s1/0#ip address 192.168.1.2 255.255.255.0

Router-B_config_s1/0#no shutdown

Router-B_config_s1/0#^Z

Router-B#show interface s1/0

Serial1/0 is up, line protocol is up !此时接口和协议都是up 状态

Mode=Sync DTE

DTR=UP,DSR=UP,RTS=DOWN,CTS=UP,DCD=UP

Interface address is 192.168.1.2/24

MTU 1500 bytes, BW 64 kbit, DLY 2000 usec

Encapsulation prototol HDLC, link check interval is 10 sec

Octets Received0, Octets Sent 0

Frames Received 0, Frames Sent 0, Link-check Frames Received0

Link-check Frames Sent 391, LoopBack times 0

Frames Discarded 0, Unknown Protocols Frames Received 0, Sent failuile 0

Link-check Timeout 0, Queue Error 0, Link Error 0,

60 second input rate 0 bits/sec, 0 packets/sec!

60 second output rate 0 bits/sec, 0 packets/sec!

0 packets input, 0 bytes, 8 unused_rx, 0 no buffer

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

8 packets output, 192 bytes, 0 unused_tx, 0 underruns

error:

0 clock, 0 grace

PowerQUICC SCC specific errors:

0 recv allocb mblk fail 0 recv no buffer

0 transmitter queue full 0 transmitter hwqueue_full

第三步:保存

Router-B#write

Saving current configuration...

OK!

第四步:查看配置序列

Router-B#show running-config

Building configuration...

Current configuration:

!

!version 1.3.2E

service timestamps log date

service timestamps debug date

no service password-encryption

!

hostname Router-B

!

interface FastEthernet0/0

ip address 192.168.3.1 255.255.255.0

no ip directed-broadcast

!

interface Ethernet1/1

no ip address

no ip directed-broadcast

duplex half

!

interface Serial1/0

ip address 192.168.1.2 255.255.255.0

no ip directed-broadcast

!

interface Async0/0

no ip address

no ip directed-broadcast

!

!

!

!

!

! !

第五步:测试连通性

Router-B#ping 192.168.1.1 !PING Router-A 的地址

PING 192.168.1.1 (192.168.1.1): 56 data bytes

!!!!!

--- 192.168.1.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max = 20/22/30 ms