Hi guys, i have a little problem.
My api work perfectly on localhost , but the problem is when I move the .php page on my web hosting (ex http://www.example.com ) .
If I open my .php from my web hosting I get the following errors :
"Connection attempt #1 to 192.168.1.xxx:8728… Connection attempt #2 to 192.168.1.xxx:8728… Connection attempt #3 to 192.168.1.xxx:8728… Connection attempt #4 to 192.168.1.xxx:8728… Connection attempt #5 to 192.168.1.xxx:8728… Error… "
I opened the port 8728 ( api ) and 90 ( www ) , but still not be able to connect to mikrotik via my web space.
The code of the .php page in my xampp ( my local web server ) and the .php page hosted on my space web is the same.
I have to give the mikrotik a public ip ?
How can I do?
Everyone can help me?
Thanks !
Yes. You need to have a public IP. If this router serves internet, it probably already has one, assigned by your ISP. You can see it in “/ip address”.
In addition to that, you need to make sure port 8728 is accessible from the interface your ISP’s cable is in.
Last, but not least, your web hosting provider must allow you to do outgoing connections in their firewall… But before you ask them to do so (if they haven’t already), you can try to access the router from your local web server, but with the public IP.
How i can set a public ip?
I need to set a public ip for the ether2 ( where i have now my hospot ) ??
Thanks man for your help, and sorry, but i’m new in mikrotik.
Like I said, you already have one, given by your ISP. You can see it by going to the “/ip address” menu. The address on “ether1” is the one you need to use.
Yes man.
One question, i need allow_url_fopen is set on ON? Because i have see my phpinfo.php and i have saw is set on off.
Thanks for your help.
No. You don’t need to have it on.
Ok.
At this moment i have set 192.168.1.88 at the eth1, and i have open the port 90(www) and 8728(api) for this IP.
I have set for the eth2 this IP: 192.168.88.1 and the hotspost with my radius server work perfect.
The api work perfect but only in localhost ( with xampp ), and not on my web hosting.
The code can i use for connect the api is: if ($API->connect(‘192.168.1.88’, ‘admin’, ‘’) )
In localhost work perfect, but on my hosting, no.
Thanks again.
Did you have any solution? the same happens to me
Go Ip Cloud check all box, take the DNS Name and put in the file on place of 192.168.88.1 its simple. because you use the private ip in localhost and work, but your want to work in a remote conexion and needs a public ip.