找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 46011|回复: 27

小白浅析mwan3的配置文件中文说明

 火.. [复制链接]
发表于 2012-10-17 16:11 | 显示全部楼层 |阅读模式
# This is a mwan3 example config. For mwan3 to work you will need at least这是mwan3的设置示例。至少需要以下几项才能运行mwan3
#
# - 2 interfaces(2个接口
# - 2 members(2个成员
# - 1 policy(1个策略
# - 1 rule(1条规则
#
# First define all your wan interfaces. Interface name must match with the
# name used in your network configuration:
首先要设置所有的wan口,wan口的名字必须跟network配置文件中的wan口名字一致
config 'interface' 'wan1'
        option 'enabled' '1'
        list 'track_ip' '8.8.4.4'(这些IP都是测试IP,验证是否能ping的通。这里有4个,前两个都是google提供的免费DNS服务器,国内访问应该比较慢。
        list 'track_ip' '8.8.8.8'
        list 'track_ip' '208.67.222.222'
        list 'track_ip' '208.67.220.220'
        option 'reliability' '2'(可靠性,测试以上IP的可靠性,必须是有响应的链接的个数。简单说就是要求上面的ip几个能ping通
        option 'count' '1'(ping几次
        option 'timeout' '2'(ping后如果超时,超时几秒
        option 'interval' '5'(多次ping之间的间隔时间
        option 'down' '3'(出现几个ping不通时就认定该wan口掉线了
        option 'up' '8'(出现几个ping能成功时就认定已经掉线的wan口又上线了

config 'interface' 'wan2'
        option 'enabled' '1'
        list 'track_ip' '8.8.8.8'
        list 'track_ip' '208.67.220.220'
        option 'reliability' '1'
        option 'count' '1'
        option 'timeout' '2'
        option 'interval' '5'
        option 'down' '3'
        option 'up' '8'

# Next define a member and configure metric and weight values for this member.(接着设置一个成员的权重和跃点值
# Each interface can have multiple member definitions. Give each member a correct(每一个接口可以含有多重成员定义。每一个成员名称必须有正确的名称
# name (A-Z, a-z, 0-9, "_" and no spaces).

config 'member' 'wan1_m1_w3'
        option 'interface' 'wan1'
        option 'metric' '1'(1-1000的范围
        option 'weight' '3'(1-1000的范围

config 'member' 'wan1_m2_w3'
        option 'interface' 'wan1'
        option 'metric' '2'
        option 'weight' '3'

config 'member' 'wan2_m1_w2'
        option 'interface' 'wan2'
        option 'metric' '1'
        option 'weight' '2'

config 'member' 'wan2_m2_w2'
        option 'interface' 'wan2'
        option 'metric' '2'
        option 'weight' '2'

# After that create a routing policy. A routing policy consist of one or more(然后创建一条路由策略。包括一个或者几个成员。每个策略必须有正确的名称。可以创建多重策略,以至于可以使不同的通信走不同的主/次wan口
# members. Give each policy a correct name (A-Z, a-z, 0-9, "_" and no spaces). You
# can create multiple policies, so that it is possible for different traffic to
# have different primary and/or backup interfaces.

config 'policy' 'wan1_only'(只走wan1
        list 'use_member' 'wan1_m1_w3'

config 'policy' 'wan2_only'(只走wan2
        list 'use_member' 'wan2_m1_w2'

config 'policy' 'wan1_wan2_loadbalanced'(wan1、wan2负载平衡
        list 'use_member' 'wan1_m1_w3'
        list 'use_member' 'wan2_m1_w2'

config 'policy' 'wan1_pri_wan2_sec'(wan1主,wan2次
        list 'use_member' 'wan1_m1_w3'
        list 'use_member' 'wan2_m2_w2'

config 'policy' 'wan2_pri_wan1_sec'(wan2主,wan1次
        list 'use_member' 'wan1_m2_w3'
        list 'use_member' 'wan2_m1_w2'

# And to finish the config define your traffic rules. Rules are matched in top to(最后来设置通信规则。他是从你设置的规则由上到下依次匹配,如果你定义的一条规则匹配上了,后面的规则都将忽略。如果平衡选项已经设置,mwan3将使每一个新的包走同一个目标主机地址来到达负载平衡,如果没有设置,那么mwan3会根据目标地址自动负载平衡
# bottom order. If you define a rule and it matches, all following rules are ignored.
#
# If the option equalize is set, mwan3 will load-balance each new session to the same
# host. If not set, it will load-balance based on destination.

config 'rule'
        option 'src_ip' '192.168.21.0/24'(源IP,支持网段的表示方法
        option 'proto' 'tcp'(指定协议
        option 'dest_port' '563'(目标端口
        option 'use_policy' 'wan2_only'(指定走上面设定的哪个策略

config 'rule'
        option 'src_ip' '192.168.21.0/24'
        option 'proto' 'tcp'
        option 'dest_port' '995'
        option 'use_policy' 'wan1_only'

config 'rule'
        option 'dest_ip' '88.154.0.0/16'(目标IP
        option 'proto' 'tcp'
        option 'dest_port' '1024:65535'(1024-65535的所有端口
        option 'equalize' '1'(1为选中。如果选中,mwan3将使每一个新的包走同一个目标主机地址来到达负载平衡。如果没有,那么mwan3会根据目标地址自动负载平衡

        option 'use_policy' 'wan1_wan2_loadbalanced'

config 'rule'
        option 'dest_ip' '77.11.41.0/24'
        option 'proto' 'tcp'
        option 'dest_port' '1024:65535'
        option 'use_policy' 'wan1_pri_wan2_sec'

config 'rule'
        option 'dest_ip' '112.136.0.0/16'
        option 'proto' 'udp'
        option 'dest_port' '5352'
        option 'use_policy' 'wan2_pri_wan1_sec'

config 'rule'
        option 'dest_ip' '0.0.0.0/0'
        option 'use_policy' 'wan1_wan2_loadbalanced'


我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2012-10-17 19:27 | 显示全部楼层
isp封了多拨,没法测试,供大家参考
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-17 20:42 | 显示全部楼层
谢谢楼主的无私奉献,正在找这个资料
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-17 20:57 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-17 21:05 | 显示全部楼层
感谢楼主的解说。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-17 21:50 | 显示全部楼层
多拨一个,但是发现用mwam3做负债均衡,cpu吃不消,都3.67了,没开别的程序,我的是mw4530r。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-17 21:59 | 显示全部楼层
这个要顶~LS的3.67夸张了吧。。我配置7wan几乎为零啊~mw4530r
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-18 08:40 | 显示全部楼层
这个要支持啊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-18 12:44 | 显示全部楼层
我是自己用macvlan虚拟了一个网卡的,拨号成功,然后mwan3叠加,结果一开迅雷,cpu就到了3.67了,路由luci界面动都动补了,不知道是什么原因。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-18 20:03 | 显示全部楼层
很强大呀,我收藏一下,以后有用
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-18 23:54 | 显示全部楼层
谢谢楼主的分享,正需要这个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-10-19 10:46 | 显示全部楼层
楼主的解释不错,小白学习了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-11-8 21:43 | 显示全部楼层
谢谢楼主的无私奉献,正在找这个资料
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2013-1-8 11:19 | 显示全部楼层
学习折腾
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2013-2-19 13:13 | 显示全部楼层
haidao_925 发表于 2012-10-17 21:59
这个要顶~LS的3.67夸张了吧。。我配置7wan几乎为零啊~mw4530r

3g多WAN,但老是走最后上来的那个3G-wan口,配置有问题啊。。。先学习学习
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-20 09:43

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表