找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: mching

[策略设置] 【RouterOS】ADSL多线详解,无脚本更新IP,无脚本断线自动切换

  [复制链接]
发表于 2010-12-13 08:13:10 | 显示全部楼层
本帖最后由 在天之鸟 于 2010-12-13 08:13 编辑

那还要交换机支持的吗?
routeros
回复

使用道具 举报

发表于 2011-1-1 23:13:01 | 显示全部楼层
本帖最后由 blacker 于 2011-1-1 23:16 编辑

给你改写一下

/ip firewall address-list add list=lan address=0.0.0.0/0
:global x 11
:for i from=2 to=$x do={/interface vlan add name=("vlan".$i) vlan-id=$i interface=ether1}
:for i from=2 to=$x do={/interface bridge add name=("bridge".$i) protocol-mode=rstp admin-mac=("00:0C:42:2B:75:8".($i-2))}
:for i from=2 to=$x do={/interface bridge port add interface=("vlan".$i) bridge=("bridge".$i)}
:for i from=2 to=$x do={/ppp profile add change-tcp-mss=default comment="" name=("pppoe-nat".$i) only-one=default remote-address=("10.0.0.".$i) use-compression=default use-encryption=default use-vj-compression=default}
:for i from=2 to=$x do={/interface pppoe-client add name=("pppoe-out".$i) interface=("bridge".$i) profile=("pppoe-nat".$i)}
/ip firewall nat add action=masquerade chain=srcnat comment="" disabled=no
:for i from=2 to=$x do={/ip firewall mangle add action=mark-connection chain=prerouting connection-state=new disabled=no in-interface=lan new-connection-mark=(.$i) nth=((.$x)","(.$i)) passthrough=yes}
:for i from=2 to=$x do={/ip route add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=("10.0.0.".$i) routing-mark=(.$i) scope=255 target-scope=10}

最后这个
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4 scope=255 target-scope=10
没搞懂怎么加不上去
我的代码是这样写的
/ip route add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=(:for i=2 to=(.$x-1) do={("10.0.0.".$i),}10.0.0.$x) scope=255 target-scope=10
加不上去,只有在winbox里手动搞一下,ROS 4.16 版本在2011元旦测试通过
routeros
回复

使用道具 举报

发表于 2011-1-1 23:18:03 | 显示全部楼层
回复 在天之鸟 的帖子

是的,需要支持802.1Q的交换机才可以
routeros
回复

使用道具 举报

发表于 2011-1-31 00:34:12 | 显示全部楼层
简单实用的办法,不过还是没得NAT速度快
routeros
回复

使用道具 举报

发表于 2011-1-31 11:38:28 | 显示全部楼层
写不很好,谢谢啦。
routeros
回复

使用道具 举报

发表于 2011-6-17 13:35:50 | 显示全部楼层
看的我是一头雾水~
routeros
回复

使用道具 举报

发表于 2011-6-18 12:55:40 | 显示全部楼层
学习一下,楼主这个是走NTH吧,这是PCC的哦
routeros
回复

使用道具 举报

发表于 2011-6-18 23:56:54 | 显示全部楼层
这篇文章真不错,可惜这么晚才看到.
routeros
回复

使用道具 举报

发表于 2011-6-21 16:07:29 | 显示全部楼层
原创,这个一定要顶。
routeros
回复

使用道具 举报

发表于 2011-6-26 00:26:38 | 显示全部楼层
帮顶下。帮顶下。
routeros
回复

使用道具 举报

发表于 2011-6-26 23:07:17 | 显示全部楼层
呵呵,刚开始学习ROS
routeros
回复

使用道具 举报

发表于 2011-7-30 23:34:14 | 显示全部楼层
很细心,很实用...这种分享精神无价..........
routeros
回复

使用道具 举报

发表于 2011-7-31 00:08:05 | 显示全部楼层
废话满篇。说穿了代码不过10行。
routeros
回复

使用道具 举报

发表于 2012-7-2 00:39:00 | 显示全部楼层
种分享精神无价..........
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-17 13:09 , Processed in 0.068404 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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