Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Set Oray in routeros of local area network

Shulou Source: shulou.com Published: 2022-06-01 10:00:57 10月26日 Update

   routeros can run Oray, but in Oray's official script, routeros is the default Internet router.

   (Oray official documentation: http://service.oray.com/question/869.html)

{local ipaddrlocal server "http://ddns.oray.com"local domain" domain name "local par" / ph/update\? & hostname=$domain&myip=$ipaddr "local users" username "local paswd" password "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}

   can see from line 8 that the script treats the IP of the pppoe-out1 interface as a public network IP, which means that routeros must be an Internet router for the script to take effect.

   but if routeros is in the local area network (for example, routeros is used as an intranet server) and there is a layer of router outside, then the script must be modified, as long as routeros can also access the Internet.

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

The first five lines of code in    is to let routeros get the current public network IP online, save it in mypublicip.txt, then log in to Oray and register IP.

   (reference: https://forum.mikrotik.com/viewtopic.php?t=73287)

Tags: Script routing router code domain name official password is the user user name public network local area network local area network that is that is the premise is interface document server. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker NVidia MariaDB Shulou Technology