继上次发表的交换机基本配置,这次 发第二篇路由器的基本配置。具体的实验如下:
实验环境:
路由器2台,console 电缆1根,PC机1台,网线1根,DTE-DCE交叉电缆1根。连接如图:
实验步骤:
练习一
1、路由器的FastEthernet0/1端口指定一个IP地址192.168.0.1/24,设置虚拟终端登录密码“cisco”,设置进入特权状态的明文密码为“cisco”,密文密码“cisco1”。
1、FastEthernet0/1端口指定一个IP地址192.168.0.1
Router>enable
Router#
Router#configure t
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#interface f0/1
Router(config-if)#ip address 192.168.0.1255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to up
Router(config-if)#end
2、设置虚拟终端登录密码“cisco”
Router#configure t
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#line console 0
Router(config-line)#line vty 0 4
Router(config-line)#password cisco
Router(config-line)#end
%SYS-5-CONFIG_I: Configured from console byconsole
3、设置进入特权状态的明文密码为“cisco”,密文密码“cisco1”
Router#
%SYS-5-CONFIG_I: Configured from console byconsole
Router#conf t
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#enable password cisco
Router(config)#enable secret cisco1
Router#
2、将PC机通过Ethernet链接到路由器的FastEthernet0/1端口,并用Telnet方式远程登录路由器;
小结: 在特权模式下,如果同时设置password 和 secret ,带密文的secret有效;链接计算机终端和路由器f0/1的网线使用交叉线;
3、设置路由器名为RTA,为路由器Console口设置密码“cisco”;
Router>enable
Password:
Router#configure t
Enter configuration commands, one perline. End with CNTL/Z.
Router(config)#hostname RTA
RTA(config)#line console 0
RTA(config-line)#password cisco
RTA(config-line)#exit
RTA(config)#
4、查看当前内存配置信息,正确后保存到NVRAM中.
RTA#show runn
Building configuration...
Current configuration : 547 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RTA
!
enable secret 5 $1$mERr$q.MA2tj.WFptzvbifq/1i.
enable password cisco
!
interface FastEthernet0/0
noip address
duplex auto
speed auto
shutdown
!
interface FastEthernet0/1
ipaddress 192.168.0.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
noip address
shutdown
!
ip classless
!
line con 0
line vty 0 4
password cisco
login
end
练习二
1、配置路由器RTA的串行口S0的IP地址192.168.10.1/24,路由器RTB的串行口S0的IP地址192.168.10.2/24;
1配置路由器RTA的串行口S0的IP地址192.168.10.1/24
RTA(config)#
RTA(config)#interface Serial0/1/0
RTA(config-if)#ip address 192.168.10.1255.255.255.0
RTA(config-if)#no shut
RTA(config-if)#
%LINK-5-CHANGED: Interface Serial0/1/0,changed state to up
%LINEPROTO-5-UPDOWN: Line protocol onInterface Serial0/1/0, changed state to up
RTA(config-if)#exit
2路由器RTB的串行口S0的IP地址192.168.10.2/24
Router#
Router #conf t
Enter configuration commands, one perline. End with CNTL/Z.
Router (config)#hostname RTB
RTB(config)#
RTB#
RTB#configure t
Enter configuration commands, one perline. End with CNTL/Z.
RTB(config)#inter s0/1/0
RTB(config-if)#ip address 192.168.10.2255.255.255.0
RTB(config-if)# no shut
RTB(config-if)#
%LINK-5-CHANGED: Interface Serial0/1/0,changed state to up
%LINEPROTO-5-UPDOWN: Line protocol onInterface Serial0/1/0, changed state to up
2、设置DCE的时钟频率为64000b/s;
RTA(config)#interface Serial0/1/0
RTA(config-if)#clock rate 64000
RTA(config-if)#
RTB(config)#interface Serial0/1/0
RTB(config-if)#clock rate 64000
RTB(config-if)#
3、验证配置,正确后保存到NVRAM中。
RTB的配置
RTB#show runn
Building configuration...
Current configuration : 559 byt
interface FastEthernet0/0
noip address
duplexauto
speed auto
shutdown
!
interface FastEthernet0/1
noip address
duplex auto
speed auto
shutdown
!
interface Serial0/1/0
ipaddress 192.168.10.2 255.255.255.0
!
interface Serial0/1/1
noip address
shutdown
!
interface Vlan1
noip address
shutdown
!
ip classless
!
配置视图:
小结:由于本实验一开始使用的路由器型号是1841,原始背板后的插槽中没有增加串口模块,需要手动添加,添加模块时,路由器的电源必须关闭!本实验添加的模块是:WIC-2T