.路由的基本配置<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

实验目的:

 

熟悉路由的基本操作

路由的三种模式

为路由定义名称

为路由添加特权密码

启用控制台密码

telnet访问启用密码和添加一个启用用户名密码

配置路由使控制台端口终止你的连接

配置路由使你的路由发送的控制台屏幕消息不会添加到你的命令行中

配置路由使你登陆控制台是显示的信息

配置接口IP

查看配置文件

 

以上的配置可分为

1.  路由器模式概述

2.  登陆路由器的必要配置

3.  路由的基本配置

4.  查看路由器的信息

5.  设置口令

6.  取消密码

7.  为接口设置IP

 

路由模式概述:

Router>          用户模式  通常查看统计信息,但是不能修改路由器的设置

Router>enable

Router#          特权模式 可以查看并修改路由器配置文件 通常用show命令

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#     配置模式 也叫全局模式 在这里修改当前运行配置文件的内容

Router(config-if)#   接口模式 用来配置路由器的物理接口和环回接口

Router(config)#interface serial1/0.1

Router(config-subif)#exit

Router(config)#interface serial 1/1

Router(config-if)#exit

Router(config)#interface serial 1/0.2

Router(config-subif)#     子接口模式 用来配置路由中创建的逻辑接口

Router(config)#line console 0

Router(config-line)#   控制台接口模式 用来配置登陆控制台是的用户名和密码.控制台超时时间等等

Router(config-router)#  路由协议接口模式  用来配置路由协议. RIP EIGRP IGRP

 

 

路由的必要配置:

Router>

Router>enable

Router#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#no ip domain lookup    关闭动态的域名解析

Router(config)#line console 0

Router(config-line)#exec-timeout 0 0    设置链路超时时间为0

Router(config-line)#logging synchronous  关闭日志同步 阻止控制台一些提示信息

Router(config-line)#exit

Router(config)#

 

 

路由的基本配置

Router(config)#hostname R1   给路由命名

R1(config)#banner motd #     设置一个登陆标语  登陆到路由是显示

Enter TEXT message.  End with the character '#'.

Welcome to the world of CISCO #

R1(config)#banner exec !     设置执行标语区  Telnet登陆路由时显示的标语

Enter TEXT message.  End with the character '!'.

Welcome to 7200 CISCO !

R1(config)#exit

R1#clock set 15:10:25 25 February 2007   设置时间 

 

 

查看路由的信息

R1#show clock                   查看时钟

R1#show history                  查看路由器最近输入的命令

R1#terminal history size 25          将历史记录大小改为25

R1#show version                  查看路由器版本信息

R1#show session                  显示会话记录  经常在终端上使用

R1r#show startup-config            显示下次路由器重新加载时将要使用的配置

R1#show running-config            查看当前配置信息

R1r#copy running-config startup-config    保存当前的配置作为启动时的配置

R1r#write                            保存当前的配置作为启动时的配置

R1r#erase startup-config              清除当前保存的配置

R1#show ip interface brief            查看路由各个端口状态

 

 

设置口令

R1#conf t

R1(config)#enable password cisco    设置进入特权模式的密码 明文

R1(config)#enable secret cisco        设置进去特权模式的密码  密文  >明文

R1(config)#line console 0

                   ^

 

R1(config-line)#password cisco     设置登陆路由器的密码  出现在进入用户模式前

R1(config-line)#login             启用登陆

R1(config-line)#exit

R1(config)#line vty 0 4           telnet访问路由器设置5条线路 0-4

R1(config-line)#password cisco

R1(config-line)#login

R1(config)#line aux 0  

R1(config-line)#password cisco     设置辅助端口密码

R1(config-line)#login

R1(config)#service password-encryption     加密所有口令

 

 

 

取消密码

 

R1(config)#no enable password

R1(config)#no enable secret

R1(config)#line console 0

R1(config-line)#no pass

R1(config-line)#no password

R1(config-line)#no login

R1(config-line)#exit

R1(config)#line vty 0 4

R1(config-line)#no password

R1(config-line)#no login

R1(config-line)#exit

R1(config)#line aux 0

R1(config-line)#no password

R1(config-line)#no login

R1(config-line)#exit

 

 

为接口设置IP

 

R1(config)#interface serial1/0         进入串口1/0

R1(config)#interface bri0             进入ISDN接口

R1(config)#interface serial1/0.1        进入子接口

R1(config)#interface loopback0        进入环回接口