(+84) 236.3827111 ex. 402

Hướng dẫn cấu hình một Terminal Server – SSH


Chúng ta sử dụng Cisco Packet Tracer 6.0.1 để tạo Lab như hình trên. Con Terminal Server được dùng ở đây là Router 1941. Chúng ta sẽ add thêm cho con Router 1941 card HWIC-8A để có thể Console vào các thiết bị phía sau (R3, R4, R5) từ PC1. Sau khi add thêm card HWIC-8A thì trên con Terminal Server sẽ có thêm 8 port là Async0/0/0 => Async0/0/7.

Dùng cáp Octal để nối các cổng Async0/0/x trên con Terminal Server với các cổng Console trên thiết bị phía sau là R3, R4, R5.

Chúng ta cấu hình IP cho các thiết bị như trên sơ đồ.

Cấu hình con Terminal Server:

Router> enable

Router# conf t

Router(config)# hostname Terminal_Server

Terminal_Server(config)# interface g0/0

Terminal_Server(config-if)# ip address 10.1.1.1 255.0.0.0

Terminal_Server(config-if)# no shutdown

Terminal_Server(config-if)# end

Ternimal_Server#ping 10.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:

!!!!!

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

Ternimal_Server#

Terminal_Server(config)# ip domain-name dtu.vn

Ternimal_Server(config)#ip ssh version 2

Please create RSA keys (of at least 768 bits size) to enable SSH v2.

Ternimal_Server(config)#

Ternimal_Server(config)#crypto key generate rsa

The name for the keys will be: Ternimal_Server.dtu.vn

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]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

Ternimal_Server(config)#

Ternimal_Server(config)#username duytan privilege 15 password dtu

*Mar 1 0:15:21.288: %SSH-5-ENABLED: SSH 2 has been enabled

Ternimal_Server(config)#

Terminal_Server# show line

Terminal_Server(config)# line 0/0/0 0/0/7

Terminal_Server(config-line)# transport input all

Terminal_Server(config-line)# login local

Ternimal_Server#show run

Building configuration...

Current configuration : 698 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Ternimal_Server

!

!

!

!

!

!

!

!

username duytan privilege 15 password 0 dtu

!

!

!

license udi pid CISCO1941/K9 sn FTX1524W8L7

!

!

!

ip ssh version 2

ip domain-name dtu.vn

!

!

spanning-tree mode pvst

!

!

!

!

interface GigabitEthernet0/0

ip address 10.1.1.1 255.0.0.0

duplex auto

speed auto

!

interface GigabitEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip classless

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line 0/0/0 0/0/7

transport input all

login local

!

line vty 0 4

login

!

!

!

end

Ternimal_Server#

KIỂM THỬ

Qua PC1:

PC> ssh /?

PC> ssh –l duytan:3 10.1.1.1

Gõ password là dtu (Như đã tạo ở trên)

Chúng ta kết nối thành công từ PC1 vào R3 qua cổng Console.

Router> en

Router# show run

Router# conf t

Router(config)# hostname R3

R3(config)# exit

R3# exit

=> Quan sát có thoát khỏi chế độ console chưa?

Qua Terminal_Server:

Terminal_Server# clear line tty 3

[Confirm]

Terminal_Server#

Quay lại PC1 quan sát xem đã thoát khỏi chế độ Console chưa?

Tương tự cho việc Console vào R4 & R5.

Bài sau mình sẽ trình bày về cách xây dựng một Terminal Server - Telnet.

Chúc vui!