编号:300202-02-02
Cisco 路由器基本配置
一. 实验原理
1.1 cisco路由器基础
路由器是工作在IP协议网络层实现子网之间转发数据的设备。路由器内部可以划分为控制平面和数据通道。在控制平面上,路由协议可以有不同的类型。路由器通过路由协议交换网络的拓扑结构信息,依照拓扑结构动态生成路由表。在数据通道上,转发引擎从输入线路接收IP包后,分析与修改包头,使用转发表查找输出端口,把数据交换到输出线路上。转发表是根据路由表生成的,其表项和路由表项有直接对应关系,但转发表的格式和路由表的格式不同,它更适合实现快速查找。转发的主要流程包括线路输入、包头分析、数据存储、包头修改和线路输出
1.2 cisco路由器配置方式
cisco路由器的配置方式很多,如本地Console 口配置,Telnet 远程登陆配置,FTP、TFTP 配置和终端方式配置。其中最为常用的配置方式就是Console 口配置和Telnet 远程配置。我们这里用利用电脑超级终端与交换机建立连接
二. 实验内容:
     路由器的配置方法
三. 实验目的:
    掌握路由器的基本配置命令
四. 实验环境:
编号 300202-02-02
设备名称 计数 说明
PC 2 
路由器 2 
串口线 1 
Console线 2 
 

五.实验拓扑
六. 实验步骤:
第一步:根据给出的拓扑图,搭建实际结构。
第二步:打开超级终端。。
第三步:设置终端参数。
参数要求:
设置波特率为9600,数据位为8,奇偶校验为无,停止位为1,流量控制为无
第三步:在路由器1的上配置
进入特权模式:
switch>enable
进入全局模式:
switch#configure terminal
更改主机名:
Router(config)#ho RT1
配置enable口令:
RT1(config)#enable password cisco
配置console口令:
RT1(config)#line console 0
RT1(config-line)#password wnt
配置telnet口令:
RT1(config)#line vty 0 4
RT1(config-line)#login
RT1(config-line)#password wnt123

查看效果
RT1#sh run
Building configuration...
!
no service password-encryption
!
hostname RT1
!
enable password cisco
!
line con 0
 exec-timeout 0 0
 password wnt
 logging synchronous
line aux 0
line vty 0 4
 password wnt123
 login
将所以口令均以加密方式存储在配置文件中
RT1(config)#service password-encryption
再查看效果:
RT1#sh run
Building configuration...
!
service password-encryption
!
hostname RT1
!
enable password 7 060506324F41
line con 0
 exec-timeout 0 0
 password 7 14001C1F
 logging synchronous
line aux 0
line vty 0 4
 password 7 15050518557878
 login
在s0口上配置IP地址
RT1(config)#int s0
RT1(config-if)#ip add 10.0.0.1 255.255.255.0
查看s0口的IP地址
RT1#show running-config interface serial 0/0
interface Serial0/0
 ip address 10.0.0.1 255.255.255.0
第四步:在路由器2上配置
更改主机名:
Router(config)#ho RT2
在s0口上配置IP地址
RT2(config)#int s0
RT2(config-if)#ip add 10.0.0.2 255.255.255.0
查看S0口的IP地址:
RT2#show running-config interface s0
interface Serial0/0
 ip address 10.0.0.2 255.255.255.0
第五步:查看接口状态
RT1#show ip interface brief
Interface             IP-Address       OK? Method Status                Protocol
Serial0                10.0.0.1        YES manual up                    up   
RT2#show ip interface brief
Interface             IP-Address       OK? Method Status                Protocol
Serial0                10.0.0.2        YES manual up                    up   
或者
RT1#show  interface
Serial0/0 is up, line protocol is up
RT2#show  interface
Serial0/0 is up, line protocol is up
注意:DCE与DTE的不同配置
这里查看一下接口时DCE还是DTE
RT1# show controllers serial 0
如果是DCE  在这个接口下配置时钟
clock rate 64000
DTE 不需要配置
还有注意的是接口的启用 no shutdown