pear2 / Net_RouterOS

This package allows you to read and write information from a RouterOS host using the MikroTik RouterOS API protocol.
http://pear2.php.net/PEAR2_Net_RouterOS
241 stars 116 forks source link

Unable to connect to the router #64

Open asoko2 opened 4 years ago

asoko2 commented 4 years ago

I try the test script, I got 'Unable to connect to the router' result. I have disabled my firewall, set outbound rule for apache and PHP, still can't get it work.

What's wrong?

Thanks

boenrobot commented 4 years ago

There may be a firewall rule at the router as well.

If it's not in the same LAN as PHP, but is instead accessing the router via a WAN interface, there definetly is one by default.

asoko2 commented 4 years ago

The router and my PHP web server are at the same LAN. And also, the firewall rule is still the default. I didn't change any firewall rules except adding NAT rule for WAN connection.

This is my firewall rule https://imgur.com/gYD8Qzg

And here is the NAT https://imgur.com/pUvJftQ

boenrobot commented 4 years ago

Ah. You're in the same LAN, but have a hotspot there.

The device PHP is running on needs to be allowed by the hotspot, be it via a login, or a bypass rule in ip-bindings.

asoko2 commented 4 years ago

Can you show me how to do it? Allow the PHP to connect via the hotspot?