Router Configuration<2>

Target:

   在路由器上配置Telnet。

   *

   实验原理

       将两台路由器通过串口,以V.35 DTE/DCE电缆连接在一起,分别配置Telnet,可以互相以Telnet方式登录对方。

       路由器提供广域网接口(serial高速同步串口),使用V.35线缆连接广域网接口链路。在广域网连接时一端为DCE(数据通信设备),一端为DTE(数据终端设备)。要求必须在DCE端配置时钟频率(clock rate)才能保证链路的连通。

   *

   实验拓扑图:

Step:


第一步:配置路由器的名称、接口IP地址和时钟

R3740#configure terminal

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

R3740(config)#hostname RouterA

!配置路由器的名称

RouterA(config)#interface serial 4/0

!进入串口的接口配置模式

RouterA(config-if)#clock rate 512000

!设置DCE端的时钟频率,如果不知道时钟频率 可以 clock rate ? 查询,如果时钟频率不对链接

!则不成功

RouterA(config-if)#ip address 192.168.1.1 255.255.255.0

!配置接口IP地址

RouterA(config-if)#no shutdown

!启用端口

RouterA(config-if)#exit

R3740#configure terminal

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

R3740(config)#hostname RouterB

RouterB(config)#interface serial 4/0

RouterB(config-if)#ip address 192.168.1.2 255.255.255.0

RouterB(config-if)#no shutdown

RouterB(config-if)#exit

第二步:配置Telnet

RouterA(config)#enable password yxh

!配置路由器的特权模式密码

RouterA(config)#line vty 0 4

!进入线程配置模式

RouterA(config-line)#password yxh

!配置Telnet密码

RouterA(config-line)#login

!设置Telnet登录时进行身份验证

RouterA(config-line)#end

RouterB(config)#enable password yxh

RouterB(config)#line vty 0 4

RouterB(config-line)#password yxh

RouterB(config-line)#login

RouterB(config-line)#end

第三步:测试网络连通性,以Telnet方式登录路由器

RouterB#ping 192.168.1.1

Sending 5, 100-byte ICMP Echoes to 192.168.1.1, timeout is 2 seconds:

< press Ctrl+C to break >

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms

RouterB#telnet 192.168.1.1

Trying 192.168.1.1, 23...

User Access Verification

Password:

!提示输入Telnet密码,此处输入yxh

RouterA>en

Password:

!提示输入特权模式密码,此处输入yxh

RouterA#en

!远程登录路由器A,可进行配置

RouterA#

RouterA#conf t

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

RouterA(config)#exit

RouterA#

RouterA#

RouterA#exit

!使用exit命令退出Telnet登录

RouterB#

RouterA#ping 192.168.1.2

Sending 5, 100-byte ICMP Echoes to 192.168.1.2, timeout is 2 seconds:

< press Ctrl+C to break >

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/10 ms

RouterA#telnet 192.168.1.2

Trying 192.168.1.2, 23...

User Access Verification

Password:

RouterB>en

Password:

RouterB#

RouterB#conf t

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

RouterB(config)#exit

RouterB#

RouterB#exit

RouterA#

【注意事项】

1、如果两台路由器通过串口直接互连,则必须在其中一端设置时钟频率(DCE)。

2、如果没有配置Telnet密码,则登录时会提示“Password required, but none set”。

3、如果没有配置enable密码,则远程登录到路由器上后不能进入特权模式,提示“Password required, but none set”。

【参考配置】

RouterA#show running-config

Building configuration...

Current configuration : 582 bytes

!

version RGNOS 10.1.00(4), Release(18443)(Tue Jul 17 21:16:17 CST 2007 -ubu1server)

hostname RouterA

!

!

enable password 7 035122110c3706

!

interface serial 4/0

ip address 192.168.1.1 255.255.255.0

clock rate 512000

!

interface serial 4/1

clock rate 64000

!

interface GigabitEthernet 0/0

duplex auto

speed auto

!

interface GigabitEthernet 0/1

duplex auto

speed auto

!

!

line con 0

line aux 0

line vty 0 4

login

password 7 0133574225

!

end

RouterB#show running-config

Building configuration...

Current configuration : 562 bytes

!

version RGNOS 10.1.00(4), Release(18443)(Tue Jul 17 21:16:17 CST 2007 -ubu1server)

hostname RouterB

!

!

enable password 7 0251563e120f3b

!

interface serial 4/0

ip address 192.168.1.2 255.255.255.0

!

interface serial 4/1

clock rate 64000

!

interface GigabitEthernet 0/0

duplex auto

speed auto

!

interface GigabitEthernet 0/1

duplex auto

speed auto

!

line con 0

line aux 0

line vty 0 4

login

password 7 0059344251

!

end


你可能感兴趣的:(interface,路由器,IP地址,广域网,通信设备)