GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
CÁC LỆNH CẤU HÌNH CƠ BẢN CHO ROUTER
Cho Mô Hình:
I. kết nối bằng secure CRT:
!"#$%&'()*+,-
' ./0
123,4 /0 5 6
.789:5;<◊'=6>?@
AB@C &DEE
II. Cấu hình cơ bản:
FGH IJCKI' ,/04LJM
6"N,4 OP>"QR>"Q4!
S
Router>
%$T"P>"Q @36UMVHW+"!X
Y"L8>"Q4
Trang: 1
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
Router> ?
Z[\] YC"!,4>"Q,
Router>enable
Router#
%F\V"!H"L8HK] Y/0
Router# show ?
%7.CT6^-HK_YC`"a Cb6M@CT
c!d
Router>te?
e"c@ OY6fHKYC`"a Cb
%[\] Y/0 %g"!6!H IYT
Router# Show running-config
> 4^a!SG JQ4IZ*
4+@ 4IY_%%B%%CTHh=h'"!X
46>>@./i:h"!X6>>> CTH
h=h'@^O!Sf#4> CT
/i:h$:'@^O!S4I
j[\] YX"!k P,GlL-"c
Router#exit
Router>
)"!,4>"QH I[\] Yg
Router# configure terminal
Router(config)#
P>"QgCTc! ] fX"!P,G>"Q
,.89m;
H 7I$'
%".f[\] Y7"!".f'
F\".f 4'
Router(config)# hosname R1
R1(config)#
%H IC
'g+n$9"]4o/i9
%H I0
R1(config)# enable password itnH I04+
R1(config)#enable secret ciscoH I0Nc+
> K] Yf"L8H II] YO"L8[
\
%H I0f,40
Trang: 2
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
R1(config)#line vty 0 4 Ep) EpZ) Q ,4
h+
R1(config-line)#password itn04+
R1(config-line)#login
R1(config-line)#exit
R1(config)#line console 0
R1(config-line)#password itn 04+
R1(config-line)#login
R1(config-line)#exit
%H I"."Sqoi,4[\g
R1(config)#interface serial0
R1(config-if)#ip address 192.168.1.123 255.255.255.0 ".1
oi+
R1(config-if)#no shutdown CE+
R1(config-if)clock rate 64000
R1(config-if)description “mô tả cho cổng”
/[\] Y %g %g"!L TH
I
%/[\] Y/0"!6!
/0 %g6!H IYT
Router1#show running-config
Building configuration
Current configuration : 857 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$L6B6$Oaa6ug9hX5bbUiLpbyKj91
!
no aaa new-model
memory-size iomem 5
Trang: 3
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
!
ip cef
!
!
no ip domain lookup
!
interface Serial1/0
description ket noi toi toi ROuter2
ip address 192.168.2.1 255.255.255.0
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet2/0
no ip address
duplex auto
speed auto
!
ip http server
!
control-plane
!
!
line con 0
password itn
Trang: 4
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
login
line aux 0
line vty 0 4
password itn
login
!
End
/0gCg6!T
Router1# show ip int brief
Interface IP-Address OK? Method Status Protocol
Serial1/0 192.168.2.1 YES manual up up
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
FastEthernet2/0 unassigned YES TFTP up up
/0,6!,oA/
Router1#show version
Cisco IOS Software, 3600 Software (C3640-TELCO-M),
Version 12.4(16),
RELEASE SOFTWARE (fc1)
Technical Support:
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 20-Jun-07 11:43 by prod_rel_team
ROM: ROMMON Emulation Microcode
ROM: 3600 Software (C3640-TELCO-M), Version 12.4(16),
RELEASE
OFTWARE (fc1)
Router1 uptime is 2 hours, 44 minutes
System returned to ROM by unknown reload cause – suspect
boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0,
BOOTDATA 19
System image file is "tftp://255.255.255.255/unknown"
Cisco 3640 (R4700) processor (revision 0xFF) with
124928K/6144K bytes of memory.
Processor board ID 00000000
R4700 CPU at 100MHz, Implementation 33, Rev 1.2
1 FastEthernet interface
4 Serial interfaces
DRAM configuration is 64 bits wide with parity enabled.
125K bytes of NVRAM.
Trang: 5
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
8192K bytes of processor board System flash (Read/Write)
Configuration register is 0x2142
/0g6!grsAtA'u
Router1#show flash:
System flash directory:
No files in System flash
[0 bytes used, 8388604 available, 8388604 total]
8192K bytes of processor board System flash (Read/Write)
Chạy các lệnh từ xa trên router của Cisco từ máy tính:
tY CTc!".WTH `Yv0,4TQ
Yf "L86^V=^LwIL-fCTOKc
=//7- "!c!MYYV$44O
L-xCTc!"ywTY 46^aK
6WH `Yv0@"G 4H 38,Y"G
6!,4M"Qk KU
Remote shell (rsh) là gì?
'4QLJIzY^Lw
Y"G 4Ro{,4t X$b[\Rsh@CTc!M
LJIzYfQY#X7Y#X4c
!4QY"G 4Ro{t X6@.c!4Q
6c !"Rsh4QaY"G 4$/$Ro{
,4CyKrcp+,4rlogin+
=6"k KS,fYt X"Nk Q,-rsh@I
Q4k KSv06^L,3=3@Kv0{i,4
v0/,ZEEj"G Cyrsh7I:C! S<,Y
[\rshTH `Y
7I:
Trang: 6
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
= f@64,Y,-rshCTN-brsh6^4
c6^Nc G^_>CS#X,4Y$T ^a
KH Irsh4Hc!f Cb6c"Sqoi
k KU,4fLw
= f@36"Nc_"GzL,3@Irsh,x
6^4,-//7FI,3O4> [\rshfQT
Cf"N"L8CK,Y,4_4$b4@> CT|
rsh^k QLw[@IcO[\=i*)+
Phương pháp cấu hình rsh trên router?
1!c6K2TQYfv0@N>4
,- @MYY@,4 "cKT"a CT@HK_
Ia443,4Y}NXX|4CQk
IX[U
=L-f@CTaK6TS,\f
oA/O<S,\rcmd1!6TS,\4@N
3,4Y "]f~Cg B
' g+n%C
=l@CTaKH I|T4,Y,4Lw
c6K2MYY"c/ "]4Q,\
Y4
' g+n%&ZD•)*,C
}NKzYfiaip rcmd remote-
host "L8 f a =>@CT3,4fLw€local•f
LwO"236Y"L8M
YF\f[\Lw\CQ€root•
=>"c@192.168.1.454"SqoiT4,Yk KU4CT
|"!MYY%c6@"]
4"Sqoi=>@CTIHfLw
v0QCQ4ddavisL,\I"]4fLw
"23,4v0{i‚LLwOMYY
rshfv0> LCT[\Q3Y^,YC"!
Trang: 7
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
M Y f v0@IO a3 ,4 f Lw
v0,4L-3C
4Yl#6c€enable•tY4|Lw
3"!6T6! f $Tc!M
YCL-4XJ,4qdl"Q 3"L8|\@#
l">*+
7N ^-bY4K>bCT"Nc
"L8H I,4cQLw\CQ"L8<4€root•> CT
6^cQLw[\@Ic![\Y "]
' g+n ,*0ƒ
Phương pháp sử dụng rsh từ trạm làm việc Windows
6"NH IYLf@CTc!„4TQ
Y#H `Yv07I$"LQ,\
Trang: 8
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
7I$
Trên thực tế bạn sử dụng lệnh sau:
Z: rsh Router1 -l root sh ver
1]4zY"c4,Y
• =f4"G "a faK"L8qd,\f4
Router1+
• =>@P"][\-l_t+"!X"SfLwO
"L8"!"23tL Ub,xOK[\€ddavis•
fv0\CQ"!"KCK4+
• @4q"SdY=Lw844MYY
show versionsh ver+
Bạn có thể làm gì với lệnh rsh?
Trang: 9
GVHD: Đặng Thành Đạt SVTH: Thạch Thị Xuân Mai
4,Y[\Y0,@CTc!‚MYf
Y0 %g +YPl".k G
6/ "]4Q,\
• show ip interface brief
• show ip route
• show ip ospf neighbors
• show ip bgp summary
• show log
1G CT6^!MY"c4TQY~Cg
B@,\L,Y6TQY.4H IQ"Sq
oi 1] 4 "G - T 6 Y 0
= f@QlH_ 4CTc!MY"c4|H
IYw-Q=?=i,4MYcCfQ3Y
6P "a f v0 … T@ CT [ \ Y copy
running-configuration tftp:/1.1.1.1.
Có thể thực hiện những gì khác với các lệnh từ xa?
> X4Y oA/,GY#XICTO3Hbc
Q<c![\,-Y#XBQ_".
a"]HoA/"c4CTc6K2X3Y-
"L8q"S,4Cb,YQ"G 6! 3
oA/
BQ_MC>"},SJ4c![\|#X
+FI>@CT44c!|Q3CbY
v0#"> .# -46^a
[\=?=i?=i$Tc!6TYrcp,-Yip rcmd
rcp-enable+
Kết luận
Yrsh.rcmd+c!H_ ,Y"G
4#X CT1G 4O".CY"}> LCT T
Q3Yt Xv0"-HK T,4M
YQYshow
Trang: 10