CISCO2600路由器入门1

一、 路由器简介
路由器是网络中进行网间连接的关键设备。作为不同网络之间互相连接的枢纽,路由器系统构成了基于 TCP/IP 的国际互连网络 Internet 的主体脉络,也可以说,路由器构成了 Internet 的骨架。路由器有两大典型功能,即数据通道功能和控制功能。数据通道功能包括转发决定、背板转发以及输出链路调度等,一般由特定的硬件来完成;控制功能一 般用软件来实现,包括与相邻路由器之间的信息交换、系统配置、系统管理等。 路由器之所以在互连网络中处于关键地位,是因为它处于网络层,一方面能够跨越不同的物理网络类型(DDN、FDDI、以太网等等),另一方面在逻辑上将整 个互连网络分割成逻辑上独立的网络单位,使网络具有一定的逻辑结构。 
怎样区分不同的网络连接设备 
不同的连接设备在网络中有不同的作用,原因在于它们处于OSI参考协议的不同功能层次。对于网络规划者来说,只有通过所处层次来正确区分网络连接设备,才能进行正确的设备选择。按照功能层次,网络连接设备可分为四类: 
1. 物理层:中继器(Repeater)和集线器(Hub)。用于连接物理特性相同的网段,这些网段,只是位置不同而已。Hub 的端口没有物理和逻辑地址。 
2. 逻辑链路层:网桥(Bridge)和交换机(Switch)。用于连接同一逻辑网络中、物理层规范不同的网段,这些网段的拓扑结构和其上的数据帧格式,都可以不同。Bridge 和 Switch 的端口具有物理地址,但没有逻辑地址。 
3. 网络层:路由器(Router)。用于连接不同的逻辑网络。Router 的每一个端口都有唯一的物理地址和逻辑地址。 
4. 应用层:网关(Gateway)。用于互连网络上,使用不同协议的应用程序之间的数据通信,目前尚无硬件产品。如 SMTP/X.400 电子邮件网关。 
二、 示例
路由器的配置过程:
1. 配置enable密码
2. 配置以太网口的地址
3. 配置广域网口的地址
4. 配置路由
2610的一个配置示例:
A. 使用超级终端
   1.用Cisco专用配置电缆(RJ45)一端连接路由器CONSOLE端口,另一端通过RJ45/9针或RJ45/25针的转换头连接计算机串口(一般为COM1/COM2)。
   2.使用超级终端打开或者新建一个连接。选择实际连接的串口。设置串口属性:波特率(9600),数据位(8),奇偶校验(无),停止位(1),流控制(硬件)。进入超级终端窗口。
   3.路由器加电启动。
   4.在超级终端窗口对路由器进行配置。
   5.配置完毕后,可通过show等命令察看路由器的各种状态,对有错误的配置进行修改。认为配置完全正确后,在特权EXEC模式下,通过copy running-config startup-config或write(IOS11.0以上版本)保存路由器的当前配置到NVRAM中,这样下一次路由器重新启动时就会自动调用这个 配置。
     6.退出到用户EXEC模式。
     7.退出超级终端,选择“保存”则下一次使用就可以直接打开;选择“不保存”则下一次使用必须新建。
B. 1.配置路由器
2610开机启动:
       System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC:Home:SW:IOS:Specials for info
C2600 platform with 32768 Kbytes of main memory
program load complete, entry point: 0x80008000, size: 0x34362c
Self decompressing the image : #################################################
########################################################################################################################################################################################################################################################## [OK]
               Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706

Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.0(10), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 20-Mar-00 23:30 by phanguye
Image text-base: 0x80008088, data-base: 0x80600628
cisco 2610 (MPC860) processor (revision 0x203) with 26624K/6144K bytes of memory
.
Processor board ID JAD05030SLO (1049648032)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)                   (一个以太网口)  
4 Serial(sync/async) network interface(s)             (4个高速同步/异步串口)
8 Low-speed serial(sync/async) network interface(s)     (8个低速同步/异步串口)
(以上为系统检测到的模块)
32K bytes of non-volatile configuration memory.             (NVRAM为32K)
8192K bytes of processor board System flash (Read/Write)     (闪存8M)

         --- System Configuration Dialog ---   
Would you like to enter the initial configuration dialog? [yes/no]:y
(使用对话方式配置,第一次启动路由器的时候会提示。以后可以用SETUP命令进入这种方式)
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 '[]'.
Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system
Would you like to enter basic management setup? [yes/no]: y     (进行基本配置,方括号中的值一般为上次设置的值,不想更改可以直接回车跳过。)
Configuring global parameters:
   Enter host name [Router]:   router             (设置路由器的名字为router)
   The enable secret is a password used to protect access to
   privileged EXEC and configuration modes. This password, after
   entered, becomes encrypted in the configuration.
   Enter enable secret:   zxc10         (secret密码,为最高权限)
   The enable password is used when you do not specify an
   enable secret password, with some older software versions, and
   some boot images.
   Enter enable password: tiger         (enable密码,只有不设置secret密码时才有效)
   The virtual terminal password is used to protect
   access to the router over a network interface.
   Enter virtual terminal password: tiger   (远程登录密码)
   Configure SNMP Network Management? [yes]: y   (配置简单网络管理协议) 
     Community string [public]:
Current interface summary
(可以从下面显示的清单中来核实接口的编号情况)
Any interface listed with OK? value "NO" does not have a valid configuration
Interface               IP-Address       OK? Method Status                 Protocol
Ethernet0/0             unassigned       NO   unset   up                     up
Serial0/0               unassigned       NO   unset   down                   down
Serial0/1               unassigned       NO   unset   down                   down
Serial0/2               unassigned       NO   unset   down                   down
Serial0/3               unassigned       NO   unset   down                   down
Serial1/0               unassigned       NO   unset   down                   down
Serial1/1               unassigned       NO   unset   down                   down
Serial1/2               unassigned       NO   unset   down                   down
Serial1/3               unassigned       NO   unset   down                   down
Serial1/4               unassigned       NO   unset   down                   down
Serial1/5               unassigned       NO   unset   down                   down
Serial1/6               unassigned       NO   unset   down                   down
Serial1/7               unassigned       NO   unset   down                   down

Enter interface name used to connect to the
management network from the above interface summary: ethernet0/0
Configuring interface Ethernet0/0:
   Configure IP on this interface? [yes]:y
     IP address for this interface: 192.160.1.100       (配置以太网口IP)
     Subnet mask for this interface [255.255.255.0] :   (配置以太网子网掩码)
     Class C network is 192.160.1.0, 24 subnet bits; mask is /24
The following configuration command script was created:
hostname Router
enable secret 5 $1$QPCW$NpRZ6qTNDNToGHWpNDFHs/
enable password tiger
line vty 0 4
password tiger
snmp-server community public
!
no ip routing
!
interface Ethernet0/0                 (以太网口的编号是0/0)
no shutdown
ip address 192.160.1.100 255.255.255.0
!
interface Serial0/0                   (高速同步/异步串口的编号0/0~3)
shutdown
no ip address
!
interface Serial0/1
shutdown
no ip address
!
interface Serial0/2
shutdown
no ip address
!
interface Serial0/3
shutdown
no ip address
!
interface Serial1/0                   (低速同步/异步串口的编号,1/0~7)
shutdown
no ip address
!
interface Serial1/1
shutdown
no ip address
!
interface Serial1/2
shutdown
no ip address
!
interface Serial1/3
shutdown
no ip address
!
interface Serial1/4
shutdown
no ip address
!
interface Serial1/5
shutdown
no ip address
!
interface Serial1/6
shutdown
no ip address
!
interface Serial1/7
shutdown
no ip address
!
end

[0] Go to the IOS command prompt without saving this config.(不保存直接回到命令行)
[1] Return back to the setup without saving this config.(不保存重新回到对话配置开头)
[2] Save this configuration to nvram and exit.(保存配置并推出到用户EXEC模式)
Enter your selection [2]:2   (注意:在保存之前,先检查secret密码是否正确,密码丢失的恢复比较麻烦。选择2后生成startup-config 和running-config并且重新启动,从NVRAM读取startup-config文件里的配置信息)
以上的部分主要配置了主机名、使能密码和以太网的端口地址,也可以只用命令行方式就可以完成,在Dialog方式时按下Ctrl+z即可到命令行方式,之前的配置路由器并不保存。替代的命令行如下:(斜体字部分)
Router> enable
Router#                 (初次配置并没有设置enable密码)
Router#config term         进入全局模式
     Router(config)#hostname   router   配置主机名
     Router(config)#enable secret time   配置使能密码
     Router(config)#interface ethernet0/0   进入接口配置方式
     Router(config-if)# ip address 192.160.1.100 255.255.255.0   配置以太网的IP 地址
     Router(config-if)#exit
     Router(config)#exit
     Router#write
******************************************************
接上面的配置:(主要完成广域网端口配置和路由的配置)
Router>               用户EXEC模式
Router>enable           进入特权EXEC模式        
Password:
Router#        
Router#config term         进入全局模式
Enter configuration commands, one per line.   End with CNTL/Z.
Router(config)#interface serial0/0     进入接口模式
Router(config-if)#ip address 10.10.11.1 255.255.255.252   配置广域网口IP
Router(config-if)#no shutdown         激活端口
Router(config-if)#exit               退出接口模式
Router(config)#
     Router(config)#ip routing             启动路由功能
Router(config)#router rip       设置RIP(选路信息协议Routing Information Protocol)
Router(config-router)#network 192.160.1.0   设置要广播路由的网络
Router(config-router)#network 10.0.0.0      
Router(config-router)#exit           退出RIP设置
Router(config)#exit     
Router# sh   ru     即命令show running-config,显示running-config配置情况
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption                 
!
hostname r_pomc
!
enable secret 5 $1$YqSH$IZQPde.1pdCdspJFVjgPN.       secret密码
enable password tiger                                 enable密码
ip subnet-zero
!
!
!
interface Ethernet0/0
ip address 192.160.1.100 255.255.255.0
no ip directed-broadcast
!
interface Serial0/0
ip address 10.10.11.1 255.255.255.252
no ip directed-broadcast
no ip mroute-cache
!
interface Serial0/1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0/2
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0/3
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/2
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/3
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/4
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/5
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/6
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1/7
no ip address
no ip directed-broadcast
shutdown
!
router rip
network 10.0.0.0
network 192.160.1.0
!
ip classless
!
snmp-server community public RO
!
line con 0                        
transport input none
line aux 0
line vty 0 4
password tiger
login
!
end
        
Router#write     确认设置正确后,保存配置到NVRAM即写入startup-config文件  

Building configuration...
[OK]
Router#
Router#ping 215.152.1.100         测试与另一个网络的通路状态
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 215.152.1.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/17/21 ms
Router#
Router#exit     退出特权EXEC模式,路由器配置完成。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值