一•CISCO路由器简介
1.1 统一采用IOS操作系统,操作具有一致性。
1.2 CISCO IOS操作环境。
ROM monitor Failure of passWord recovery
BootROM router(boot) Flash image upgrade
Cisco IOS router Normal operation
1.3 Command Modes命令模式。
User EXEC Router user Access
Privileged EXEC Router# System adminstration
Configuration mode Router(config)# Modify configuration
Setup Prompted dialog Create the initial
configuration
二 配置前的预备工作
2.1 用终端或仿真终端接入CONSOLE口 。
终端或仿真终端配置信息如下:
9600 baud 8 data bits no parity 2 stop bits (9600,8/N/2)
2.2 用TELNET命令在网上进行设置。
系统治理员可在网上用telnet address命令进行远程配置。
三 配置方法
3.1 Auto install
3.2 setup
3.3 config 命令行设置-
四 配置IP地址
4. 1采用 (3.1 /3.2) 方法进行配置。
4.2 config命令行方式进行设置
4.2.1 首先启动ROUTER 进入router 模式。
键入Enable 进入router # 模式
然后键入config 进入router(config)# 模式
4.2.2 选择要配置的路由器端口
Router(config) # interface端口号
进入端口设置状态 Router(config-if)
此时用命令IP address
设定路由器端口IP地址
五 配置ip路由协议 (RIP ,OSPF ,BGP ,STATICS)
在globle模式下配置 例图见附图。
5. 1静态路由
IP route 目的网络地址 子网掩码 端口号
例:在RA1上配RA2的路由
IP route 10.0.210.4 255.255.255.252 E0
5.2 RIP2设置
以路器A1为例进行如下设置
router rip ;enable rip
version 2 ;选择版本2
network 10.86.16.0 ;相关子网地址
network 10.85.1.4
network 10.85.1.8
5.3 OSPF设置
以路由器D为例进行如下配置
router ospf 200 ;enable ospf 进程号为200
redistribute bgp 200 subnets ;
network 10.0.210.4 0.0.0.3 area 1 ; 相关子网地址及区域号
network 10.185.1.16 0.0.0.3 area 1
5.4 BGP设置
以路由器A2和D为例
A2:
router bgp 100 ;enable bgp 设置自治域号
network 10.0.210.4 mask 255.255.255.252 ;相关子网地址及子
网掩码
network 10.80.0.0 mask 255.240.0.0 ; 这些地址由bgp发到邻
居路由器
redistribute rip
neighbor 10.0.210.6 remote-as 200 ;设置远程相连自治域边
界路由器端口
D2:
router bgp 200
network 10.0.210.4 mask 255.255.255.252
network 10.0.32.0 mask 255.255.240.0
network 10.185.1.16 mask 255.255.255.252
network 10.0.1.0 mask 255.255.255.252
neighbor 10.0.210.5 remote-as 100
六 radius认证的设置
6.1 radius的简述
RADIUS的全称为(Remote Access Dail-In User Service),它是对远程拨号用户访问进行认证的一种协议。主要进行Authentication Authorization Accounting (AAA) 三方面的工作。
6.2 radius的配置
具体配置如下:
aaa new-mode ;enable radius
radius-server host ;指明radius server在网
上的地址
radius-server key ;建立一个网上传输密
aaa authentication login default radius local ;进行login认证,若radius
server未找到从本地数据库内查找
aaa authentication ppp default radius local
aaa authorization network radius local ;授权检测
aaa accounting network start-stop radius ;计帐检测
七 路由器软件升级方法
7.1 改变操作环境
在global config mode设置: config -reg 0x2101
reload 进入Boot Rom 模式:router(boot)
7.2 运行tFTP server
在网上运行tftp server,使升级文件可以传输。
7.3 升级版本
命令如下:
copy tftp flash ;将tftp server上的文件传入路由器的flash memoy中
copy flash tftp ; j将flash中的文件备份到tftp server中
八 配置路由器的一些注重事项
8.1拨号用户的配置。
cisco 2509/2511的异步串行通讯口在配置modem时,modem需设置成自动应答方式。具体方法如下:
用超级终端进入modem AT 命令方式,键入ats0=1 设置自动应答方式,然后键入at&w 将设置写入寄存器。
8.2 RIP & BGP的设置
当一个运行RIP路由协议的子网,做为一个自治域,用BGP协议接入另一
自治域时。此子网内所有路由器需添加参数: ip classless 。同时在
与边界路由器直接相连的路由器上需添加一个缺省网关。
设置如下:
ip 0.0.0.0 0.0.0.0 边界路由器地址。
8.3 v.35电缆直连的设置
在相关的端口上设置时钟速率:clock rate .
8.4 loopback端口的设置
loopback端口是一个虚拟端口,端口状态始终处于UP。通过它可以使由BGP相连的AS之间始终保持连系,不会由于边界路由器端口状态的改变而发生变化。其具体配置如下:
interface loopback
九常用的路由器命令 (见附录)
十 问与答
10.1如何检测网络是否通畅?
A:在网络主机上采用命令ping 来逐端检测网端。
10.2如何查看路由器配置信息?
A:在EXEC模式下用show config命令。
10.3如何查看路由器路由信息?
A:在EXEC模式下用show ip route 命令。
10.4如何查看路由器端口信息?
A:在EXEX模式下用show int 命令。
10.5为什么端口协议已经配置,状态仍然是down?
A:在CONFIG模式下,选择该端口,执行no shutdwon命令。
10.6 config模式有几种状态,对应那些操作?
A:config模式有以下几种状态:
• globle config 全局配置操作 exec模式键入config t
• interface config 端口配置操作 config模式键入int
• line config 线路配置操作 config模式键入line
• router config 路由配置操作 config模式键入router
协议
十一网络实验简介
本实验模拟广东视聆通网络情况。将网络划分为AS 100和AS 200 .AS 100内动态路由协议采用RIP,AS 200内采用OSPF。两个自治域间采用BGP协议互连。该实验主要测试目的在于,测试一个采用RIP协议的网络能否划分自治域,并与其它自治域相连。
测试环境网络图见附图:
各点配置如下:
路由器A2配置:
hostname a2
!
enable secret 5 $1$kJyk$CfMLfg87wovmbVp5lHUfk/
enable password cisco
!
!
interface Loopback0
ip address 10.0.2.1 255.255.255.252
!
interface Ethernet0
ip address 10.86.16.2 255.255.240.0
ip rip send version 2
ip rip receive version 2
!
interface Ethernet1
ip address 10.0.210.5 255.255.255.252
ip rip send version 2
ip rip receive version 2
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
router rip
version 2
redistribute bgp 100
network 10.0.0.0
!
router bgp 100
network 10.0.210.4 mask 255.255.255.252
network 10.80.0.0 mask 255.240.0.0
redistribute rip
neighbor 10.0.210.6 remote-as 200
!
ip classless
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
路由器D的配置:
d#sh conf
Using 1069 out of 32762 bytes
!
version 11.0
service udp-small-servers
service tcp-small-servers
!
hostname d
!
enable secret 5 $1$EBoX$3AWqea9PpP9xTgr49gqLy.
enable password cisco
!
!
interface Loopback0
description Loopback Interface of Router
ip address 10.0.1.1 255.255.255.252
no ip mroute-cache
!
interface Ethernet0
description Core Region Router in Guangzhou
ip address 10.0.210.6 255.255.255.252
no ip mroute-cache
!
interface Serial0
ip address 10.185.1.17 255.255.255.252
no ip mroute-cache
ip ospf network broadcast
clockrate 9600
!
interface Serial1
no ip address
no ip mroute-cache
ip ospf network broadcast
shutdown
!
router ospf 200
redistribute bgp 200 subnets
network 10.0.210.4 0.0.0.3 area 1
network 10.185.1.16 0.0.0.3 area 1
!
router bgp 200
network 10.0.210.4 mask 255.255.255.252
network 10.0.32.0 mask 255.255.240.0
network 10.185.1.16 mask 255.255.255.252
network 10.0.1.0 mask 255.255.255.252
neighbor 10.0.210.5 remote-as 100
!
ip classless
ip ospf name-lookup
!
line con 0
line aux 0
transport input all
line vty 0 4
password cisco
login
!
end
路由器B的配置:
b#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route
Gateway of last resort is 10.85.1.5 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
R 10.0.2.0/30 [120/2] via 10.85.1.5, 00:00:25, Serial0
C 10.88.16.0/20 is directly connected, Ethernet0
R 10.86.16.0/20 [120/1] via 10.85.1.5, 00:00:25, Serial0
R 10.87.16.0/20 [120/2] via 10.85.1.5, 00:00:25, Serial0
R 10.85.1.8/30 [120/1] via 10.85.1.5, 00:00:25, Serial0
C 10.85.1.4/30 is directly connected, Serial0
R 10.0.210.4/30 [120/2] via 10.85.1.5, 00:00:25, Serial0
R* 0.0.0.0/0 [120/1] via 10.85.1.5, 00:00:00, Serial0
b#sh conf
Using 572 out of 32762 bytes
!
version 11.1
service udp-small-servers
service tcp-small-servers
!
hostname b
!
!
!
interface Ethernet0
ip address 10.88.16.1 255.255.240.0
ip rip send version 2
ip rip receive version 2
!
interface Serial0
ip address 10.85.1.6 255.255.255.252
ip rip send version 2
ip rip receive version 2
clockrate 9600
!
interface Serial1
ip address 10.85.1.13 255.255.255.252
ip rip send version 2
ip rip receive version 2
clockrate 9600
!
router rip
version 2
network 10.0.0.0
!
ip classless
!
line con 0
line 1 8
line aux 0
line vty 0 4
password cisco
login
!
end
/************************************************************************/
路由器A1的配置:
a1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is 10.86.16.2 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
R 10.0.2.0/30 [120/1] via 10.86.16.2, 00:00:23, Ethernet0
R 10.88.16.0/20 [120/1] via 10.85.1.6, 00:00:27, Serial0
C 10.86.16.0/20 is directly connected, Ethernet0
R 10.87.16.0/20 [120/1] via 10.85.1.10, 00:00:24, Serial1
C 10.85.1.8/30 is directly connected, Serial1
C 10.85.1.4/30 is directly connected, Serial0
R 10.0.210.4/30 [120/1] via 10.86.16.2, 00:00:23, Ethernet0
S* 0.0.0.0/0 [1/0] via 10.86.16.2
a1#sh conf
Using 600 out of 32762 bytes
!
version 11.2
!
hostname a1
!
enable secret 5 $1$PKCA$FzjiYXenZNipsGuOcpwAg0
enable password cisco
!
!
interface Ethernet0
ip address 10.86.16.1 255.255.240.0
ip rip send version 2
ip rip receive version 2
!
interface Serial0
ip address 10.85.1.5 255.255.255.252
ip rip send version 2
ip rip receive version 2
!
interface Serial1
ip address 10.85.1.9 255.255.255.252
ip rip send version 2
ip rip receive version 2
clockrate 9600
!
router rip
version 2
network 10.0.0.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.86.16.2
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
a1#
/*****************************************************/
路由器B1的配置:
b1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
O E2 10.0.0.0/8 [110/1] via 10.185.1.17, 00:34:51, Serial0
C 10.0.32.0/20 is directly connected, Ethernet0
C 10.185.1.16/30 is directly connected, Serial0
O 10.0.210.4/30 [110/74] via 10.185.1.17, 00:53:25, Serial0
b1#sh conf
Using 441 out of 32762 bytes
!
version 11.1
service udp-small-servers
service tcp-small-servers
!
hostname b1
!
!
!
interface Ethernet0
ip address 10.0.32.1 255.255.240.0
!
interface Serial0
ip address 10.185.1.18 255.255.255.252
ip ospf network broadcast
!
interface Serial1
no ip address
shutdown
!
router ospf 200
network 10.0.32.0 0.0.0.3 area 1
network 10.185.1.16 0.0.0.3 area 1
!
no ip classless
!
line con 0
line 1 8
line aux 0
line vty 0 4
login
!
end
路由器C的配置:
!
hostname c
!
enable secret 5 $1$IoKm$0ai6l75ThSs0zeR9T90W3/
enable password cisco
!
!
interface Ethernet0
ip address 10.87.16.1 255.255.240.0
ip rip send version 2
ip rip receive version 2
!
interface Serial0
ip address 10.85.1.14 255.255.255.252
ip rip send version 2
clockrate 9600
!
interface Serial1
ip address 10.85.1.10 255.255.255.252
ip rip send version 2
ip rip receive version 2
!
router rip
version 2
network 10.0.0.0
!
ip classless
!
line con 0
line 1 16
transport input all
line aux 0
transport input all
line vty 0 4
password cisco
login
!
end