温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

局域网的routeros中设置Oray

发布时间:2020-02-25 10:57:43 来源:网络 阅读:505 作者:reax 栏目:网络安全

  routeros可以运行Oray,但是在Oray的官方脚本中,routeros是默认作为上网路由器的。
  (Oray官方文档:http://service.oray.com/question/869.html)

{ local ipaddr local server "http://ddns.oray.com" local domain "域名" local par "/ph/update\?&hostname=$domain&myip=$ipaddr" local users "用户名" local paswd "密码" :set ipaddr [/ip address get [/ip address find interface=pppoe-out1] address] :set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)] /tool fetch url=($server . $par) mode=http user=$users password=$paswd }

  从第8行代码可以看出,该脚本是将pppoe-out1接口的IP当作公网IP,也就是说routeros必须是上网路由器,该脚本才能生效。

  但是如果routeros是在局域网里面(例如routeros作为内网服务器),外面还有一层路由器,那这个脚本就必须做修改,前提条件是routeros也能上网。

{ local ipaddr; /tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=mypublicip.txt local ip [file get mypublicip.txt contents ] put $ip :set ipaddr "$ip"; local server "http://ddns.oray.com"; local domain "域名"; local par "/ph/update\?&hostname=$domain&myip=$ipaddr"; local users "用户名"; local paswd "密码"; /tool fetch url=($server . $par) mode=http user=$users password=$paswd; }

  前面的5行代码就是让routeros上网获取当前的公网IP,并保存在mypublicip.txt中,然后登陆Oray,注册IP。
  (参考:https://forum.mikrotik.com/viewtopic.php?t=73287)

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI