找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4634|回复: 11

[其它] [转贴]双WAN不同网关,单LAN设置,成功

[复制链接]
发表于 2007-1-24 18:58:35 | 显示全部楼层 |阅读模式

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

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

×
虽然前人已经发表过,但是我觉得还是有意义的,再发表一下
双Wan不同的网关,每个Wan口被限制了4M的下载速度,我按照官网上的设置后,下载的速度已经看到合并在一起了,所以我觉得是成功了,

[ 本帖最后由 you98 于 2007-1-24 19:14 编辑 ]

网络结构

网络结构
routeros
 楼主| 发表于 2007-1-24 19:00:33 | 显示全部楼层
设置routeros网卡的IP地址

/ ip address
add address=1.1.1.50/24 network=1.1.1.0 broadcast=1.1.1.255 interface=Local comment="" \
    disabled=no
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2 \
    comment="" disabled=no
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1 \
    comment="" disabled=no

设置防火墙
/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=odd passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing \
    new-routing-mark=odd passthrough=no comment="" disabled=no
add chain=prerouting in-interface=Local connection-state=new nth=1,1,1 \
    action=mark-connection new-connection-mark=even passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing \
    new-routing-mark=even passthrough=no comment="" disabled=no

做NAT转换
/ ip firewall nat
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 \
    to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 \
    to-ports=0-65535 comment="" disabled=no

设置路由
/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd \
    comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even \
    comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 comment="" \
    disabled=no
routeros
回复

使用道具 举报

发表于 2007-1-24 20:39:08 | 显示全部楼层
这样对我线程来说效果不错,可以说达到N倍速度增长
实际应用中有些问题
如:传奇、网络银行、证券、森吧电影网在这样的模式下有可能不能正常访问
如果是3线以上的话,能访问以上网络的机会就越小
对以上网络需要按源IP地址分流才能正常访问
routeros
回复

使用道具 举报

发表于 2007-1-24 20:49:51 | 显示全部楼层
以上设置中按新连接累计奇偶来标记连接,然后在又根据连接标记来添加路由标记,源地址转换按连接标记转换,路由表按路由标记路由,这是不是显得有点多此一举?

直接在累计奇偶时标记路由不就行了吗?源地址转换时按路由标记转换
routeros
回复

使用道具 举报

发表于 2007-1-24 20:57:41 | 显示全部楼层
有固定IP的肯定好弄啥。楼主发动态ADSL的。别告诉我你的图就是ADSL的。。那不是又猫先路由?
routeros
回复

使用道具 举报

发表于 2007-1-24 22:55:19 | 显示全部楼层
固定IP当然好做了。动态的加个脚本不就行了吗。我的也是动态的ADSL呀,三条,也是用上面方法
everest79
你先实验再说吧
routeros
回复

使用道具 举报

发表于 2007-1-24 23:22:50 | 显示全部楼层
大哥 这样回流能弄吗
routeros
回复

使用道具 举报

 楼主| 发表于 2007-1-25 11:40:39 | 显示全部楼层
根据图上表示的,是规定IP地址来的
routeros
回复

使用道具 举报

 楼主| 发表于 2007-1-25 11:42:05 | 显示全部楼层
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=odd passthrough=yes comment="" \
    disabled=no

我看到论坛里面,有人说passthrough=yes要改为passthrough=no
但是这样做,就无法连接到外部网络,我还不知道为什么
我也是新手来的
routeros
回复

使用道具 举报

发表于 2007-1-25 12:57:12 | 显示全部楼层
我不相信你是新手,新手能做出这样的规则?
action=mark-connection 肯定是要passthrough=yes
因为还在添加action=mark-routing才能正确的路由
action=mark-routing后就要passthrough=no。做完action=mark-routing确定了路由后,下面的规则就可以不用执行了
routeros
回复

使用道具 举报

发表于 2007-1-25 17:26:18 | 显示全部楼层
原帖由 younger 于 2007-1-24 22:55 发表
固定IP当然好做了。动态的加个脚本不就行了吗。我的也是动态的ADSL呀,三条,也是用上面方法
everest79
你先实验再说吧


我自已的NAT就是以路由标记来做SNAT的,所以我觉得行,younger若是有问题请讲出来好吗
routeros
回复

使用道具 举报

 楼主| 发表于 2007-1-26 18:02:00 | 显示全部楼层

回复 #10 younger 的帖子

呵呵,我的确是新手啊,
这个我都说了,是官方网站上说明的,我都是把官方网站的资料COPY下来的,所以我采用的是转贴
而且论坛里面早就有人发表了,我只是觉得比较经典的问题,借花献佛而已了
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-5 17:31 , Processed in 0.066650 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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