找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2956|回复: 2

[脚本] 这个脚本运行不起来怎么回事啊

[复制链接]
发表于 2007-6-12 02:46:26 | 显示全部楼层 |阅读模式

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

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

×
:local ip1 [/ip add get [/ip add find broa=0.0.0.0 interface="pppoe-out1"] address]
:local ip2 [/ip add get [/ip add find broa=0.0.0.0 interface="pppoe-out2"] address]
:local ip3 [/ip add get [/ip add find broa=0.0.0.0 interface="pppoe-out3"] address]
:local ip11 [/ip add get [/ip add find comment= "pppoe-out1"] network]
:local ip12 [/ip add get [/ip add find comment= "pppoe-out2"] network]
:local ip13 [/ip add get [/ip add find comment= "pppoe-out3"] network]
:set ip1[:pick $ip1 0 [:find $ip1 "/"]]
:set ip2[:pick $ip2 0 [:find $ip2 "/"]]
:set ip3[:pick $ip3 0 [:find $ip3 "/"]]
:if $ip1 != $ip11 do={
/ip add set [/ip add find comment="pppoe-out1"] address=$ip1 broa=$ip1 network=$ip1
/ip route set [/ip route find comment="pppoe-out1"] gateway=$ip1
}
:if $ip2 != $ip12 do={
/ip add set [/ip add find comment="pppoe-out2"] address=$ip2 broa=$ip2 network=$ip2
/ip route set [/ip route find comment="pppoe-out2"] gateway=$ip2
}
:if $ip3 != $ip13 do={
/ip add set [/ip add find comment="pppoe-out3"] address=ip3 broa=$ip3 network=$ip3
/ip route set [/ip route find comment="pppoe-out3"] gateway=$ip3
}

以注好了comm
routeros
发表于 2007-6-12 03:09:23 | 显示全部楼层
:if $ip1 != $ip11 do={   这里错了,

  :if ($ip1 != $ip11) do={      这样才是正解,少了(   )
routeros
回复

使用道具 举报

 楼主| 发表于 2007-6-12 03:52:45 | 显示全部楼层
谢谢!!粗心了没看全晕了
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-29 11:29 , Processed in 0.044254 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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