You are on page 1of 7

S DNG TELNET

Yu cu :
- Kt ni 3 router v dy cp nh hnh v
- Cu hnh c bn cho router
- Gn IP cho cc router nh hnh v
- Cu hnh telnet
- Kim tra qu trnh kt ni telnet
Hng Dn :
Cng vic 1 : Kt ni 3 router v dy cp nh hnh v
Cng vic 2 : Cu hnh c bn cho router

Cu hnh c bn cho router 1 v t password khi vo privilege mode l cisco1


Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#enable password cisco1
R1(config)#exit
R1#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
R1#

Cu hnh c bn cho router 2; router 3 v t password khi vo privilege mode ln


lt l cisco2; cisco3 ta thc hin tng t nh trn

VDC Training Center Trang 1 ThS L Xun Tng


Cng vic 3 : Gn IP cho cc router
Kim tra cc Interface ca router xem th router c cc loi Interface no, trng
thi ra sao

R1#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES manual administratively down down

FastEthernet0/1 unassigned YES manual administratively down down

Vlan1 unassigned YES manual administratively down down

Kim tra tng t cho router2 v router3

Gn IP cho router1

R1(config)#interface fa0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#

Gn IP cho router2

R2(config)#interface fa0/1
R2(config-if)#ip address 192.168.1.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#

R2(config)#interface fa0/0
R2(config-if)#ip address 172.16.1.1 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#

Gn IP cho router3

R3(config)#interface fa0/1
R3(config-if)#ip address 172.16.1.2 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#
VDC Training Center Trang 2 ThS L Xun Tng
Kim tra sau khi gn IP : Ta quan st xem IP c c t ng hay khng v trng
thi ca cc cng giao tip
Router 1 :

R1#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 192.168.1.1 YES manual up up

FastEthernet0/1 unassigned YES manual administratively down down

Vlan1 unassigned YES manual administratively down down

Router 2 :

R2#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.1.1 YES manual up up

FastEthernet0/1 192.168.1.2 YES manual up up

Vlan1 unassigned YES manual administratively down down

Router 3 :

R3#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES manual administratively down down

FastEthernet0/1 172.16.1.2 YES manual up up

Vlan1 unassigned YES manual administratively down down

Ping qua li gia cc router cn k nhau kim tra thng mng


Router1 ping Router2 :

R1#ping 192.168.1.2

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
VDC Training Center Trang 3 ThS L Xun Tng
Router2 ping Router1 :

R2#ping 192.168.1.1

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

Router2 ping Router3 :

R2#ping 172.16.1.2

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

Router3 ping Router2 :

R3#ping 172.16.1.1

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

Cng vic 4 : Cu hnh telnet


Telnet l mt giao thc u cui o (Virtual terminal VTY) l mt phn ca chng
giao thc TCP/IP. Telnet cho php to kt ni vi thit b t xa, thu thp thng tin v
chy chng trnh.

M line VTY v t mt khu cho telnet


Router 1 :

R1(config)#line vty 0 ?
<1-15> Last Line number
<cr>
R1(config)#line vty 0 15 h tr n 16 phin telnet (0-15)
R1(config-line)#password class1
R1(config-line)#login
R1(config-line)#exit
R1(config)#

VDC Training Center Trang 4 ThS L Xun Tng


Router 2 :

R2(config)#line vty 0 15
R2(config-line)#password class2
R2(config-line)#login
R2(config-line)#exit
R2(config)#

Router 3 :

R3(config)#line vty 0 15
R3(config-line)#password class3
R3(config-line)#login
R3(config-line)#exit
R3(config)#

Tin hnh telnet


T Router 1 telnet n Router 2 ri ng Router 2 tip tc telnet n Router 3

R1#telnet 192.168.1.2
Trying 192.168.1.2 ...
User Access Verification
Password: g password l class2
R2>enable
Password: g password l cisco2

R2#telnet 172.16.1.2
Trying 172.16.1.2 ...
User Access Verification
Password: g password l class3
R3>enable
Password: g password l cisco3
R3#

Thot khi telet

Nu ta ang telnet vo mt router no m ta g EXIT th ta s ngt kt ni v


quay tr v router trc . Nh trng hp trn ta t R1R2R3, nu t R3 g
exit s v R2, t R2 g exit s v R1

R3#exit

[Connection to 172.16.1.2 closed by foreign host]

VDC Training Center Trang 5 ThS L Xun Tng


R2#exit

[Connection to 192.168.1.2 closed by foreign host]

R1#

Lu :
- Nu ta khng g EXIT m nhn t hp phm Ctrl + Shift + 6 th ra ri nhn lin
phm X, th ta khng ngt kt ni telnet vi router m ch tm thot ra khi router
m thi, phin kt ni (Session) vn cn c gi
- telnet vo mt router thay v g :
R1#telnet 192.168.1.2
Ta c th g
R1#192.168.1.2

To c s d liu s dng truy cp t xa hiu qu


Router 1 :
R1(config)#ip host r2 192.168.1.2

Router 2 :
R2(config)#ip host r1 192.168.1.1
R2(config)#ip host r3 172.16.1.2

Router 3 :
R3(config)#ip host r2 172.16.1.1

Telnet bng tn

R1#r2
Trying 192.168.1.2 ...
User Access Verification
Password:
R2>enable
Password:

R2#r3
Trying 172.16.1.2 ...
User Access Verification
Password:
R3>enable
Password:
R3#

VDC Training Center Trang 6 ThS L Xun Tng


t Router Banner : chng ta t mt cu cho mng hoc cu thng bo trn
router ca mnh, khi c ngi khc telnet n cu cho mng ny s xut hin

R1(config)#banner motd #chao mung ban den voi router 1#

R2#r1

Trying 192.168.1.1 ...


chao mung ban den voi router 1
User Access Verification
Password:
R1>

Cng vic 5 : Kim tra qu trnh kt ni telnet

Xem mnh ang kt ni vi ai


R#Show sessions

Xem ai ang kt ni n mnh


R#Show users

Ngt kt ni ca mt user ang telnet n mnh


R#clear line [s th t]
l s th t line hin th trong lnh show sessions

VDC Training Center Trang 7 ThS L Xun Tng

You might also like