试验拓扑:

clip_image002

在PC上配置IP地址:

clip_image004

路由器配置:

Router>enable

Router#config t

Router(config)#host jintian

jintian(config)#enable password 123

jintian(config)#int fa0/0

jintian(config-if)#ip add 192.168.1.1 255.255.255.0

jintian(config-if)#no shut

jintian(config-if)#exit

jintian(config)username jintian password jintian

jintian(config)#ip domain-name jintian.com

jintian(config)#crypto key generate rsa

The name for the keys will be: jintian.jintian.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 512

jintian(config)#line vty 0 4

jintian(config-line)#transport input ssh

jintian(config-line)#login local

jintian(config-line)#

测试:

在PC上:

Packet Tracer PC Command Line 1.0

PC>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=62ms TTL=255

Reply from 192.168.1.1: bytes=32 time=32ms TTL=255

Reply from 192.168.1.1: bytes=32 time=32ms TTL=255

Reply from 192.168.1.1: bytes=32 time=31ms TTL=255

Ping statistics for 192.168.1.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 31ms, Maximum = 62ms, Average = 39ms

PC>ssh -l jintian 192.168.1.1

Password:

jintian>en

Password:

jintian#