找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5368|回复: 3

[脚本] 请问双内线双外线如何做负载均衡(麻烦高手帮我看下脚本对不对)

[复制链接]
发表于 2009-4-7 08:17:55 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 yanggame81 于 2009-4-8 08:04 编辑

由于工作环境需要,内网有两个网段是用物理隔离开的,分别接LAN1跟LAN2。
双ADSL,请问要如何做负载均衡呢?
routeros
发表于 2009-4-7 09:21:51 | 显示全部楼层
和一个 是一样的不过是多点 步骤
routeros
回复

使用道具 举报

 楼主| 发表于 2009-4-7 11:47:06 | 显示全部楼层
谢谢!
不过能不能说详细点呢
routeros
回复

使用道具 举报

 楼主| 发表于 2009-4-7 20:03:53 | 显示全部楼层
本帖最后由 yanggame81 于 2009-4-7 20:14 编辑

麻烦高手帮我看下脚本对不对,红色部分为我依照单内网加的

/ ip firewall mangle  
add chain=prerouting src-address-list=odd in-interface=lan1 action=mark-connection new-connection-mark=odd passthrough=yes  
add chain=prerouting src-address-list=odd in-interface=lan1 action=mark-routing new-routing-mark=odd

/ ip firewall mangle  
add chain=prerouting src-address-list=even in-interface=lan1 action=mark-connection new-connection-mark=even passthrough=yes  
add chain=prerouting src-address-list=even in-interface=lan1 action=mark-routing new-routing-mark=even




/ ip firewall mangle  
add chain=prerouting src-address-list=odd in-interface=lan2 action=mark-connection new-connection-mark=odd passthrough=yes  
add chain=prerouting src-address-list=odd in-interface=lan2 action=mark-routing new-routing-mark=odd

/ ip firewall mangle  
add chain=prerouting src-address-list=even in-interface=lan2 action=mark-connection new-connection-mark=even passthrough=yes  
add chain=prerouting src-address-list=even in-interface=lan2 action=mark-routing new-routing-mark=even



/ ip firewall mangle  
add chain=prerouting in-interface=lan1 connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=lan1 action=add-src-to-address-list address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes  
add chain=prerouting in-interface=lan1 connection-mark=odd action=mark-routing new-routing-mark=odd passthrough=no

/ ip firewall mangle  
add chain=prerouting in-interface=lan2 connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=lan2 action=add-src-to-address-list address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes  
add chain=prerouting in-interface=lan2 connection-mark=odd action=mark-routing new-routing-mark=odd passthrough=no



/ ip firewall mangle  
add chain=prerouting in-interface=lan1 connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=lan1 action=add-src-to-address-list address-list=even address-list-timeout=1d connection-mark=even passthrough=yes  
add chain=prerouting in-interface=lan1 connection-mark=even action=mark-routing new-routing-mark=even passthrough=no

/ ip firewall mangle  
add chain=prerouting in-interface=lan2 connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=lan2 action=add-src-to-address-list address-list=even address-list-timeout=1d connection-mark=even passthrough=yes  
add chain=prerouting in-interface=lan2 connection-mark=even action=mark-routing new-routing-mark=even passthrough=no



add chain=prerouting in-interface=lan1 connection-state=new nth=1,1,1 src-address-list=!odd action=mark-connection new-connection-mark=even passthrough=yes



add chain=prerouting in-interface=lan2 connection-state=new nth=1,1,1 src-address-list=!odd action=mark-connection new-connection-mark=even passthrough=yes

/ ip firewall nat  
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 to-ports=0-65535  
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 to-ports=0-65535



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

/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.2 scope=255 target-scope=10
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-22 01:28 , Processed in 0.104099 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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