3. 异步拨号备份DDN专线:
此例主连接采用DDN专线,备份线路为电话拨号。当DDN专线连接正常时,主端口S0状态为up,line protocol亦为up,则备份线路状态为standby,line protocol为down,此时所有通信均通过主接口进行。当主接口连接发生故障时,端口状态为down,则激活备份接口,完成数据通信。此方法不适合为X.25做备份。因为,配置封装为X.25的接口只要和X.25交换机之间的连接正常其接口及line protocol的状态亦为 up,它并不考虑其它地方需与之通信的路由器的状态如何,所以若本地路由器状态正常,而对方路由器连接即使发生故障,本地也不会激活备份线路。例4将会描述如何为X.25做拨号备份。
以下是相关命令:
任务 命令
指定主线路改变后,次线路状态发生改变的延迟时间 backup delay {enable-delay | never} {disable-delay | never}
指定一个接口作为备份接口 backup interface type number
hostname c2522rb
!
enable secret 5 $1$J5vn$ceYDe2FwPhrZi6qsIIz6g0
enable password cisco
!
username c4700 password 0 cisco
ip subnet-zero
chat-script cisco-default "" "AT" TIMEOUT 30 OK "ATDT \T" TIMEOUT 30 CONNECT \c
chat-script reset atz
!
interface Ethernet0
ip address 16.122.51.254 255.255.255.0
no ip mroute-cache
!
interface Serial0
backup delay 10 10
backup interface Serial2
ip address 16.250.123.18 255.255.255.252
no ip mroute-cache
no fair-queue
!
interface Serial1
no ip address
no ip mroute-cache
shutdown
!
interface Serial2
physical-layer async
ip address 16.249.123.18 255.255.255.252
encapsulation ppp
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer map ip 16.249.123.17 name c4700 6825179
dialer-group 1
ppp authentication chap
!
interface Serial3
no ip address
shutdown
no cdp enable
!
interface Serial4
no ip address
shutdown
no cdp enable
!
interface Serial5
no ip address
no ip mroute-cache
shutdown
!
interface Serial6
no ip address
no ip mroute-cache
shutdown
!
interface Serial7
no ip address
no ip mroute-cache
shutdown
!
interface Serial8
no ip address
no ip mroute-cache
shutdown
!
interface Serial9
no ip address
no ip mroute-cache
shutdown
!
interface BRI0
no ip address
no ip mroute-cache
shutdown
!
router eigrp 200
network 16.0.0.0
!
ip classless
!
dialer-list 1 protocol ip permit
!
line con 0
line 2
script dialer cisco-default
script reset reset
modem InOut
modem autoconfigure discovery
rxspeed 38400
txspeed 38400
flowcontrol hardware
line aux 0
line vty 0 4
password cisco
login
!
end
c2522rb#
4. 异步拨号备份X.25:
设置X.25的拨号备份,首先X.25连接的端口必须运行动态路由协议,异步拨号口必须使用静态路由.本例选择EIGRP作为路由选择协议,将静态路由的Metric的值设置为200,由于EIGRP的默认Metric为90,所以当同时有两条路径通往同一网段时,其中Metric值小的路径生效,而当X.25连接出现问题时,路由器无法通过路由协议学习到路由表,则此时静态路由生效,访问通过拨号端口实现。当X.25连接恢复正常时,路由器又可以学习到路由表,则由于 Metric值的不同,静态路由自动被动态路由所代替,这样就实现了备份的功能。
路由器Router1配置如下:
hostname router1
!
enable secret 5 $1$UTvD$99YiY2XsRMxHudcYeHn.Y.
enable password cisco
!
username router2 password cisco
ip subnet-zero
chat-script cisco-default "" "AT" TIMEOUT 30 OK "ATDT \T" TIMEOUT 30 CONNECT \c
chat-script reset atz
interface Ethernet0
ip address 202.96.38.100 255.255.255.0
!
interface Serial0
ip address 202.96.0.1 255.255.255.0
encapsulation x25
x25 address 10112227
x25 htc 16
x25 map ip 202.96.0.2 10112225 broadcast
!
interface Serial1
no ip address
shutdown
!
!
interface Async 1
ip address 202.96.1.1 255.255.255.252
encapsulation ppp
dialer in-band
dialer idle-timeout 60
dialer map ip 202.96.1.2 name router2 modem-script cisco-default 2113470
dialer-group 1
ppp authentication chap
!
router eigrp 200
redistribute connected
network 202.96.0.0
!
ip route 202.96.37.0 255.255.255.0 202.96.1.2 200
dialer-list 1 protocol ip permit
line con 0
line aux 0
script dialer cisco-default
script reset reset
modem InOut
modem autoconfigure discovery
transport input all
rxspeed 38400
txspeed 38400
flowcontrol hardware
line vty 0 4
password cisco
login
!
end
路由器Router2配置如下:
hostname router2
!
enable secret 5 $1$T4IU$2cIqak8f/E4Ug6dLT0k.J0
enable password cisco
!
username router1 password cisco
ip subnet-zero
chat-script cisco-default "" "AT" TIMEOUT 30 OK "ATDT \T" TIMEOUT 30 CONNECT \c
chat-script reset atz
!
interface Ethernet0
ip address 202.96.37.100 255.255.255.0
!
interface Serial0
ip address 202.96.0.2 255.255.255.0
no ip mroute-cache
encapsulation x25
x25 address 10112225
x25 htc 16
x25 map ip 202.96.0.1 10112227 broadcast
!
interface Serial1
no ip address
shutdown
!
interface Async1
ip address 202.96.1.2 255.255.255.252
encapsulation ppp
keepalive 30
async default routing
async mode dedicated
dialer in-band
dialer idle-timeout 60
dialer wait-for-carrier-time 120
dialer map ip 202.96.1.1 name router1 modem-script cisco-default 2113469
dialer-group 1
ppp authentication chap
!
router eigrp 200
redistribute static
network 202.96.0.0
!
no ip classless
ip route 202.96.38.0 255.255.255.0 202.96.1.1 200
dialer-list 1 protocol ip permit
!
line con 0
exec-timeout 0 0
line aux 0
script reset reset
modem InOut
modem autoconfigure discovery
transport input all
rxspeed 38400
txspeed 38400
flowcontrol hardware
line vty 0 4
password cisco
login
!
end
路由协议:
一、RIP协议
 
RIP(Routing information Protocol)是应用较早、使用较普遍的内部网关协议(Interior Gateway Protocol,简称IGP),适用于小型同类网络,是典型的距离向量(distance-vector)协议。文档见RFC1058、RFC1723。
RIP通过广播UDP报文来交换路由信息,每30秒发送一次路由信息更新。RIP提供跳跃计数(hop count)作为尺度来衡量路由距离,跳跃计数是一个包到达目标所必须经过的路由器的数目。如果到相同目标有二个不等速或不同带宽的路由器,但跳跃计数相同,则RIP认为两个路由是等距离的。RIP最多支持的跳数为15,即在源和目的网间所要经过的最多路由器的数目为15,跳数16表示不可达。
1. 有关命令
任务 命令
指定使用RIP协议 router rip
指定RIP版本 version {1|2}1
指定与该路由器相连的网络 network network
注:1.Cisco的RIP版本2支持验证、密钥管理、路由汇总、无类域间路由(CIDR)和变长子网掩码(VLSMs)
2. 举例
Router1:
router rip
version 2
network 192.200.10.0
network 192.20.10.0

相关调试命令:
show ip protocol
show ip route
 
返回目录
 
二、IGRP协议
 
IGRP (Interior Gateway Routing Protocol)是一种动态距离向量路由协议,它由Cisco公司八十年代中期设计。使用组合用户配置尺度,包括延迟、带宽、可靠性和负载。
缺省情况下,IGRP每90秒发送一次路由更新广播,在3个更新周期内(即270秒),没有从路由中的第一个路由器接收到更新,则宣布路由不可访问。在7个更新周期即630秒后,Cisco IOS 软件从路由表中清除路由。
1. 有关命令
任务 命令
指定使用RIP协议 router igrp autonomous-system1
指定与该路由器相连的网络 network network
指定与该路由器相邻的节点地址 neighbor ip-address
注:1、autonomous-system可以随意建立,并非实际意义上的autonomous-system,但运行IGRP的路由器要想交换路由更新信息其autonomous-system需相同。
2.举例
Router1:
router igrp 200
network 192.200.10.0
network 192.20.10.0
!
三、OSPF协议
 
OSPF(Open Shortest Path First)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)内决策路由。与RIP相对,OSPF是链路状态路有协议,而RIP是距离向量路由协议。
链路是路由器接口的另一种说法,因此OSPF也称为接口状态路由协议。OSPF通过路由器之间通告网络接口的状态来建立链路状态数据库,生成最短路径树,每个OSPF路由器使用这些最短路径构造路由表。
文档见RFC2178。
1.有关命令
全局设置
任务 命令
指定使用OSPF协议 router ospf process-id1
指定与该路由器相连的网络 network address wildcard-mask area area-id2
指定与该路由器相邻的节点地址 neighbor ip-address
注:1、OSPF路由进程process-id必须指定范围在1-65535,多个OSPF进程可以在同一个路由器上配置,但最好不这样做。多个OSPF进程需要多个OSPF数据库的副本,必须运行多个最短路径算法的副本。process-id只在路由器内部起作用,不同路由器的process-id可以不同。
2、wildcard-mask 是子网掩码的反码, 网络区域ID area-id在0-4294967295内的十进制数,也可以是带有IP地址格式的x.x.x.x。当网络区域ID为0或0.0.0.0时为主干域。不同网络区域的路由器通过主干域学习路由信息。
2.基本配置举例:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192
!
interface serial 0
ip address 192.200.10.5 255.255.255.252
!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1
!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192
!
interface serial 0
ip address 192.200.10.6 255.255.255.252
!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.64 0.0.0.63 area 2
!
Router3:
interface ethernet 0
ip address 192.1.0.130 255.255.255.192
!
router ospf 300
network 192.1.0.128 0.0.0.63 area 1
!
Router4:
interface ethernet 0
ip address 192.1.0.66 255.255.255.192
!
router ospf 400
network 192.1.0.64 0.0.0.63 area 1
!
相关调试命令:
debug ip ospf events
debug ip ospf packet
show ip ospf
show ip ospf database
show ip ospf interface
show ip ospf neighbor
show ip route
3. 使用身份验证
为了安全的原因,我们可以在相同OSPF区域的路由器上启用身份验证的功能,只有经过身份验证的同一区域的路由器才能互相通告路由信息。
在默认情况下OSPF不使用区域验证。通过两种方法可启用身份验证功能,纯文本身份验证和消息摘要(md5)身份验证。纯文本身份验证传送的身份验证口令为纯文本,它会被网络探测器确定,所以不安全,不建议使用。而消息摘要(md5)身份验证在传输身份验证口令前,要对口令进行加密,所以一般建议使用此种方法进行身份验证。
使用身份验证时,区域内所有的路由器接口必须使用相同的身份验证方法。为起用身份验证,必须在路由器接口配置模式下,为区域的每个路由器接口配置口令。
任务 命令
指定身份验证 area area-id authentication [message-digest]
使用纯文本身份验证 ip ospf authentication-key password
使用消息摘要(md5)身份验证 ip ospf message-digest-key keyid md5 key
以下列举两种验证设置的示例,示例的网络分布及地址分配环境与以上基本配置举例相同,只是在Router1和Router2的区域0上使用了身份验证的功能。:
例1.使用纯文本身份验证
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192
!
interface serial 0
ip address 192.200.10.5 255.255.255.252
ip ospf authentication-key cisco
!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1
area 0 authentication
!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192
!
interface serial 0
ip address 192.200.10.6 255.255.255.252
ip ospf authentication-key cisco
!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.64 0.0.0.63 area 2
area 0 authentication
!
例2.消息摘要(md5)身份验证:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192
!
interface serial 0
ip address 192.200.10.5 255.255.255.252
ip ospf message-digest-key 1 md5 cisco
!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1
area 0 authentication message-digest
!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192
!
interface serial 0
ip address 192.200.10.6 255.255.255.252
ip ospf message-digest-key 1 md5 cisco
!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.64 0.0.0.63 area 2
area 0 authentication message-digest
!
相关调试命令:
debug ip ospf adj
debug ip ospf events
 
返回目录
 
四、重新分配路由
 
在实际工作中,我们会遇到使用多个IP路由协议的网络。为了使整个网络正常地工作,必须在多个路由协议之间进行成功的路由再分配。
以下列举了OSPF与RIP之间重新分配路由的设置范例:
Router1的Serial 0端口和Router2的Serial 0端口运行OSPF,在Router1的Ethernet 0端口运行RIP 2,Router3运行RIP2,Router2有指向Router4的192.168.2.0/24网的静态路由,Router4使用默认静态路由。需要在Router1和Router3之间重新分配OSPF和RIP路由,在Router2上重新分配静态路由和直连的路由。
范例所涉及的命令
任务 命令
重新分配直连的路由 redistribute connected
重新分配静态路由 redistribute static
重新分配ospf路由 redistribute ospf process-id metric metric-value
重新分配rip路由 redistribute rip metric metric-value
Router1:
interface ethernet 0
ip address 192.168.1.1 255.255.255.0
!
interface serial 0
ip address 192.200.10.5 255.255.255.252
!
router ospf 100
redistribute rip metric 10
network 192.200.10.4 0.0.0.3 area 0
!
router rip
version 2
redistribute ospf 100 metric 1
network 192.168.1.0
!
Router2:
interface loopback 1
ip address 192.168.3.2 255.255.255.0
!
interface ethernet 0
ip address 192.168.0.2 255.255.255.0
!
interface serial 0
ip address 192.200.10.6 255.255.255.252
!
router ospf 200
redistribute connected subnet
redistribute static subnet
network 192.200.10.4 0.0.0.3 area 0
!
ip route 192.168.2.0 255.255.255.0 192.168.0.1

Router3:
interface ethernet 0
ip address 192.168.1.2 255.255.255.0
!
router rip
version 2
network 192.168.1.0
!
Router4:
interface ethernet 0
ip address 192.168.0.1 255.255.255.0
!
interface ethernet 1
ip address 192.168.2.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.0.2
!
 
五、IPX协议设置
 
IPX协议与IP协议是两种不同的网络层协议,它们的路由协议也不一样,IPX的路由协议不象IP的路由协议那样丰富,所以设置起来比较简单。但IPX协议在以太网上运行时必须指定封装形式。
1. 有关命令
启动IPX路由 ipx routing
设置IPX网络及以太网封装形式 ipx network network [encapsulation encapsulation-type]1
指定路由协议,默认为RIP ipx router {eigrp autonomous-system-number | nlsp [tag] | rip}
注:1.network 范围是1 到FFFFFFFD.
IPX封装类型列表
接口类型 封装类型 IPX帧类型
Ethernet novell-ether (默认) arpa sap snap Ethernet_802.3 Ethernet_II Ethernet_802.2 Ethernet_Snap
Token Ring sap (默认) snap Token-Ring Token-Ring_Snap
FDDI snap (默认) sap novell-fddi Fddi_Snap Fddi_802.2 Fddi_Raw
举例:
在此例中,WAN的IPX网络为3a00,Router1所连接的局域网IPX网络号为2a00,在此局域网有一台Novell服务器,IPX网络号也是2a00, 路由器接口的IPX网络号必须与在同一网络的Novell服务器上设置的IPX网络号相同。路由器通过监听SAP来建立已知的服务及自己的网络地址表,并每60秒发送一次自己的SAP表。
Router1:
ipx routing
interface ethernet 0
ipx network 2a00 encapsulation sap
!
interface serial 0
ipx network 3a00
!
ipx router eigrp 10
network 3a00
network 2a00
!
Router2:
ipx routing
interface ethernet 0
ipx network 2b00 encapsulation sap
!
interface serial 0
ipx network 3a00
!
ipx router eigrp 10
network 2b00
network 3a00
!
相关调试命令:
debug ipx packet
debug ipx routing
debug ipx sap
debug ipx spoof
debug ipx spx
show ipx eigrp interfaces
show ipx eigrp neighbors
show ipx eigrp topology
show ipx interface
show ipx route
show ipx servers
show ipx spx-spoof
 
五、IPX协议设置
 
IPX协议与IP协议是两种不同的网络层协议,它们的路由协议也不一样,IPX的路由协议不象IP的路由协议那样丰富,所以设置起来比较简单。但IPX协议在以太网上运行时必须指定封装形式。
1. 有关命令
启动IPX路由 ipx routing
设置IPX网络及以太网封装形式 ipx network network [encapsulation encapsulation-type]1
指定路由协议,默认为RIP ipx router {eigrp autonomous-system-number | nlsp [tag] | rip}
注:1.network 范围是1 到FFFFFFFD.
IPX封装类型列表
接口类型 封装类型 IPX帧类型
Ethernet novell-ether (默认) arpa sap snap Ethernet_802.3 Ethernet_II Ethernet_802.2 Ethernet_Snap
Token Ring sap (默认) snap Token-Ring Token-Ring_Snap
FDDI snap (默认) sap novell-fddi Fddi_Snap Fddi_802.2 Fddi_Raw
举例:
在此例中,WAN的IPX网络为3a00,Router1所连接的局域网IPX网络号为2a00,在此局域网有一台Novell服务器,IPX网络号也是2a00, 路由器接口的IPX网络号必须与在同一网络的Novell服务器上设置的IPX网络号相同。路由器通过监听SAP来建立已知的服务及自己的网络地址表,并每60秒发送一次自己的SAP表。
Router1:
ipx routing
interface ethernet 0
ipx network 2a00 encapsulation sap
!
interface serial 0
ipx network 3a00
!
ipx router eigrp 10
network 3a00
network 2a00
!
Router2:
ipx routing
interface ethernet 0
ipx network 2b00 encapsulation sap
!
interface serial 0
ipx network 3a00
!
ipx router eigrp 10
network 2b00
network 3a00
!
相关调试命令:
debug ipx packet
debug ipx routing
debug ipx sap
debug ipx spoof
debug ipx spx
show ipx eigrp interfaces
show ipx eigrp neighbors
show ipx eigrp topology
show ipx interface
show ipx route
show ipx servers
show ipx spx-spoof
 
4、、、章 服务质量及访问控制
一、协议优先级设置
 
1.有关命令
任务 命令
设置优先级表项目 priority-list list-number protocol protocol {high | medium | normal | low} queue-keyword keyword-value
使用指定的优先级表 priority-group list-number
2.举例
Router1:
priority-list 1 protocol ip high tcp telnet
priority-list 1 protocol ip low tcp ftp
priority-list 1 default normal
interface serial 0
priority-group 1
 
返回目录
 
二、队列定制
 
1.有关命令
任务 命令
设置队列表中包含协议 queue-list list-number protocol protocol-name queue-number queue-keyword keyword-value
设置队列表中队列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的队列表 custom-queue-list list
2.举例
Router1:
queue-list 1 protocol ip 0 tcp telnet
queue-list 1 protocol ip 1 tcp www
queue-list 1 protocol ip 2 tcp ftp
queue-list 1 queue 0 byte-count 300
queue-list 1 queue 1 byte-count 200
queue-list 1 queue 2 byte-count 100
interface serial 0
custom-queue-list 1
返回目录
 三、访问控制
 
1.有关命令
任务 命令
设置访问表项目 access-list list {permit | deny} address mask
设置队列表中队列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的访问表 ip access-group list {in | out}
2.举例
Router1:
access-list 1 deny 192.1.3.0 0.0.0.255
access-list 1 permit any
interface serial 0
ip access-group 1 in

文章录入:csh    责任编辑:csh 

以上就是【CISCO 技术集合五】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论