路由器口令的配置
程序员文章站
2024-02-11 16:32:22
...
一、实验目的
通过本实验,可以掌握以下技能:
- 配置接口IP地址
- 配置路由器口令
- 验证路由口令的配置
二、设备需求
- Cisco路由器3台,分别命名为RouterA、RouterB和RouterC。其中RouterA具有1个以太网接口和1个串行接口;RouterB具有1个以太网接口和2个串行接口;RouterC具有1个以太网接口和1个串行接口。
- 3根交叉线序双绞线,2根串行线。
- 1台access server,及用于反向Telnet的相应电缆。
- 1台带有超级终端程序的PC机,以及Console电缆及转接器。
三、拓扑结构及接口IP配置
实验的拓扑结构如图所示。通过2根串行线分别把RouterA和RouterB连接起来,RouterB和RouterC连接起来。再将RouterA和PC机相连,RouterB和Server相连。拓扑图如下:
四、实验配置文档
RouterA:
Router>enable
Router#configure ter
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos
Router(config)#hostname RouterA-sjt
RouterA-sjt(config)#inte
RouterA-sjt(config)#interface F
RouterA-sjt(config)#interface FastEthernet 0/0
RouterA-sjt(config-if)#ip address 172.16.11.1 255.255.255.0
RouterA-sjt(config-if)#no shut
RouterA-sjt(config-if)#no shutdown
RouterA-sjt(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
RouterA-sjt(config-if)#exit
RouterA-sjt(config)#int
RouterA-sjt(config)#interface se
RouterA-sjt(config)#interface serial 2/0
RouterA-sjt(config-if)#ip address 172.16.20.1 255.255.255.0
RouterA-sjt(config-if)#clock rate 56000
RouterA-sjt(config-if)#no shut
RouterA-sjt(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
RouterA-sjt(config-if)#exit
RouterA-sjt(config)#
RouterB:
Router>enable
Router#conf
Router#configure te
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos
Router(config)#hostname RouterB-sjt
RouterB-sjt(config)#int
RouterB-sjt(config)#interface F
RouterB-sjt(config)#interface FastEthernet 0/0
RouterB-sjt(config-if)#ip address 172.16.10.6 255.255.255.0
RouterB-sjt(config-if)#no shutd
RouterB-sjt(config-if)#no shutdown
RouterB-sjt(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
RouterB-sjt(config-if)#exit
RouterB-sjt(config)#int
RouterB-sjt(config)#interface s
RouterB-sjt(config)#interface serial 2/0
RouterB-sjt(config-if)#ip address 172.16.20.2 255.255.255.0
RouterB-sjt(config-if)#no shut
RouterB-sjt(config-if)#no shutdown
RouterB-sjt(config-if)#
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
RouterB-sjt(config-if)#exit
RouterB-sjt(config)#int
RouterB-sjt(config)#interface s
RouterB-sjt(config)#interface serial 3/0
RouterB-sjt(config-if)#ip address 172.16.40.1 255.255.255.0
RouterB-sjt(config-if)#clock rate 56000
RouterB-sjt(config-if)#no shut
RouterB-sjt(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial3/0, changed state to down
RouterB-sjt(config-if)#
RouterC-sjt:
Router>enable
Router#conf
Router#configure ter
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host
Router(config)#hostname RouterC-sjt
RouterC-sjt(config)#inte
RouterC-sjt(config)#interface se
RouterC-sjt(config)#interface serial 3/0
RouterC-sjt(config-if)#ip address 172.16.40.2 255.255.255.0
RouterC-sjt(config-if)#no shu
RouterC-sjt(config-if)#no shutdown
RouterC-sjt(config-if)#
%LINK-5-CHANGED: Interface Serial3/0, changed state to up
RouterC-sjt(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
RouterC-sjt(config-if)#
配置路由器A特权口令:
RouterA-sjt>enable
RouterA-sjt#conf
RouterA-sjt#configure ter
RouterA-sjt#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RouterA-sjt(config)#ena
RouterA-sjt(config)#enable se
RouterA-sjt(config)#enable secret twins
配置路由器console口令:
RouterA-sjt(config)#li
RouterA-sjt(config)#line con
RouterA-sjt(config)#line console 0
RouterA-sjt(config-line)#pas
RouterA-sjt(config-line)#password twins
RouterA-sjt(config-line)#login
RouterA-sjt(config-line)#lin
RouterA-sjt(config-line)#exit
配置路由器telnet口令:
RouterA-sjt(config)#line
RouterA-sjt(config)#line vty 0 ?
<1-15> Last Line number
<cr>
RouterA-sjt(config)#line vty 0 15
RouterA-sjt(config-line)#pas
RouterA-sjt(config-line)#password twins
RouterA-sjt(config-line)#login
RouterA-sjt(config-line)#end
RouterA-sjt#
%SYS-5-CONFIG_I: Configured from console by console
RouterA-sjt#
五、验证实验结果
- PC机使用telnet管理RouterA会话
- RouterB和access server相连并成功备份ISO
RouterB-sjt>
RouterB-sjt>en
RouterB-sjt>enable
RouterB-sjt#dir flash
Directory of flash:/
3 -rw- 5571584 <no date> pt1000-i-mz.122-28.bin
2 -rw- 28282 <no date> sigdef-category.xml
1 -rw- 227537 <no date> sigdef-default.xml
64016384 bytes total (58188981 bytes free)
RouterB-sjt#copy flash tftp
Source filename []? pt1000-i-mz.122-28.bin
Address or name of remote host []? 172.16.10.7
Destination filename [pt1000-i-mz.122-28.bin]?
Writing pt1000-i-mz.122-28.bin....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 5571584 bytes]
5571584 bytes copied in 3.225 secs (395850 bytes/sec)
RouterB-sjt#
- 验证路由器口令的配置
User Access Verification
Password:
RouterA-sjt>en
RouterA-sjt>enable
Password:
RouterA-sjt#show run
RouterA-sjt#show running-config
Building configuration...
Current configuration : 858 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
1)设置enable secret后, show running-config的输出
hostname RouterA-sjt
!
!
!
enable secret 5 $1$mERr$B.ufaHcpaunPOIa3RMcT//
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 172.16.11.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
shutdown
!
interface Serial2/0
ip address 172.16.20.1 255.255.255.0
clock rate 56000
!
interface Serial3/0
no ip address
shutdown
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
2)设置console password后, show running-config的输出
line con 0
password twins
login
!
line aux 0
!
3)设置telnet password后, show running-config的输出
line vty 0 4
password twins
login
line vty 5 15
password twins
login
!
!
!
end
RouterA-sjt#
六、实验总结
- 熟练掌握了配置接口IP地址
- 熟练掌握了配置路由器口令并验证了路由器口令
- 在配置接口IP地址时,要将配置的接口的连接的接口配置在同一网段上
- 在配置接口时要确认接口的名称以及接口在配置好是否处于up状态
- 在连接拓扑图时要注意连线和接口的选择,如果选错了则配置会不成功
七、附件
下面给出该实验的文件
上一篇: 微信小程序-页面跳转与参数传递