免费注册 查看新帖 |

Chinaunix

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

[OpenBSD] 双线策略求,解决办法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-01 04:01 |只看该作者 |倒序浏览
$tel = (re0)
$cnc = (re1)
$lan = (re2)
$lan_net =XXX.XXX.XXX.XXX/24

tel_gw = XXX.XXX.XXX.XXX
cnc_gw = XXX.XXX.XXX.XXX

altq on $tel hfsc bandwidth 100Mb queue { u1, u2, u3, u4, uouter}
queue u1 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
queue u2 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
....
queue uother bandwidth 20Mb hfsc ( default upperlimit 30Mb )

altq on $cnc hfsc bandwidth 100Mb queue { v1, v2, v3, v4, vouter}
queue v1 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
queue v2 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
....
queue vother bandwidth 20Mb hfsc ( default upperlimit 30Mb )

altq on $lan hfsc bandwidth 100Mb queue { c1, c2, c3, c4, couter}
queue c1 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
queue c2 bandwidth 3200Kb hfsc ( upperlimit 4Mb red )
.....
queue cother bandwidth 20Mb hfsc ( default upperlimit 30Mb )

table <dxip> persist file "/etc/dxip"
table <cncip> persist file "/etc/cncip"

nat on $tel from $lan_net to any -> ($tel)
nat on $cnc from $lan_net to any -> ($cnc)

pass in all
pass out all


##下面这两句起到双线分流作用.不加quick.不会分流,但是下面的限速规可以起作用.
加了quick后.后面限速的规则不管用了...
pass in quick on $lan route-to ($tel $tel_gw1) from any to <dxip>
pass in quick on $lan route-to ($cnc $cnc_gw2) from any to <cncip>


#pass in on $lan inet from 192.168.1.1 to any keep state tag 192.168.1.1 queue c1
#pass out on $tel inet all keep state tagged 192.168.1.1 queue u1
pass in on $lan inet from 192.168.1.2 to any keep state tag 192.168.1.2 queue c2
pass out on $tel inet all keep state tagged 192.168.1.2 queue u2
pass in on $lan inet from 192.168.1.3 to any keep state tag 192.168.1.3 queue c3
pass out on $tel inet all keep state tagged 192.168.1.3 queue u3
...........
.................................................................................
---------------------------------------------------------------------------------
##把上面的两后加到这后,可以不加quick,分流起作用.但是限速还是不管用..
pass in on $lan route-to ($tel $ext_gw1) from any to <dxip>
pass in on $lan route-to ($cnc $ext_gw2) from any to <cncip>

论坛徽章:
0
2 [报告]
发表于 2009-11-01 20:00 |只看该作者
:'( :'( :'( :'( :'( :'( :'(
:'( :'( :'( :'( 今天星期天.大哥们休息了吗???:'( :'( :'(
:'( :'( :'( 怎么没人回...............................:'( :'( :'(
:'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'(

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
3 [报告]
发表于 2009-11-03 09:06 |只看该作者
pass in quick on $lan route-to ($tel $tel_gw1) from any to <dxip>
pass in quick on $lan route-to ($cnc $cnc_gw2) from any to <cncip>

pass in on $lan inet from 192.168.1.2 to any keep state tag 192.168.1.2 queue c2
pass out on $tel inet all keep state tagged 192.168.1.2 queue u2
pass in quick on $lan route-to($tel $tel_gw1) from 192.168.1.2 to <dxip> keep state tag 192.168.1.2 queue c2
pass out quick on $tel inet all keep state tagged 192.168.1.2.queue u2
pass in quick on $lan route-to($cnc $cnc_gw2) from 192.168.1.2 to <cncip> keep state tag 192.168.1.2 queue c2
pass out quick on $cnc inet all keep state tagged 192.168.1.2 queue v2

[ 本帖最后由 congli 于 2009-11-3 09:08 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP