LAN routeros set Oray

  routeros can run Oray, but in the official script in Oray, routeros default as the Internet router.
  (Oray official document: 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
}

  As can be seen from the line eighth code, the script is the IP pppoe-out1 interface as the public network IP, that is to say routeros Internet router must be the script to take effect.

  But if routeros is inside the LAN (eg routeros as a network server), as well as the outside layer of the router, then the script would have to make changes, provided that routeros access to the Internet.

{
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; 
}

  The first five lines of code that make routeros the Internet to get the current public network IP, and stored in mypublicip.txt then landed Oray, registered IP.
  (Reference: https://forum.mikrotik.com/viewtopic.php?t=73287 )

Guess you like

Origin blog.51cto.com/trance/2449205
set
set