累计通过IE学员人数:自2011年起累计1700人 当年422人 当月22人
咨询热线:0571-86959638咨询QQ:839898248,VX:swiers2011
rx online


Backup Interface
实验目的:
配置拨号连接,使其成为一个帧中继网络的备份。在帧中继网络失效时自动启动。
实验设备:
Cisco 1720三台。其中一台用来模拟帧中继交换机。
实验原理:
一、备份接口
备份接口提供了一条冗余的链路,在主链路失效时,备份链路会建立起一条到目的地的连接来代替该主链路。
二、用Dialer Profiles配置拨号备份
拨号接口(Dialer interface)可以配置成为物理接口之间的逻辑中介。当拨号接口被设置为主链路的备份接口时,如果主链路失效或发生过载,拨号接口就会启动,并从拨号接口中选择一个空闲的物理接口,让它发起呼叫以建立一条备份链路。
三、实验拓朴图:
说明:远程节点RouterA通过帧中继与中心RouterB连接,该连接是主连接,另外还有一条异步线路(使用Modem)作为备份的连接。要实现的是当主链路失效时,备份链路能自动启动,代替主链路连接到中心,当主链路恢复后,备份链路重新回到Stanby状态。FRswitch是模拟帧中继交换网。
实验内容:
�. 配置基本的Backup Interface (使用物理接口)
一、路由器的基本配置
二、配置拨号连接(物理接口)
三、配置帧中继
四、配置Backup Interface
五、使用动态路由协议
�. 选做实验
六、使用Dialer Profile 配置Backup Interface
实验步骤:
一、 路由器的基本配置
        RouterA:
hostname RouterA
!
enable password cisco
!
interface Loopback0
ip address 192.168.216.1 255.255.255.0
!
interface Serial0
ip address 192.168.192.4 255.255.255.0
!
interface Serial1
ip address 192.168.16.4 255.255.255.0
!
!
line vty 0 4
password cisco
login
!
end
二、 配置拨号连接(物理接口)
        1RouterA
a) 配置串行口为异步模式
interface Serial 1
physical-layer async
ip address 192.168.16.4 255.255.255.0
encapsulation ppp
dialerin-band ! 表示端口支持DDR
dialer map ip 192.168.16.2 name RouterB broadcast 88 ! 中心的ip是 16.2 号码是88
dialer-group1 ! 使用dialer-list 1
async default routing ! 允许发布路由更新
async mode dedicated
ppp authentication chap ! 使用chap认证
!
b) 配置异步线路
line 2
password cisco
login
modem InOut
        Router B:
hostname RouterB
!
enable password cisco
!
interface Loopback0
ip address 192.168.0.1 255.255.255.0
!
interface Loopback1
ip address 192.168.20.1 255.255.255.0
!
interface Serial0
ip address 192.168.192.1 255.255.255.0
!
interface Serial1
ip address 192.168.16.2 255.255.255.0
!
!
line vty 0 4
password cisco
login
!
end
2、modem autoconfigure discovery ! 使用自动配置
transport input all
stopbits 1
speed 115200
flowcontrol hardware
!
c) 配置Dialer list
dialer-list 1 protocol ip permit ! ip数据流出发ddr
!
d) 配置chap认证用户名密码(全局配置模式下)
username RouterB password cisco ! 配置chap用户名密码(远端)
!
2RouterB
a) 配置串行口为异步模式
interface Serial1
physical-layer async
ip address 192.168.16.2 255.255.255.0
encapsulation ppp
async default routing
async mode dedicated
ppp authentication chap
!
b) 配置异步线路
line 2
password cisco
login
modem InOut
modem autoconfigure discovery
transport input all
stopbits 1
speed 115200
flowcontrol hardware
!
c) 配置chap认证用户名密码(全局配置模式下)
username RouterA password cisco
!
3. 测试拨号连接
在RouterA尝试ping RouterB的s1接口ip地址(192.168.16.2),看是否能拨号成功
三、 配置帧中继
1RouterA
interface Serial 0
ip address 192.168.192.4 255.255.255.0
encapsulation frame-relayip ospf network point-to-point ! FR为非广播式网络,为了运行OSPF,将其配置为点到点模式
3
frame-relay interface-dlci 16
!
2RouterB
interface Serial0
ip address 192.168.192.1 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-point ! FR为非广播式网络,为了运行OSPF,将其配置为点到点模式
frame-relay interface-dlci 17
!
3FR-Switching
hostname FR-Switching
!
enable password cisco
!
frame-relay switching
!
interface Serial0
no ip address
encapsulation frame-relay
clockrate 56000
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 16 interface Serial1 17
!
interface Serial1
no ip address
encapsulation frame-relay
clockrate 56000
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 17 interface Serial0 16
!
4. 测试帧中继连接
在RouterA尝试ping RouterB的s0接口ip地址(192.168.192.1),看是否连通
四、 配置Backup Interface
1RouterA
a) 在RouterA的s0接口(帧中继接口)配置备份接口

interface Serial 0
backup interface Serial 1
backup delay 6 8

b) 配置静态路由
设置浮动路由,将备份链路的管理距离设大,令其在主链路失效的时候才生效。正常情况下,在路由表内看不见备份链路的路由存在。
4、ip route 0.0.0.0 0.0.0.0 192.168.192.1 ! 主链路使用帧中继
ip route 0.0.0.0 0.0.0.0 192.168.16.2 222 ! 备份链路路由,管理距离设为222,当主链路路由失效时才启用
2RouterB
配置静态路由
ip route 0.0.0.0 0.0.0.0 192.168.192.4
ip route 0.0.0.0 0.0.0.0 192.168.16.4 222
3. 测试Backup Interface
正常工作时,检查RouterA的路由表:
1、在RouterA上面手动关闭帧中继接口
此时RouterA没有拨号,因为主接口状态被认为是人为需要关闭,而不是意外中断,不需要备份接口的介入,所以当主接口关闭时,备份接口也不会启用。
2、重新启用端口S1后,在帧中继交换机上关闭与RouterA的连接
RouterA#show backup
Primary Interface Secondary Interface Status
—————– ——————- ——
Serial1 Serial 0 backup mode
可以看到,备份接口自动启用,作为主链路的冗余。
察看路由表:
可以用ping命令检查联通性。
3、在交换机上打开帧中继的连接
RouterA#show backup
4、中心路由器的路由表:
使用主链路时:
使用备份链路时:
5、用于检验的命令还有 debug backup
五、 使用动态路由协议
问题:当RouterA连接到FR的链路失效时,RouterB的FR链路没有失效的话,虽然RouterA可以更新路由表而启用备份链路,但是RouterB的FR端口没有失效,路由表和之前的一样,仍然选用FR作为和RouterA通信的通道,导致数据包不能回去A。即只有当两端路由直连的时候,静态路由才可以顺利生效。使用扩展ping改变源端口ip地址测试
1RouterA
先将静态路由删除并确认已在帧中继端口配置了ip ospf network point-to-point 命令
router ospf 2
network 192.168.16.0 0.0.0.255 area 0
network 192.168.192.0 0.0.0.255 area 0
network 192.168.216.0 0.0.0.255 area 0
!
2RouterB
先将静态路由删除并确认已在帧中继端口配置了ip ospf network point-to-point 命令
router ospf 1
5、network 192.168.0.0 0.0.0.255 area 0
network 192.168.16.0 0.0.0.255 area 0
network 192.168.192.0 0.0.0.255 area 0
!
3. 测试Backup Interface
同上
六、 使用Dialer Profile 配置Backup Interface
当主链路正常时,用作backup的拨号链路处于准备状态(Standby mode),会一直断开除非主链路失效。在这种情况下,作备份用的拨号链路就不能用作DDR。为了解决这个问题,我们可以使用Dialer Profile 来配置Backup Interface,使得主链路失效时,拨号链路能用于备份,主链路正常时,拨号链路可以用作DDR。
实验拓扑图
        FR-SwitchingRouterARouterBCentral OfficeRemote Site A192.168.16.4/24S0S0S1S1S0S1192.168.16.2/24DLCI
17192.168.192.1/24DLCI 16192.168.192.4/24DLCI 16DLCI 17RouterCBranch OfficeS0192.168.10.1/24Telco
说 明:远程节点RouterA通过帧中继连接着中心RouterB,并且用一条拨号链路作为帧中继主链路的备份。同时这条拨号链路也用于连接Branch Office RouterC。目的是要实现帧中继主链路正常时,拨号链路可以用于连接Branch Office,当帧中继主链路失效时,拨号链路能用于帧中继链路的备份。
配置文件 (RouterB 与 FR-Switching无需修改配置)
1RouterA
配置要点:设置两个Interface Dialer,一个用于备份,一个用于ddr,绑到同一个接口Interface S0
hostname RouterA
!
6、username RouterB password cisco ! 配置中心chap用户名密码
username RouterC password cisco ! 配置分支chap用户名密码
!
interface Loopback1
ip address 192.168.216.1 255.255.255.0
!
interface Serial 0
backup interface Dialer1 ! 设置interface Dialer1为备份接口
backup delay 6 8
ip address 192.168.192.4 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-point
!
interface Serial 1
physical-layer async
no ip address
encapsulation ppp
dialer in-band
dialer pool-member 1 ! 绑定dialer pool 1, pool 1含有Dialer1和Dialer2
async default routing
async mode dedicated
ppp authentication chap
!
interface Dialer1 ! 配置Dialer1,用于到中心的备份链路
ip address 192.168.16.4 255.255.255.0 ! 拨号后为16网段
dialerpool1 ! 属于dialer pool 1
dialer remote-name RouterB ! 拨号远端为中心路由器
dialerstring88 ! 88为中心号码,配置时请注意修正
dialer-group1 ! 使用dialer-list 1 触发拨号
!
interface Dialer2 ! 配置Dialer2,用于到分支的DDR链路
ip address 192.168.10.2 255.255.255.0 ! 拨号后为10网段
dialerpool1 ! 属于dialer pool 1
dialer remote-name RouterC ! 拨号远端为分支路由器
dialerstring85 ! 85为中心号码,配置时请注意修正
7、dialer-group1 ! 使用dialer-list 1 触发拨号
!
router ospf 2
network 192.168.10.0 0.0.0.255 area 0
network 192.168.16.0 0.0.0.255 area 0
network 192.168.192.0 0.0.0.255 area 0
network 192.168.216.0 0.0.0.255 area 0
!
!
access-list 101 deny ip any host 224.0.0.5 ! 为防止ospf的hello包触发拨号,加入acl作限制
access-list 101 permit ip any any
dialer-list 1 protocol ip list 101 ! dialer-list 1 使用扩展acl
!
line 2
password cisco
login
modem InOut
modem autoconfigure discovery
transport input all
stopbits 1
speed 115200
flowcontrol hardware
line aux 0
line vty 0 4
password cisco
login
!
end
2RouterC
!
hostname RouterC
!
username RouterA password cisco ! 配置远程节点的chap认证用户名密码
!
interface Loopback0
8、ip address 192.168.11.1 255.255.255.0
!
interface Serial0
physical-layer async
ip address 192.168.10.1 255.255.255.0 ! 接口在10网段
encapsulation ppp
async default routing
async mode dedicated
ppp authentication chap
!
router ospf 1
network 192.168.10.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 0
!
line con 0
line 1
password cisco
login
modem InOut
modem autoconfigure discovery
transport input all
stopbits 1
speed 115200
flowcontrol hardware
line aux 0
line vty 0 4
password cisco
login
!
end
注意:
1. 因为ospf的hello包使用ip协议,在启动ospf时会自动打开拨号连接,为了防止这种情况发生,我们可以在dialer-list使用扩展acl,使得ospf的更新不触发拨号(ospf的hello包发向224.0.0.5这个组播地址)。但因为ospf不能更新,这时路由器上的路由表是不完整的,只能通过与拨号接口直连的网段上的主机通信时才能触发拨号。
9
2. 如果当前的拨号连接处于空闲状态(仍然保持连接),新的拨号将取代原有连接,举例来说:RouterA正在通过DDR与分支RouterC建立连接,如果此连接出于Idle状态,而正好这时RouterA与中心RouterB的帧中继主链路突然失效了,RouterA会自动断开与RouterC的连接,进入备份状态,拨号连接到中心RouterB,无需等到空闲超时。反过来也一样。
3. 如果当前的拨号连接处于活跃状态(即链路上有数据流传输),则新的连接必须等到原链路的数据传输完毕,进入空闲状态后才能建立。
 

Copyright © 2011-2023 思唯网络课堂 Swiers All Rights Reserved. | 浙ICP备17056685号