找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4430|回复: 3

[负载平衡] NTH load balancing with masquerade

[复制链接]
发表于 2010-3-14 19:56:39 | 显示全部楼层 |阅读模式

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

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

×
原文见
http://wiki.mikrotik.com/wiki/NTH_load_balancing_with_masquerade

我读了之后感觉准确的做法应如下:

/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1

/ ip firewall mangle
add chain=prerouting src-address-list=odd in-interface=Local action=mark-connection \
  new-connection-mark=odd passthrough=yes
add chain=prerouting src-address-list=odd in-interface=Local action=mark-routing \
  connection-mark=odd new-routing-mark=odd passthrough=no                                            //有变
add chain=prerouting src-address-list=even in-interface=Local action=mark-connection \
  new-connection-mark=even passthrough=yes
add chain=prerouting src-address-list=even in-interface=Local action=mark-routing \
  connection-mark=even new-routing-mark=even passthrough=no                                        //有变

add chain=prerouting in-interface=Local connection-state=new nth=2,1 \
    src-address-list=!even action=mark-connection new-connection-mark=odd \                    //有变
    passthrough=yes
add chain=prerouting in-interface=Local action=add-src-to-address-list \
  address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing \
    new-routing-mark=odd passthrough=no

add chain=prerouting in-interface=Local connection-state=new nth=2,2 \
    src-address-list=!odd action=mark-connection new-connection-mark=even \                        //有变
    passthrough=yes
add chain=prerouting in-interface=Local action=add-src-to-address-list \
  address-list=even address-list-timeout=1d connection-mark=even passthrough=yes
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing \
    new-routing-mark=even passthrough=no

/ ip firewall nat
add chain=srcnat out-interface=wlan1 action=masquerade
add chain=srcnat out-interface=wlan2 action=masquerade

/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10

我有一个地方不明白,为何一定要先做"标记连接"的事,不可以直接就"标记路由"吗,这样就可少写一条规则?
还有一个不太明白,这里的标记连接是作用在"连接"上,还是作用在"包"上。
另我上面私自作的变化是对还是错?
routeros
发表于 2010-3-14 20:31:12 | 显示全部楼层
对与错你试验下就知道了
routeros
回复

使用道具 举报

发表于 2010-3-14 23:59:48 | 显示全部楼层
试一下就知了
routeros
回复

使用道具 举报

发表于 2010-3-22 16:20:01 | 显示全部楼层
这个是平衡吧,是平衡的做法吧!
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 06:54 , Processed in 0.051283 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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