免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2569 | 回复: 17

CISCO路由器配置手册 [复制链接]

论坛徽章:
0
发表于 2005-01-19 21:38 |显示全部楼层
资料推进!

论坛徽章:
0
发表于 2005-01-19 21:45 |显示全部楼层

CISCO路由器配置手册

来自http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/001.htm
一、基本设置方式

一般来说,可以用5种方式来设置路由器:



1.Console口接终端或运行终端仿真软件的微机;

2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;

3.通过Ethernet上的TFTP服务器;

4.通过Ethernet上的TELNET程序;

5.通过Ethernet上的SNMP网管工作站。   

但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下:

波特率 :9600

数据位 :8

停止位 :1

奇偶校验: 无
manual1_1_1.gif

论坛徽章:
0
发表于 2005-01-19 21:48 |显示全部楼层

CISCO路由器配置手册

来自www.linkwan.com
二、命令状态

1.     router>;

路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。

2.     router#

在router>;提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。

3.     router(config)#

在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。

4.     router(config-if)#; router(config-line)#; router(config-router)#;…

路由器处于局部设置状态,这时可以设置路由器某个局部的参数。

5.     >;

路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。

6.     设置对话状态

这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。

论坛徽章:
0
发表于 2005-01-19 21:49 |显示全部楼层

CISCO路由器配置手册

来自www.linkwan.com

三、设置对话过程

显示提示信息

全局参数的设置

接口参数的设置

显示结果

利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。

进入设置对话过程后,路由器首先会显示一些提示信息:

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.

Use ctrl-c to abort configuration dialog at any prompt.

Default settings are in square brackets '[]'.

这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。然后路由器会问是否进入设置对话:

Would you like to enter the initial configuration dialog? [yes]:

如果按y或回车,路由器就会进入设置对话过程。首先你可以看到各端口当前的状况:

First, would you like to see the current interface summary? [yes]:

Any interface listed with OK? value "NO" does not have a valid configuration

Interface
IP-Address
OK?
Method
Status
Protocol

Ethernet0
unassigned
NO
unset
up
up

Serial0
unassigned
NO
unset
up
up

………
………

……




然后,路由器就开始全局参数的设置:

Configuring global parameters:

1.设置路由器名:

Enter host name [Router]:

2.设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示:

The enable secret is a one-way cryptographic secret used

instead of the enable password when it exists.

Enter enable secret: cisco

3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示:

The enable password is used when there is no enable secret

and when using older software and some boot images.

Enter enable password: pass

4.设置虚拟终端访问时的密码:

Enter virtual terminal password: cisco

5.询问是否要设置路由器支持的各种网络协议:

Configure SNMP Network Management? [yes]:

Configure DECnet? [no]:

Configure AppleTalk? [no]:

Configure IPX? [no]:

Configure IP? [yes]:

Configure IGRP routing? [yes]:

Configure RIP routing? [no]:

………

6.如果配置的是拨号访问服务器,系统还会设置异步口的参数:

  Configure Async lines? [yes]:

1)     设置线路的最高速度:

Async line speed [9600]:

2)     是否使用硬件流控:

Configure for HW flow control? [yes]:

3)     是否设置modem:

  Configure for modems? [yes/no]: yes

4)     是否使用默认的modem命令:

    Configure for default chat script? [yes]:

5)     是否设置异步口的PPP参数:

  Configure for Dial-in IP SLIP/PPP access? [no]: yes

6)     是否使用动态IP地址:

  Configure for Dynamic IP addresses? [yes]:

7)     是否使用缺省IP地址:

  Configure Default IP addresses? [no]: yes

     是否使用TCP头压缩:

   Configure for TCP Header Compression? [yes]:

9)     是否在异步口上使用路由表更新:

    Configure for routing updates on async links? [no]: y

10)               是否设置异步口上的其它协议。

接下来,系统会对每个接口进行参数的设置。

1.Configuring interface Ethernet0:

1)     是否使用此接口:

  Is this interface in use? [yes]:

2)     是否设置此接口的IP参数:

Configure IP on this interface? [yes]:

3)     设置接口的IP地址:

      IP address for this interface: 192.168.162.2

4)     设置接口的IP子网掩码:

   Number of bits in subnet field [0]:

Class C network is 192.168.162.0, 0 subnet bits; mask is /24

在设置完所有接口的参数后,系统会把整个设置对话过程的结果显示出来:

The following configuration command script was created:

hostname Router

enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1

enable password pass

…………

请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。

显示结束后,系统会问是否使用这个设置:

Use this configuration? [yes/no]: yes

如果回答yes,系统就会把设置的结果存入路由器的NVRAM中,然后结束设置对话过程,使路由器开始正常的工作。

论坛徽章:
0
发表于 2005-01-19 22:12 |显示全部楼层

CISCO路由器配置手册

五、配置IP寻址

1.        IP地址分类

IP地址分为网络地址和主机地址二个部分,A类地址前8位为网络地址,后24位为主机地址,B类地址16位为网络地址,后16位为主机地址,C类地址前24位为网络地址,后8位为主机地址,网络地址范围如下表所示:

种类
网络地址范围

A
1.0.0.0 到126.0.0.0有效

0.0.0.0 和127.0.0.0保留

B
128.1.0.0到191.254.0.0有效

128.0.0.0和191.255.0.0保留

C
192.0.1.0 到223.255.254.0有效

192.0.0.0和223.255.255.0保留

D
224.0.0.0到239.255.255.255用于多点广播

E
240.0.0.0到255.255.255.254保留

255.255.255.255用于广播


2.        分配接口IP地址

任务
命令

接口设置
interface type slot/number

为接口设置IP地址
  ip address ip-address  mask


掩玛(mask)用于识别IP地址中的网络地址位数,IP地址(ip-address)和掩码(mask)相与即得到网络地址。

3.        使用可变长的子网掩码

通过使用可变长的子网掩码可以让位于不同接口的同一网络编号的网络使用不同的掩码,这样可以节省IP地址,充分利用有效的IP地址空间。

如下图所示:
manual1_5_1.gif

论坛徽章:
0
发表于 2005-01-19 22:13 |显示全部楼层

CISCO路由器配置手册

Router1和Router2的E0端口均使用了C类地址192.1.0.0作为网络地址,Router1的E0的网络地址为192.1.0.128,掩码为255.255.255.192, Router2的E0的网络地址为192.1.0.64,掩码为255.255.255.192,这样就将一个C类网络地址分配给了二个网,既划分了二个子网,起到了节约地址的作用。

4.        使用网络地址翻译(NAT)

NAT(Network Address Translation)起到将内部私有地址翻译成外部合法的全局地址的功能,它使得不具有合法IP地址的用户可以通过NAT访问到外部Internet.

当建立内部网的时候,建议使用以下地址组用于主机,这些地址是由Network Working Group(RFC 191保留用于私有网络地址分配的.

l          Class A:10.1.1.1 to 10.254.254.254

l          Class B:172.16.1.1 to 172.31.254.254

l          Class C:192.168.1.1 to 192.168.254.254

命令描述如下:

任务
命令

定义一个标准访问列表
access-list access-list-number permit source                                            [source-wildcard]

定义一个全局地址池
ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}

    [type rotary]

建立动态地址翻译
ip nat inside source {list {access-list-number | name} pool name [overload] | static local-ip

global-ip}

指定内部和外部端口
ip nat {inside | outside}


如下图所示,
manual1_5_2.gif

论坛徽章:
0
发表于 2005-01-19 22:14 |显示全部楼层

CISCO路由器配置手册

路由器的Ethernet 0端口为inside端口,即此端口连接内部网络,并且此端口所连接的网络应该被翻译,Serial 0端口为outside端口,其拥有合法IP地址(由NIC或服务提供商所分配的合法的IP地址),来自网络10.1.1.0/24的主机将从IP地址池c2501中选择一个地址作为自己的合法地址,经由Serial 0口访问Internet。命令ip nat inside source list 2 pool c2501 overload中的参数overload,将允许多个内部地址使用相同的全局地址(一个合法IP地址,它是由NIC或服务提供商所分配的地址)。命令ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定义了全局地址的范围。   

设置如下:

ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192

interface Ethernet 0

ip address 10.1.1.1 255.255.255.0

ip nat inside

!

interface Serial 0

ip address 202.200.10.5 255.255.255.252

ip nat outside

!

ip route 0.0.0.0 0.0.0.0 Serial 0

access-list 2 permit 10.0.0.0 0.0.0.255

! Dynamic NAT

!

ip nat inside source list 2 pool c2501 overload

line console 0

exec-timeout 0 0

!

line vty 0 4

end

论坛徽章:
0
发表于 2005-01-19 22:18 |显示全部楼层

CISCO路由器配置手册

六、配置静态路由

通过配置静态路由,用户可以人为地指定对某一网络访问时所要经过的路径,在网络结构比较简单,且一般到达某一网络所经过的路径唯一的情况下采用静态路由。

任务
命令

建立静态路由
ip route prefix mask {address | interface} [distance] [tag tag] [permanent]


Prefix                   :所要到达的目的网络

mask                  :子网掩码

address               :下一个跳的IP地址,即相邻路由器的端口地址。

interface             :本地网络接口

distance               :管理距离(可选)

tag tag                 :tag值(可选)

permanent          :指定此路由即使该端口关掉也不被移掉。

  
[img][/img]

以下在Router1上设置了访问192.1.0.64/26这个网下一跳地址为192.200.10.6,即当有目的地址属于192.1.0.64/26的网络范围的数据报,应将其路由到地址为192.200.10.6的相邻路由器。在Router3上设置了访问192.1.0.128/26及192.200.10.4/30这二个网下一跳地址为192.1.0.65。由于在Router1上端口Serial 0地址为192.200.10.5,192.200.10.4/30这个网属于直连的网,已经存在访问192.200.10.4/30的路径,所以不需要在Router1上添加静态路由。

Router1:

ip route 192.1.0.64 255.255.255.192 192.200.10.6  

Router3:

ip route 192.1.0.128 255.255.255.192 192.1.0.65

ip route 192.200.10.4 255.255.255.252 192.1.0.65  

同时由于路由器Router3除了与路由器Router2相连外,不再与其他路由器相连,所以也可以为它赋予一条默认路由以代替以上的二条静态路由,

ip route 0.0.0.0 0.0.0.0 192.1.0.65

即只要没有在路由表里找到去特定目的地址的路径,则数据均被路由到地址为192.1.0.65的相邻路由器。
manual1_6_1.gif

论坛徽章:
0
发表于 2005-01-19 22:24 |显示全部楼层

CISCO路由器配置手册

累了。。。
还是给出网址好了
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/007.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/008.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/009.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0010.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0011.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0012.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0013.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0015.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0016.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0017.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0018.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0019.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0020.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0021.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0022.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0023.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0024.htm

论坛徽章:
0
发表于 2005-01-19 22:49 |显示全部楼层

CISCO路由器配置手册

补充
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/0014.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/001.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/002.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/003.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/005.htm
http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/006.htm
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP