找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6578|回复: 5

[负载平衡] nth 和pcc有什么不同,高手进来指点

[复制链接]
发表于 2010-6-26 22:34:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
我用nth和pcc做过负载均衡,都成功了,但是nth总有一条一直没有流量, pcc都有,
脚本如下,请高手指点一下这两者有什么不同,为什么nth的第五条线路总没有流量
/ip firewall mangle
add action=mark-connection chain=prerouting comment=nth_1 connection-state=\
    new disabled=no new-connection-mark=nth_1 nth=6,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_1 \
    disabled=no new-routing-mark=routing_1 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment=nth_2 connection-state=\
    new disabled=no new-connection-mark=nth_2 nth=5,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_2 \
    disabled=no new-routing-mark=routing_2 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment=nth_3 connection-state=\
    new disabled=no new-connection-mark=nth_3 nth=4,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_3 \
    disabled=no new-routing-mark=routing_3 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment=nth_4 connection-state=\
    new disabled=no new-connection-mark=nth_4 nth=3,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_4 \
    disabled=no new-routing-mark=routing_4 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment=nth_5 connection-state=\
    new disabled=no new-connection-mark=nth_5nth=2,1 passthrough=yes \
    src-address=192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_5 \
    disabled=no new-routing-mark=routing_5 passthrough=no src-address=\
    192.168.10.0/24
add action=mark-connection chain=prerouting comment=nth_6 connection-state=\
    new disabled=no new-connection-mark=nth_6 passthrough=yes src-address=\
    192.168.10.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=nth_6 \
    disabled=no new-routing-mark=routing_6 passthrough=no src-address=\
    192.168.10.0/24

/ip firewall nat
add action=masquerade chain=srcnat comment=1 connection-mark=nth_1 disabled=\
    no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment=2 connection-mark=nth_2 disabled=\
    no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment=3 connection-mark=nth_3 disabled=\
    no out-interface=pppoe-out3
add action=masquerade chain=srcnat comment=4 connection-mark=nth_4 disabled=\
    no out-interface=pppoe-out4
add action=masquerade chain=srcnat comment=5 connection-mark=nth_5 disabled=\
    no out-interface=pppoe-out5
add action=masquerade chain=srcnat comment=6 connection-mark=nth_6 disabled=\
    no out-interface=pppoe-out6
add action=masquerade chain=srcnat comment=nat disabled=no

/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out2 routing-mark=routing_2
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out3 routing-mark=routing_3
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out4 routing-mark=routing_4
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out1 routing-mark=routing_1
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out5 routing-mark=routing_5
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out5 routing-mark=routing_6



pcc脚本

/ip firewall mangle
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses:8/0 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses:8/1 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=3 passthrough=yes per-connection-classifier=both-addresses:8/2 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=4 passthrough=yes per-connection-classifier=both-addresses:8/3 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=5 passthrough=yes per-connection-classifier=both-addresses:8/4 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=6 passthrough=yes per-connection-classifier=both-addresses:8/5 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=7 passthrough=yes per-connection-classifier=both-addresses:8/6 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=8 passthrough=yes per-connection-classifier=both-addresses:8/7 src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=3 disabled=no new-routing-mark=3 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=4 disabled=no new-routing-mark=4 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=5 disabled=no new-routing-mark=5 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=6 disabled=no new-routing-mark=6 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=7 disabled=no new-routing-mark=7 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting  connection-mark=8 disabled=no new-routing-mark=8 passthrough=yes src-address=192.168.10.0/24
/ip route
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=1
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=2
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=3
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=4
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out5 routing-mark=5
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out6 routing-mark=6
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out7 routing-mark=7
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out8 routing-mark=8
routeros
发表于 2010-6-27 00:34:13 | 显示全部楼层
呵呵,没空看脚本,都差不多,nth平衡些,pcc没网银问题
routeros
回复

使用道具 举报

发表于 2013-11-30 20:49:00 | 显示全部楼层
NTH分比,NTH分比
routeros
回复

使用道具 举报

发表于 2014-3-6 04:08:43 | 显示全部楼层
那是因为你NTH第五条和第六条都没有取值。那肯定有一条没有流量
routeros
回复

使用道具 举报

发表于 2014-3-6 09:08:05 | 显示全部楼层
pcc passthrough=yes
routeros
回复

使用道具 举报

发表于 2014-3-6 11:30:38 | 显示全部楼层
NTH是NEW链接计数,PCC是每链接计数,这是最关键区别
routeros
回复

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-11-23 13:05 , Processed in 0.047921 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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