`
heiheben
  • 浏览: 137314 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Cisco IOS Cookbook 中文精简版 13-23 拨号备份

阅读更多

 提问 当广域网链路中断

得时候自动拨号恢复备份链路
回答
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface BRI0/0
Router1(config-if)#ip address 10.1.99.55 255.255.255.0
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer idle-timeout 300
Router1(config-if)#dialer map ip 10.1.99.1 name dialhost broadcast 95551212
Router1(config-if)#dialer load-threshold 50 either
Router1(config-if)#dialer-group 1
Router1(config-if)#isdn switch-type basic-ni
Router1(config-if)#isdn spid1 800555123400 5551234
Router1(config-if)#isdn spid2 800555123500 5551235
Router1(config-if)#ppp authentication chap
Router1(config-if)#ppp multilink
Router1(config-if)#exit
Router1(config)#username dialhost password dialpassword
Router1(config)#ip route 0.0.0.0 0.0.0.0 10.1.99.1 180
Router1(config)#dialer-list 1 protocol ip list 101
Router1(config)#access-list 101 deny eigrp any any
Router1(config)#access-list 101 permit ip any any
Router1(config)#router eigrp 55
Router1(config-router)#network 10.0.0.0
Router1(config-router)#end
Router1#
注释 isdn switch-type 定义对端ISDN交换机类型,中国用basic-net3。通过Router1#show isdn status 来查看当前状态
Router1#show isdn status
Global ISDN Switchtype = basic-ni
ISDN BRI1/0 interface
    dsl 8, interface ISDN Switchtype = basic-ni
    Layer 1 Status:
    ACTIVE
    Layer 2 Status:
    TEI = 85, Ces = 1, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED
    TEI = 86, Ces = 2, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED
    TEI 85, ces = 1, state = 8(established)
        spid1 configured, spid1 sent, spid1 valid
    TEI 86, ces = 2, state = 8(established)
        spid2 configured, spid2 sent, spid2 valid
    Layer 3 Status:
    0 Active Layer 3 Call(s)
    Activated dsl 8 CCBs = 0
    The Free Channel Mask:  0x80000003
Total Allocated ISDN CCBs = 2
Router1#
说明得是关注流量触发了拨号接通以后所有得数据都可以传输,不仅仅是关注流量
13.2.  使用拨号接口
提问 捆绑多个物理接口为一个拨号接口
回答
捆绑两个ISDN BRI接口
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface BRI0/0
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer pool-member 1
Router1(config-if)#isdn switch-type basic-ni
Router1(config-if)#isdn spid1 800555123400 5551234
Router1(config-if)#isdn spid2 800555123500 5551235
Router1(config-if)#ppp authentication chap
Router1(config-if)#exit
Router1(config)#interface BRI0/1
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer pool-member 1
Router1(config-if)#isdn switch-type basic-ni
Router1(config-if)#isdn spid1 800555123600 5551236
Router1(config-if)#isdn spid2 800555123700 5551237
Router1(config-if)#ppp authentication chap
Router1(config-if)#exit
Router1(config)#interface Dialer1
Router1(config-if)#ip address 10.1.99.55 255.255.255.0
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer remote-name dialhost
Router1(config-if)#dialer pool 1
Router1(config-if)#dialer idle-timeout 300
Router1(config-if)#dialer string 95551212
Router1(config-if)#dialer load-threshold 50 either
Router1(config-if)#dialer-group 1
Router1(config-if)#ppp authentication chap
Router1(config-if)#ppp multilink
Router1(config-if)#exit
Router1(config)#username dialhost password dialpassword
Router1(config)#ip route 0.0.0.0 0.0.0.0 10.1.99.1 180
Router1(config)#dialer-list 1 protocol ip list 101
Router1(config)#access-list 101 deny eigrp any any
Router1(config)#access-list 101 permit ip any any
Router1(config)#router eigrp 55
Router1(config-router)#network 10.0.0.0
Router1(config-router)#end
Router1#
主机端
dialhost#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
dialhost(config)#username Router1 password dialpassword
dialhost(config)#controller T1 0
dialhost(config-controller)#framing esf
dialhost(config-controller)#clock source line primary
dialhost(config-controller)#linecode b8zs
dialhost(config-controller)#pri-group timeslots 1-24
dialhost(config-controller)#exit
dialhost(config)#interface Serial0:23
dialhost(config-if)#encapsulation ppp
dialhost(config-if)#dialer rotary-group 1
dialhost(config-if)#dialer-group 1
dialhost(config-if)#isdn switch-type primary-dms100
dialhost(config-if)#isdn not-end-to-end 56
dialhost(config-if)#exit
dialhost(config)#interface Dialer1
dialhost(config-if)#ip address 10.1.99.1 255.255.255.0
dialhost(config-if)#encapsulation ppp
dialhost(config-if)#dialer in-band
dialhost(config-if)#dialer idle-timeout 300
dialhost(config-if)#dialer-group 1
dialhost(config-if)#no peer default ip address
dialhost(config-if)#ppp authentication chap
dialhost(config-if)#ppp multilink
dialhost(config-if)#exit
dialhost(config)#access-list 101 deny eigrp any any
dialhost(config)#access-list 101 permit ip any any
dialhost(config)#dialer-list 1 protocol ip list 101
dialhost(config)#router eigrp 55
dialhost(config-router)#network 10.0.0.0
dialhost(config-router)#exit
dialhost(config)#end
dialhost#
注释 本节实现得结果和13.1相同,配置也基本相同,不同得是这里没有使用dialer map命令,在物理接口上也没有配置IP地址,相关配置都在定义得逻辑拨号接口Dialer1上。在Server端使用了PRI
13.3.  在AUX端口使用异步Modem
提问 在路由器得AUX端口连接异步Modem,用其作为拨号备份
回答
Router2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#interface Async65
Router2(config-if)#encapsulation ppp
Router2(config-if)#dialer in-band
Router2(config-if)#dialer pool-member 1
Router2(config-if)#ppp authentication chap
Router2(config-if)#async default routing
Router2(config-if)#exit
Router2(config)#interface Dialer1
Router2(config-if)#ip address 10.1.99.56 255.255.255.0
Router2(config-if)#encapsulation ppp
Router2(config-if)#dialer remote-name dialhost
Router2(config-if)#dialer pool 1
Router2(config-if)#dialer idle-timeout 300
Router2(config-if)#dialer string 95551212
Router2(config-if)#dialer-group 1
Router2(config-if)#ppp authentication chap
Router2(config-if)#exit
Router2(config)#line aux 0
Router2(config-line)#modem inout
Router2(config-line)#transport input all
Router2(config-line)#no exec
Router2(config-line)#speed 115200
Router2(config-line)#exit
Router2(config)#username dialhost password dialpassword
Router2(config)#ip route 0.0.0.0 0.0.0.0 10.1.99.1 180
Router2(config)#dialer-list 1 protocol ip list 101
Router2(config)#access-list 101 deny eigrp any any
Router2(config)#access-list 101 permit ip any any
Router2(config)#router eigrp 55
Router2(config-router)#network 10.0.0.0
Router2(config-router)#exit
Router2(config)#end
Router2#
注释 开始要先通过show line查找出AUX口得vty号码,也就是interface Async65 ,然后使用前面提到得拨号接口得方法进行配置,多了一个async default routing命令,因为缺省情况下异步口是禁止启用路由协议得。在对AUX端口配置时,首先一定要使用no exec来避免出现Modem不能响应得问题,同时建议调整速率,否则会缺省9.6 Kbps。
13.4.  使用备份接口
提问 在广域网物理接口断掉得情况下拨号
回答
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface Serial0/0
Router1(config-if)#backup delay 0 300
Router1(config-if)#backup interface BRI0/0
Router1(config-if)#encapsulation frame-relay
Router1(config-if)#down-when-looped
Router1(config-if)#exit
Router1(config)#interface Serial0/0.1 point-to-point
Router1(config-subif)#ip address 10.1.1.10 255.255.255.252
Router1(config-subif)#frame-relay interface-dlci 50   
Router1(config-subif)#exit
Router1(config)#interface BRI0/0
Router1(config-if)#ip address 10.1.99.55 255.255.255.0
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer idle-timeout 300
Router1(config-if)#dialer map ip 10.1.99.1 name dialhost broadcast 95551212
Router1(config-if)#dialer load-threshold 50 either
Router1(config-if)#dialer-group 1
Router1(config-if)#isdn switch-type basic-ni
Router1(config-if)#isdn spid1 800555123400 5551234
Router1(config-if)#isdn spid2 800555123500 5551235
Router1(config-if)#ppp authentication chap
Router1(config-if)#ppp multilink
Router1(config-if)#exit
Router1(config)#dialer-list 1 protocol ip permit
Router1(config)#end
Router1#
注释 备份接口得配置要放在物理接口上而不是子接口上。一般不推荐使用此方法进行备份,因为很多广域网链路得问题不能体现在物理接口down掉上,并且在正常情况下会使备份接口处于禁用状态,这样会需要重新拨号,不能使用show isdn status等命令进行查看状态等问题。
13.5.  使用Dialer Watch
提问 使用思科得Dialer Watch特性来触发拨号备份
回答
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface BRI0/0
Router1(config-if)#ip address 10.1.99.55 255.255.255.0
Router1(config-if)#encapsulation ppp
Router1(config-if)#dialer map ip 10.1.1.0 name dialhost broadcast 95551212
Router1(config-if)#dialer map ip 10.2.0.0 name dialhost broadcast 95551212
Router1(config-if)#dialer map ip 10.1.99.1 name dialhost broadcast 95551212
Router1(config-if)#dialer load-threshold 50 either
Router1(config-if)#dialer watch-group 1
Router1(config-if)#dialer-group 1
Router1(config-if)#isdn switch-type basic-ni
Router1(config-if)#isdn spid1 800555123400 5551234
Router1(config-if)#isdn spid2 800555123500 5551235
Router1(config-if)#ppp authentication chap
Router1(config-if)#ppp multilink
Router1(config-if)#exit
Router1(config)#router eigrp 55
Router1(config-router)#network 10.0.0.0
Router1(config-router)#exit
Router1(config)#username dialhost password cisco
Router1(config)#access-list 101 deny eigrp any any
Router1(config)#access-list 101 permit ip any any
Router1(config)#dialer-list 1 protocol ip list 101
Router1(config)#dialer watch-list 1 ip 10.2.0.0 255.255.0.0
Router1(config)#dialer watch-list 1 ip 10.1.1.0 255.255.255.0
Router1(config)#dialer watch-list 1 delay route-check initial 300
Router1(config)#dialer watch-list 1 delay disconnect 15
Router1(config)#end
Router1#
注释 Dialer Watch通过跟踪路由表中特定路由前缀得存在情况来判断是否需要触发拨号,这里要特别注意得是例子中监控了两个路由前缀,必须两个路由前缀都消失才会触发拨号。还是建议使用13.1中得浮动路由方式来进行拨号备份
13.6.  使用Virtual Templates
提问 使用Virtual Templates得方式来配置拨号备份
回答
dialhost#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
dialhost(config)#username Router1 password dialpassword
dialhost(config)#interface BRI0/0
dialhost(config-if)#no ip address
dialhost(config-if)#encapsulation ppp
dialhost(config-if)#dialer pool-member 1
dialhost(config-if)#isdn switch-type basic-ni
dialhost(config-if)#isdn point-to-point-setup
dialhost(config-if)#isdn spid1 800555123400 5551234
dialhost(config-if)#isdn spid2 800555123500 5551235
dialhost(config-if)#ppp authentication chap
dialhost(config-if)#ppp multilink
dialhost(config-if)#exit
dialhost(config)#interface Dialer1
dialhost(config-if)#no ip address
dialhost(config-if)#encapsulation ppp
dialhost(config-if)#dialer idle-timeout 300
dialhost(config-if)#dialer-group 1
dialhost(config-if)#no peer default ip address
dialhost(config-if)#ppp authentication chap
dialhost(config-if)#ppp multilink
dialhost(config-if)#exit
dialhost(config)#access-list 101 deny   eigrp any any
dialhost(config)#access-list 101 permit ip any any
dialhost(config)#dialer-list 1 protocol ip list 101
dialhost(config)#router eigrp 55
dialhost(config-router)#network 10.0.0.0
dialhost(config-router)#exit
dialhost(config)#interface Loopback1
dialhost(config-if)#ip address 10.1.99.1 255.255.255.0
dialhost(config-if)#exit
dialhost(config)#interface Virtual-Template1
dialhost(config-if)#ip unnumbered Loopback1
dialhost(config-if)#encapsulation ppp
dialhost(config-if)#ppp authentication chap
dialhost(config-if)#ppp multilink
dialhost(config-if)#ppp multilink load-threshold 50 either
dialhost(config-if)#exit
dialhost(config)#virtual-profile virtual-template 1
dialhost(config)#end
dialhost#
注释 一般用于中心得拨号服务器,类似于13.2但是在Dialer 接口下也没有配置IP地址,而是配置在Virtual Template上
13.7.  确保断线正常
提问 当主链路恢复以后确保备份链路断线正常
回答
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface Serial0/0.1 point-to-point
Router1(config-subif)#bandwidth 56
Router1(config-subif)#exit
Router1(config)#interface BRI0/0
Router1(config-subif)#bandwidth 54
Router1(config-subif)#end
Router1#
注释 通过配置带宽得方式来调整主备接口得metric值,从而避免在路由计算时选用备份接口
13.8.  查看拨号备份状态
提问 查看拨号备份状态
回答
Router1#show dialer
Router1#show backup
Router1#show isdn status
Router1#show isdn active
Router1#show isdn history

注释 show dialer里面比较有意思得信息是Dial reason: ip (s=10.1.99.55, d=224.0.0.10),从而确定是什么数据触发得拨号
13.9.       拨号备份排错
提问 查找拨号备份失败原因
回答
Router1#debug ppp authentication
Router1#debug dialer

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics