找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4025|回复: 3

[脚本] ros3.3在终端下执行脚本成功,script下run却没有效果

[复制链接]
发表于 2013-1-30 00:25:16 | 显示全部楼层 |阅读模式

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

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

×
  1. :global newipaddress
  2. :global lodipaddress
  3. :set newipaddress [/ip address get [/ip address find dynamic=yes interface="pppoe-out1"] address]
  4. :set newipaddress [:pick $newipaddress 0 ([:len $newipaddress] -3)]
  5. :set lodipaddress [/ip firewall nat get [/ip firewall nat find comment="80"] dst-address]
  6. :if ($newipaddress != $lodipaddress) do={/ip firewall nat set [/ip firewall nat find comment="80"] dst-address=$newipaddress}
复制代码
上面是网络上找到的代码,在终端下执行,通过:put也可以看到获取到的地址是正确的。
终端下全部复制执行也可以成功,但是添加到script下,点击run,却没有任何效果。。。请问是问什么呢?
哪位提示一下,谢谢!
routeros
发表于 2013-1-30 00:26:45 | 显示全部楼层
一般是环境问题···脚本里面定义环境试试
routeros
回复

使用道具 举报

发表于 2013-1-30 00:30:04 | 显示全部楼层
你这个是外网IP地址改变后就自动映射端口是吧。我的是正常的。
routeros
回复

使用道具 举报

 楼主| 发表于 2013-1-30 09:52:55 | 显示全部楼层
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 03:22 , Processed in 0.099534 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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