实验二——————路由器口令配置

实验目的

通过本实验,可以掌握以下技能:

  • 配置接口IP地址。
  • 配置路由器口令。
  • 验证路由口令的配置。

设备需求

  • Cisco路由器3台,分别命名为RouterA、RouterB和RouterC。其中RouterA具有1个以太网接口和1个串行接口;RouterB具有1个以太网接口和2个串行接口;RouterC具有1个以太网接口和1个串行接口。
  • 3根交叉线序双绞线,2根串行线。
  • 1台access server,及用于反向Telnet的相应电缆。
  • 1台带有超级终端程序的PC机,以及Console电缆及转接器。

拓扑结构及配置说明

实验的拓扑结构如下所示。通过2根串行线分别把RouterA和RouterB连接起来,RouterB和RouterC连接起来。

实验二——————路由器口令配置_第1张图片

各路由器使用的接口及其编号见图10-1所示的标注。各接口IP地址分配如下:

  • RouterA:E0:172.16.11.1  S0:172.16.20.1
  • RouterB:E0:172.16.10.6  S0:172.16.20.2  S1:172.16.40.1 
  • RouterC:E0:172.16.50.1  S0:172.16.40.2

实验配置

配置路由器串口与以太网接口:

RouterA:

一个串口,一个以太网接口
实验二——————路由器口令配置_第2张图片

实验二——————路由器口令配置_第3张图片

RouterB

两个串口,一个以太网接口

实验二——————路由器口令配置_第4张图片

实验二——————路由器口令配置_第5张图片

RouterC

一个以太网接口,一个串口

实验二——————路由器口令配置_第6张图片

实验二——————路由器口令配置_第7张图片

网络结构图

实验二——————路由器口令配置_第8张图片

基本网络配置

RouterA 

主机名、IP、子网掩码(下面的应该是“子网掩码”不是网关,我这里写错了,但是截图的原因就不好改了,太麻烦,请读者注意一下哈

实验二——————路由器口令配置_第9张图片

涉及代码:

实验二——————路由器口令配置_第10张图片

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RouterA
RouterA(config)#interface Ethernet0/0/0
RouterA(config-if)#ip address 172.16.11.1 255.255.255.0
RouterA(config-if)#no shutdown

RouterA(config-if)#
%LINK-5-CHANGED: Interface Ethernet0/0/0, changed state to up

RouterA(config-if)#exit
RouterA(config)#interface Serial0/1/0
RouterA(config-if)#ip address 172.16.20.1 255.255.255.0
RouterA(config-if)#clock rate 56000
RouterA(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
RouterA(config-if)#exit

验证

实验二——————路由器口令配置_第11张图片

RouterB

主机名、IP、子网掩码配置(下面的应该是“子网掩码”不是网关,我这里写错了,但是截图的原因就不好改了,太麻烦,请读者注意一下哈

实验二——————路由器口令配置_第12张图片

具体代码:

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RouterB
RouterB(config)#interface Ethernet0/1/0
RouterB(config-if)#ip address 172.16.10.6 255.255.255.0
RouterB(config-if)#no shutdown

RouterB(config-if)#
%LINK-5-CHANGED: Interface Ethernet0/1/0, changed state to up

RouterB(config-if)#interface Serial0/0/0
RouterB(config-if)#ip address 172.16.20.2 255.255.255.0
RouterB(config-if)#no shutdown

RouterB(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

RouterB(config-if)#interface 
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed st
RouterB(config-if)#interface Serial0/0/1
RouterB(config-if)#ip address 172.16.40.1 255.255.255.0
RouterB(config-if)#clock rate 56000
RouterB(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
RouterB(config-if)#exit
RouterB(config)#^Z
RouterB#
%SYS-5-CONFIG_I: Configured from console by console

验证

实验二——————路由器口令配置_第13张图片

RouterC

主机名、IP、子网掩码配置

实验二——————路由器口令配置_第14张图片

涉及源码:

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RouterC
RouterC(config)#interface Ethernet0/1/0
RouterC(config-if)#ip address 172.16.50.1 255.255.255.0
RouterC(config-if)#no shutdown
RouterC(config-if)#interface Serial0/0/0
RouterC(config-if)#ip address 172.16.40.2 255.255.255.0
RouterC(config-if)#no shutdwon
                           ^
% Invalid input detected at '^' marker.
	
RouterC(config-if)#no shutdown
RouterC(config-if)#exit
RouterC(config)#^Z
RouterC#
%SYS-5-CONFIG_I: Configured from console by console

RouterC#

验证

实验二——————路由器口令配置_第15张图片

最后的网络拓扑结构(这里的PC2、PC3自我配置只需要在一个子网中即可,此处不再多说)

实验二——————路由器口令配置_第16张图片

配置路由器特权口令

RouterA:

RouterA>enable
RouterA#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
RouterA(config)#enable secret twins

查看口令(此时的口令是经过加密的,而且主要是在特权模式下查看不是在全局配置模式下哈)

实验二——————路由器口令配置_第17张图片

配置路由器Console口令

RouterA

实验二——————路由器口令配置_第18张图片

验证:

实验二——————路由器口令配置_第19张图片

配置路由器Telnet口令

实验二——————路由器口令配置_第20张图片

RouterA#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
RouterA(config)#line vty 0 4
RouterA(config-line)#password twins
RouterA(config-line)#^Z
RouterA#
%SYS-5-CONFIG_I: Configured from console by console

RouterA#

验证:

实验二——————路由器口令配置_第21张图片

你可能感兴趣的:(【网络配置】,#,网络设备与配置,网络配置)