Chinaunix首页 | 论坛 | 博客
  • 博客访问: 52443
  • 博文数量: 11
  • 博客积分: 322
  • 博客等级: 二等列兵
  • 技术积分: 160
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-21 16:18
文章分类
文章存档

2012年(1)

2011年(10)

分类: 系统运维

2011-10-20 15:41:02


组网需求:
在很多地区,网吧用户同时申请了中国电信和中国网通两条宽带接入线路,如果此时双线路采用常规的“负载均衡”方式,就会发生访问网通站点走电信线路,访问电信站点走网通线路的情况,由于当前网通和电信两个运营商之间存在着互联互通速度慢的问题,造成速度瓶颈。如何实现“访问网通站点走网通线路,访问电信站点走电信线路”呢?在AR18系列路由器上可以通过配置策略路由的方式满足以上需要。

组网图



配置步骤:
1
定义监测组,分别监测电信和网通网关
进入系统视图,创建detect-group 1,监测电信网关:
system
Page 4 of 14
System View: return to User View with Ctrl+Z.
[Quidway] detect-group 1
[Quidway-detect-group-1]
[Quidway-detect-group-1]detect-list 1 ip address 61.1.1.1
[Quidway-detect-group-1]quit
创建detect-group 1,监测网通网关:
[Quidway]detect-group 2
[Quidway-detect-group-2]detect-list 1 ip address 202.1.1.1
[Quidway-detect-group-2]quit
[Quidway]
注:以上以地址61.1.1.1最为电信网关地址,地址202.1.1.1为网通网关地址为例,
可以根据实际组网情况修改。
2
配置两条默认路由互为备份,优先走电信线路:
[Quidway]ip route-static 0.0.0.0 0.0.0.0 61.1.1.1 preference 60 detect-group 1
[Quidway]ip route-static 0.0.0.0 0.0.0.0 202.1.1.1 preference 100 detect-group 2
注:以上以地址61.1.1.1最为电信网关地址,地址202.1.1.1为网通网关地址为例,
可以根据实际组网情况修改。
3
配置静态路由与监测组关联,使访问网通流量优先走网通线路:
以下配置较多,配置过程中可以用实际网通网关地址替换地址202.1.1.1后直接复制粘贴:
ip route-static 58.16.0.0 255.248.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 58.100.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 58.240.0.0 255.240.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.8.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.12.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.13.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.13.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.16.0.0 255.240.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.24.0.0 255.248.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.31.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.208.0.0 255.248.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.216.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.220.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.48.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.52.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.54.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.55.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.133.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.134.64.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.134.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.135.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.136.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.138.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.139.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.148.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.149.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.156.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.158.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.159.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.161.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.161.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.162.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.163.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.167.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.168.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.176.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.179.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.180.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.181.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.182.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 61.189.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 124.90.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 124.162.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 192.168.2.246 255.255.255.255 192.168.2.254 preference 60
ip route-static 202.32.0.0 255.224.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.96.64.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.97.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.98.0.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.99.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.102.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.102.224.0 255.255.254.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.106.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.107.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.108.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.110.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.110.192.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 202.111.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.79.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.80.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.81.0.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.86.32.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.86.64.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.90.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.90.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.90.192.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 203.92.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.12.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.12.192.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.13.0.0 255.255.255.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.14.160.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.14.192.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.15.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.15.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.16.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.21.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.22.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.51.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.52.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.52.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.53.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.74.64.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.74.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.78.0.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 210.82.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 211.100.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 211.101.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 211.147.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 211.167.96.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.4.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.10.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.21.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.24.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.26.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.27.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.28.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.56.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.60.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 60.0.0.0 255.248.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.62.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.67.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.68.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 218.109.159.0 255.255.255.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.141.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.142.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.154.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.156.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.158.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 219.159.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 220.248.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 220.252.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.0.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.4.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.6.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.7.128.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.8.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.10.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.11.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.12.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.12.0.0 255.255.128.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.12.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.192.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.195.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.196.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.199.0.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.199.32.0 255.255.240.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.199.128.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.199.192.0 255.255.240.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.200.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.204.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.207.0.0 255.255.192.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.208.0.0 255.240.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.208.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.213.0.0 255.255.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 221.214.0.0 255.254.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 222.128.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 222.132.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 222.136.0.0 255.248.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 222.160.0.0 255.252.0.0 202.1.1.1 preference 60 detect-group 2
ip route-static 222.163.0.0 255.255.224.0 202.1.1.1 preference 60 detect-group 2
ip route-static 0.0.0.0 0.0.0.0 20.1.1.2 preference 60 //内网路由
注:以上路由已经包含大部分网通地址段,如有更新可以动态添加。
经过如上三个配置步骤后,路由器便能自动区分网通流量和电信流量,使访问网通站点走网通线路,访问电信站点走电信线路。并且当网通线路出问题后所有流量都会自动切换到电信线路上,使用户能够不间断访问网络。

配置关键点:
关键点在于配置缺省路由走电信,精确路由走网通,同时配置一条优先级较低的缺省路
由走网通,这样既能实现负载分担,也能实现备份功能。
阅读(1436) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~