Code: Select all
/ip firewall nat add action=dst-nat chain=dstnat comment=for_reporting dst-port=14441 protocol=tcp src-address=*.*.*.0/24 to-addresses=192.168.1.1 to-ports=80
Code: Select all
$header = "Referer: **ELIDED**"
$data = "{'jsonrpc':'2.0','method':'GetSystemInfo','params': '','id':'13,1'}"
$Url = "http://*.*.*.*:14441/jrd/webapi"
./curl -s $Url -H $header -d $data
But when I try to execute the request on Mikrotik - error - status: failed. Command:
Code: Select all
:do {
:if [/system resource usb find vendor=Alcatel] do={
:local bridgegw [/ip route get [find gateway="bridge"] pref-src];
:local header "Referer: **ELIDED**,content-type: application/json";
:local data ("{'jsonrpc':'2.0','method':'GetSystemStatus','params':null,'id':'13.4'}");
:local url "http://$bridgegw:14441/jrd/webapi";
/tool fetch url=$url http-header-field=$header http-data=$data
}} on-error={put ""}