找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2749|回复: 1

[脚本] 请帮忙看下这个脚本什么地方不对?

[复制链接]
发表于 2008-10-30 12:02:25 | 显示全部楼层 |阅读模式

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

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

×
:local assign-address
:local new-address
:local status
:local x
:set x 4
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("pppoe-out" . $i)] running]
:if ($status=true) do={
:set new-address [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
:set new-address [:pick $new-address 0 [:find $new-address "/"]]
:set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
:set assign-address [:pick $assign-address 0 [:find $assign-address "/"]]
:if ($assign-address != $new-address) do={
/ip address set [/ip address find comment=("adsl" . $i)] address=$new-address network=$new-address broadcast=$new-address
/ip fir nat set [/ip fir nat find comment=("adsl" . $i)] to-addresses=$new-address
/ip route set [/ip route find comment=("adsl" . $i)] gateway=$new-address
}
}
}


nat那个地方我做了comment  adsl1-4但是这个脚本填写不了IP地址。不知道那个地方错了。
/ip fir nat set [/ip fir nat find comment=("adsl" . $i)] to-addresses=$new-address
routeros
发表于 2008-10-30 14:14:57 | 显示全部楼层
COMMENT值不要带横杠
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-8 04:40 , Processed in 0.061502 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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