免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3418 | 回复: 1
打印 上一主题 下一主题

浮动静态路由实验 双链路备份实验 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-12-31 16:04 |只看该作者 |倒序浏览

声明:原创作品,未经允许严禁转载。作者:Ajian

实验来源说明:
最近看到一个关于双链路备份的项目:
“公司有一条电信DDN线路,还有一条联通DDN,分配给我们的IP肯定是不同的,我们有很多基于INTERNET的应用.
问题:如何在两条线路上做到线路间的相互备份?
答:我大致明白了你的想法,如果只有一个域名的话这样做比较困难;如果你有多个域名的话是可以的,当用户访问一个不成功时,主动访问第二个。这样便可以容错了。”
发现可以用我学过的知识解决就做了一个实验拓扑图来模拟这个环境。
实验环境说明:
如图:R1做为与公司内部局域网相连的路由器,要总能够访问其它网段B。公司有两条线路一条是通过Frame-relay传输是主传输(因为速度快),一条是ISDN做备份线路(速度慢)(但在这里因为我的模拟器不能模拟出ISDN出来只好用一个路由器代替了),当主线路Down掉后另一条可以很快的替代,并且主线路恢复后又可以很快的替代回来。。
拓扑图:

实验要求:
在正常情况下要求R1能Ping 到R2的E0,因为正常情况下公司内的人是通过主线路访问网络B,即要通过R2的E0口
当主线路Down掉后要求R1能Ping到R3的E1,因为Down掉后,公司局域网要通过备份链路访问到网络B,即要通过R3的E1口。
实验配置:
在本试验中要配置浮动静态路由。要求在R1 R2路由器上启动RIP协议。R3用静态路由。R1上配置到经R3到10.0.0.0网段的路由。
开始配置:(实验用的都是3640)
R1:
en
conf t
inter s0/0
encap frame-relay
frame-relay lmi-type ansi //如果是用Dyanmips实验只能用ANSI
clock rate 64000
ip add 120.0.0.1 255.255.255.0
frame-relay interface-dlci 201 //这个是配置这种简单的帧中继复杂的在前面的实验中有
no shut
do show inter s0/0 //最好配置完一个后查看一下是否有两个UP,如果Protocol Down掉了说明帧中继没有配置好。
inter e1/0
ip add 172.0.0.1 255.255.255.0
no shut
inter loopback0
ip add 172.0.0.1 255.255.255.0
exit
router rip
net 120.0.0.0
net 192.168.1.0 //不要把172.0.0.0宣布出去
exit
do show run //查看是否都配置对了
do write //保存一下妥当
R2:
en
conf t
inter s0/0
encap frame-relay
frame-relay lmi-type ansi
clock rate 64000
ip add 120.0.0.2 255.255.255.0
frame-relay interface-dlci 102
no shut
do show inter s0/0
inter e1/0
ip add 10.0.0.1 255.0.0.0
no shut
exit
router rip
network 120.0.0.0
network 10.0.0.0
end
show run
write
R3:
en
conf t
inter e0/0
ip add 172.0.0.2 255.255.255.0
no shut
inter E0/1
ip add 10.0.0.2 255.0.0.0
no shut
exit
ip classless
ip route 192.168.1.0 255.255.255.0 172.0.0.1
end
show run
write
验证:
现在的配置是主线路正常可以Ping到R2的E1/0口
router1(config-if)#do ping 10.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/89/144 ms
查看R1的路由表:
router1(config)#do show ip rout
Gateway of last resort is not set
172.0.0.0/24 is subnetted, 1 subnets
C 172.0.0.0 is directly connected, Ethernet1/0
R 10.0.0.0/8 [120/1] via 120.0.0.2, 00:00:08, Serial0/0
C 192.168.1.0/24 is directly connected, Loopback0
120.0.0.0/24 is subnetted, 1 subnets
C 120.0.0.0 is directly connected, Serial0/0
没有从R3到10.0.0.0网段的路由,加一条静态的路由
router1(config)#ip route 10.0.0.0 255.0.0.0 172.0.0.2

再查看:
Gateway of last resort is not set
172.0.0.0/24 is subnetted, 1 subnets
C 172.0.0.0 is directly connected, Ethernet1/0
S 10.0.0.0/8 [1/0] via 172.0.0.2
C 192.168.1.0/24 is directly connected, Loopback0
120.0.0.0/24 is subnetted, 1 subnets
C 120.0.0.0 is directly connected, Serial0/0
通过路由表我们看到,在配置了静态路由后,静态路由被选用,而RIP被忽略,这是因为静态路由的管理距离1小于RIP的120。
看一下各路由协议的管理距离:
Connected interface直连        0
Static route静态路由           1(可修改)
EIGRP summary route            5
External BGP                   20
Internal EIGRP                 90
IGRP                           100
OSPF                           110
IS-IS                          115
RIPV1 RIPV2                    120
External RIGRP                 170
Internal BGP                   200
Unknown                        255
为了在正常情况下用RIP,Down掉了才用静态的,这就是浮动路由,就要改静态路由的管理距离
router1(config)#no ip route 10.0.0.0 255.0.0.0 172.0.0.2
router1(config)#ip route 10.0.0.0 255.0.0.0 172.0.0.2 121
router1(config)#do show ip route

Gateway of last resort is not set
172.0.0.0/24 is subnetted, 1 subnets
C 172.0.0.0 is directly connected, Ethernet1/0
R 10.0.0.0/8 [120/1] via 120.0.0.2, 00:00:09, Serial0/0 //看到效果了又替换回来了
C 192.168.1.0/24 is directly connected, Loopback0
120.0.0.0/24 is subnetted, 1 subnets
C 120.0.0.0 is directly connected, Serial0/0
现在Shut掉R1的S0或者R2的S0
再看R1的路由表
Gateway of last resort is not set
172.0.0.0/24 is subnetted, 1 subnets
C 172.0.0.0 is directly connected, Ethernet1/0
S 10.0.0.0/8 [121/0] via 172.0.0.2
C 192.168.1.0/24 is directly connected, Loopback0
再Ping下R3的E0/1看是否是行
router1(config-if)#do ping 10.0.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/113/260 ms
成功了。
这样实验就完成了,由于不能做ISDN有点可惜,因为没有自己动手配置过,就不在这写命令,免得贻笑大方。。



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26011/showart_224484.html

论坛徽章:
0
2 [报告]
发表于 2009-12-26 10:18 |只看该作者
学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP