Community discussions

MikroTik App

Search found 59 matches

by patrickclover
Fri Oct 21, 2016 3:22 pm
Forum: RouterBOARD hardware
Topic: Hotspot firewall to block ether1
Replies: 3
Views: 1107

Re: Hotspot firewall to block ether1

In this instance the Mikrotik picks up and address on ethernet port 1 of 192.168.1.4 and issues hotspot addresses on 192.168.88.0/24.

A device with the address 192.168.88.3 can access all of the devices containing 192.168.1.x....

is this normal?
by patrickclover
Thu Oct 20, 2016 5:42 pm
Forum: RouterBOARD hardware
Topic: Hotspot firewall to block ether1
Replies: 3
Views: 1107

Hotspot firewall to block ether1

Hi,

At the moment when a user connects to the hotspot network they have full access to all of the devices from the DHCP range (192.168.0.x) how do I block LAN access from hotspot clients?

Thanks in advance.
by patrickclover
Wed May 06, 2015 6:06 pm
Forum: Scripting
Topic: Hotspot host to hotspot active
Replies: 2
Views: 1993

Re: Hotspot host to hotspot active

You can't make it "active" in the sense of logging the user in. But you can make a binding of type "bypassed", where for this particular host, the router will work as if there was no hotspot enabled (i.e. you need to "manually" do stuff like rate limitations based on t...
by patrickclover
Wed May 06, 2015 4:25 pm
Forum: Scripting
Topic: Hotspot host to hotspot active
Replies: 2
Views: 1993

Hotspot host to hotspot active

Im trying to make a script that takes a mac from the host list and makes it active, is this doable? I've seen the /ip hotspot active add copy-from= but not too sure how to get it to add to active from a mac in the host?

Any help would be hugely appreciated.
by patrickclover
Wed Apr 22, 2015 9:23 am
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Ahh this does work but then I can't return on it because php doesn't work asynchronously, is there a work around for this callback? I'm assuming you're talking about the second quoted code (since the first contains no calls to getType())? In the latest version, Response::getArgument() was renamed to...
by patrickclover
Tue Apr 21, 2015 2:25 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Im trying to use this method again for another use case but am having an issue... i seem to be getting this Call to a member function getType() on a non-object. Could you lend a hand? could it be something to do with the memory buffer? You'd need to use $client->sendAsync(), and then cancel the comm...
by patrickclover
Sun Oct 12, 2014 7:26 pm
Forum: Scripting
Topic: uPnP Mikrotik API
Replies: 1
Views: 994

uPnP Mikrotik API

I use the Mikroitk API (PHP PEAR2) alot,

I use the following setup Generic Modem/Router -> Mikrotik -> Access Point.

I was wondering instead of opening up ports on my router so my server can see the mikrotik is there anyway of having the mikrotik open the ports on the router using uPnP?

P
by patrickclover
Fri Aug 08, 2014 8:19 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Im getting this error, not too sure how to go about debugging... Fatal error: Uncaught exception 'PEAR2\Net\RouterOS\DataFlowException' with message 'No such request. Canceling aborted.' in phar:///var/sites/f/url/public_html/system/PEAR2_Net_RouterOS-1.0.0b4.phar/PEAR2_Net_RouterOS-1.0.0b4/src/PEAR...
by patrickclover
Fri Aug 08, 2014 7:20 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Im not sure i know how to get the info in webfig /interface ethernet ether1...
by patrickclover
Fri Aug 08, 2014 7:08 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

I don't know how to get the ethernet data using the API once the file download has started.

:? almost too simple 8)
by patrickclover
Fri Aug 08, 2014 5:04 pm
Forum: Scripting
Topic: Send files / folders to mikrotik using fetch PHP
Replies: 1
Views: 1290

Send files / folders to mikrotik using fetch PHP

Is there anyway to send files to the mikrotik using PHP ie send folder from /location/hotspot to mikrotik?

Patrick
by patrickclover
Fri Aug 08, 2014 3:19 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

This would also include connected clients which is ideal.
by patrickclover
Fri Aug 08, 2014 3:18 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

I think I have found another possible way.

The Max ether1 traffic when the file is downloaded is almost always the speed of the line... If its doable to get median of 3 highest values on the ethernet port? (which is always ether1)...

maybe...
by patrickclover
Fri Aug 08, 2014 2:24 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

The primary reason I included the date was if you happen to run the test near midnight (as, in fact, I actually did my tests on...) and I included the timezone in case you run the test when the timezone is on the edge of a DST shifting hour (e.g. you start it at 3:59:58, but it passed over to 4:00:...
by patrickclover
Fri Aug 08, 2014 6:16 am
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Been testing this out for several hours now, found a few issues and possibly improvements. Getting the date / timezone seemed un needed as all we want is the difference in seconds so I've modified your original method... //BTW, ensure we don't halt the test in the middle of it all set_time_limit(0);...
by patrickclover
Thu Aug 07, 2014 2:10 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Think the problem is with the return $speedTestResults getting a null array Array ( [0] => ) which means the return value isn't good?
by patrickclover
Thu Aug 07, 2014 1:46 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

Im getting this error? Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() [<a href='datetimezone.--construct'>datetimezone.--construct</a>]: Unknown or bad timezone ()' in public_html/system/speedtest1.php:39 Stack trace: #0 public_html/system/speedtest1.php(39): D...
by patrickclover
Tue Aug 05, 2014 4:08 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Re: Ping Speed PHP Pear API

That did work just how I had wanted... What I am trying to do is perform a speedtest from the mikrotik and return these results using PHP, the ping-speed isn't giving me results accurate/consistent... im thinking a way to do this would be to fetch a file of 10mb and record how long it takes to fetch...
by patrickclover
Tue Aug 05, 2014 12:51 pm
Forum: Scripting
Topic: Ping Speed PHP Pear API
Replies: 23
Views: 8811

Ping Speed PHP Pear API

I am trying to perform a ping-speed test using PHP PEAR and im not sure how to add a duration for the ping-speed to end in the CLI you press Q to end the test just not sure how to perform a similar action using the API...

Best,
Patrick.
by patrickclover
Tue Aug 05, 2014 12:50 pm
Forum: Scripting
Topic: Rate Limit Using Pear
Replies: 2
Views: 1244

Re: Rate Limit Using Pear

Brilliant that all worked just as expected. Thank you for your help. Just to give anyone else an idea of my end code here $down = $_POST["down"]; $up = $_POST["up"]; $type = $_POST["type"]; $fd = $down."k"; //format down $fu = $up."k"; //format up $r...
by patrickclover
Mon Aug 04, 2014 1:02 pm
Forum: Scripting
Topic: Rate Limit Using Pear
Replies: 2
Views: 1244

Rate Limit Using Pear

Im trying to apply a rate limit to my hotspot using the PHP PEAR API this is the script i currently have: $request = "/ip hotspot profile set Hotspot rate-limit=200k/200k"; $addRequest = new RouterOS\Request($request); $client->sendSync($addRequest); It seems like it should work but it isn...
by patrickclover
Thu Jun 05, 2014 4:27 pm
Forum: Scripting
Topic: Get OS of Client
Replies: 5
Views: 2191

Re: Get OS of Client

I know this, We redirect the html hotspot to a PHP file in our server to do authentication. All you need to do is grab the user agent and then format it to a more usable form. using something like: http://www.quirksmode.org/js/support.html var ua = navigator.userAgent.toLowerCase(); var check = func...
by patrickclover
Thu Jun 05, 2014 3:49 pm
Forum: Scripting
Topic: Get OS of Client
Replies: 5
Views: 2191

Re: Get OS of Client

If your using PHP on hotspot login there are various ways to achieve this.

Php function browser_os()

Best,
Patrick
by patrickclover
Thu Jun 05, 2014 4:07 am
Forum: General
Topic: https problem on hotspot
Replies: 97
Views: 122446

Re: https problem on hotspot

I don't actually mind the error when its a https site... it seems that using the above method does work but still brings up SSL error on every page... is there anyway of getting MT to use https when a https site is requested and using http every other time?

Best,
Patrick.
by patrickclover
Tue May 20, 2014 2:32 am
Forum: General
Topic: zing.zong.co.ua DNS - CPU 100%
Replies: 6
Views: 1690

Re: zing.zong.co.ua DNS - CPU 100%

So you should describe what you did and with what results. I have tried the following... Changing my DNS settings to various different servers, Blocking out the domain of the Name in question (zing.zong.ca.au) using the firewall drop adding this to the firewall to tarpit the fns /ip firewall filter...
by patrickclover
Mon May 19, 2014 10:08 pm
Forum: General
Topic: zing.zong.co.ua DNS - CPU 100%
Replies: 6
Views: 1690

Re: zing.zong.co.ua DNS - CPU 100%

Yes. It is hundred times all around. Read forum fist before you write...
I have and I have tried several of the suggestions with no luck.
by patrickclover
Mon May 19, 2014 8:34 pm
Forum: General
Topic: HTTPS hotspot redirect
Replies: 1
Views: 1691

HTTPS hotspot redirect

Is there anyway of redirecting HTTPS traffic to the hotspot?

a lot of our customers are phoning up saying they are getting an SSL error when they try and do a google search before authenticating...

Just thought i'd ask the question.

P
by patrickclover
Mon May 19, 2014 7:38 pm
Forum: General
Topic: zing.zong.co.ua DNS - CPU 100%
Replies: 6
Views: 1690

zing.zong.co.ua DNS - CPU 100%

Several of our Mikrotiks are experiencing huge amounts of DNS requests from zing.zong.co.ua is there anyway we can block this kind of malicious activity on the Mikrotik automatically?
by patrickclover
Tue Apr 29, 2014 1:46 am
Forum: Scripting
Topic: hotspot data array
Replies: 0
Views: 844

hotspot data array

Is there anyway of getting an array to print for the host data in hotspot? something like this for example. :foreach i in=[/ip hotspot host find] do={ :local mac [/ip hotspot host get $i mac-address] :local data_down [/ip hotspot host get $i byte-out] :global rr { "mac"=$mac; "locatio...
by patrickclover
Fri Apr 25, 2014 5:20 pm
Forum: General
Topic: SNMP
Replies: 3
Views: 1060

Re: SNMP

This is MikroTik forum, not for support to other competitors products.
We are using Mikrotik routerboards (750GL, 750UP & 1200) to manage our existing APs... so i guess this is a question regarding mikrotik products and its ability to collate network information.
by patrickclover
Fri Apr 25, 2014 3:21 pm
Forum: General
Topic: SNMP
Replies: 3
Views: 1060

SNMP

We are using non mikrotik access points and wondered if there was any way of finding out if there is a way for us to gather information about which hotspot client is connected to which access point?

Our APs support SNMP.

Any help is hugely appreciated.
by patrickclover
Wed Feb 26, 2014 1:42 pm
Forum: Scripting
Topic: Router OS API timout
Replies: 1
Views: 1037

Router OS API timout

I am trying to change the timeout as the current seems to be taking ages to establish that it cant establish an api link could someone help with this?

catch (Exception $e) {

}
by patrickclover
Fri Aug 30, 2013 3:08 pm
Forum: General
Topic: Facebook Login
Replies: 1
Views: 1427

Facebook Login

I am looking to do social login using the Mikrotik walled garden only i don't want users to be able to access the main Facebook avenues before they login is there anyway of allowing only the paths that Facebook use to login?
by patrickclover
Mon Aug 12, 2013 4:23 pm
Forum: Scripting
Topic: Reformat time stamp
Replies: 2
Views: 1620

Reformat time stamp

Is there anyway to make use of a timestamp like this? 3w17:00:45 so i could minus is from the current time to find out when the unit was turned on?
by patrickclover
Wed Aug 07, 2013 12:49 am
Forum: Scripting
Topic: IP Scan PEAR2 API
Replies: 3
Views: 2159

Re: IP Scan PEAR2 API

From what I can see, the ping command does not accept a range. However, there's a dedicated "/tool ip-scan" command, which does accept ranges. Your best bet is to use THAT, as opposed to ping. Now... there's two ways to run ip-scan properly: 1. Use the duration parameter, which would &quo...
by patrickclover
Mon Aug 05, 2013 10:06 pm
Forum: Scripting
Topic: IP Scan PEAR2 API
Replies: 3
Views: 2159

IP Scan PEAR2 API

I need to do an a ping scan from 10.4.1.2-10.4.1.100 and have the response ip/latency

is this possible using pear2 api?
by patrickclover
Sun Jul 21, 2013 10:42 pm
Forum: Scripting
Topic: System Print PEAR2 API
Replies: 6
Views: 2001

Re: System Print PEAR2 API

the name is variable though? so might differ depending on router is there a rule to just choose port 0?
by patrickclover
Sun Jul 21, 2013 10:22 pm
Forum: Scripting
Topic: System Print PEAR2 API
Replies: 6
Views: 2001

Re: System Print PEAR2 API

worked great, the peal client is working really well. I'm currently trying to get the rx-bytes and tx-bytes from ether0 any tips on this? currently have this and its giving me values for all the ports not just ether0 any ideas? $result = $client(new RouterOS\Request('/interface/print stats=where=nam...
by patrickclover
Sun Jul 21, 2013 8:06 pm
Forum: Scripting
Topic: System Print PEAR2 API
Replies: 6
Views: 2001

System Print PEAR2 API

Im currently trying to get the router to display the results of /system resource print. It works fine but if one of the 'wan_ips' in my table is offline non of the IPs after it run the script? is there a way to allow the script to bypass failed IPs? or even just echo 'OFFLINE';? as always help is mu...
by patrickclover
Sun Jul 21, 2013 1:05 am
Forum: Scripting
Topic: PEAR2 API Help
Replies: 7
Views: 5680

Re: PEAR2 API Help

that was exactly right. made a NAT rule on the router to translate port 8728 to 443 this solved the host issue and the router will still be accessible on port 80 so this is a healthy solution to me.

Thank you for your help.
by patrickclover
Sun Jul 21, 2013 12:16 am
Forum: Scripting
Topic: PEAR2 API Help
Replies: 7
Views: 5680

Re: PEAR2 API Help

Thank you for your response. I now seem to be getting another error? Fatal error: Uncaught exception 'PEAR2\Net\Transmitter\SocketException' with message 'Failed to initialize socket.' in phar:///home/inkspotw/public_html/cloud/monitor/mikrotik/PEAR2_Net_RouterOS-1.0.0b3.phar/PEAR2_Net_RouterOS-1.0....
by patrickclover
Sat Jul 20, 2013 11:46 pm
Forum: Scripting
Topic: PEAR2 API Help
Replies: 7
Views: 5680

Re: PEAR2 API Help

Here is the full error. Fatal error: Uncaught exception 'Exception' with message 'Class RouterOS\Client could not be loaded from RouterOS/Client.php, file does not exist (registered paths="phar:///home/inkspotw/public_html/cloud/monitor/mikrotik/PEAR2_Net_RouterOS-1.0.0b3.phar/PEAR2_Net_RouterO...
by patrickclover
Fri Jul 19, 2013 9:55 pm
Forum: Scripting
Topic: PEAR2 API Help
Replies: 7
Views: 5680

PEAR2 API Help

I have been trying to run the pear2 api for some time now and keep getting this error message.

/PEAR2/PEAR2_Net_RouterOS-1.0.0b3.phar/PEAR2_Net_RouterOS-1.0.0b3/src/PEAR2/Autoload.php on line 181

is there some way to resolve this?

best,
Patrick.
by patrickclover
Sat Jun 08, 2013 11:21 pm
Forum: Scripting
Topic: PHP API not working on v6.0 Help with PEAR script
Replies: 9
Views: 4514

PHP API not working on v6.0 Help with PEAR script

My php api has stopped working after going to v6.0 I need to try and get the following working using an alternative method... -- $ARRAY = $API->comm("/system/resource/print"); $first = $ARRAY['0']; $wan_ip = $row['wan_ip']; $uptime = $first['uptime']; $cpu_load = $first['cpu-load']; -- $AR...
by patrickclover
Wed Jun 05, 2013 4:05 pm
Forum: Scripting
Topic: Client connected AP
Replies: 3
Views: 1024

Re: Client connected AP

Time Jun/05/2013 13:05:15
Buffer memory
Topics
dhcp
info
Message default assigned 10.4.1.105 to XX:XX:XX:XX:XX:XX

no mention of ap
by patrickclover
Wed Jun 05, 2013 3:57 pm
Forum: Scripting
Topic: Client connected AP
Replies: 3
Views: 1024

Client connected AP

Is there anyway of tracing how a client is getting to the mikrotik? if I have a non Mikrotik access point with a static IP?
by patrickclover
Mon Jun 03, 2013 11:13 pm
Forum: Scripting
Topic: Mikrotik to broadcast wan ip
Replies: 5
Views: 1771

Re: Mikrotik to broadcast wan ip

Sorry! that totally works, thank you very much.
by patrickclover
Mon Jun 03, 2013 11:00 pm
Forum: Scripting
Topic: Mikrotik to broadcast wan ip
Replies: 5
Views: 1771

Re: Mikrotik to broadcast wan ip

almost, this is currently just displaying the ip of my server?

any way to make it show the wan ip of the mikrotik?
by patrickclover
Mon Jun 03, 2013 9:59 pm
Forum: Scripting
Topic: Mikrotik to broadcast wan ip
Replies: 5
Views: 1771

Re: Mikrotik to broadcast wan ip

I want to store the ip in a mysql database that cross referenced with the mikrotiks identity?

Thanks!
by patrickclover
Mon Jun 03, 2013 9:51 pm
Forum: Scripting
Topic: Mikrotik to broadcast wan ip
Replies: 5
Views: 1771

Mikrotik to broadcast wan ip

Is there anyway of getting mikrotik to tell my server what its IP is?
by patrickclover
Tue May 28, 2013 3:48 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

Re: interface ethernet cable-test

Partially got it working, getting a Transmitter/TcpClient.php on line 140?

Fatal error: Uncaught exception 'PEAR2\Net\Transmitter\SocketException' with message 'Failed while receiving initial length byte
by patrickclover
Tue May 28, 2013 2:41 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

Re: interface ethernet cable-test

I think the problem is that the command never terminates if detecting an active connection. For example on ssh the return value is something like: numbers: 1 name: ether2-master-local status: link-ok -- [Q quit|D dump|C-z pause] so wouldn't the "-- [Q quit|D dump|C-z pause]" have to be byp...
by patrickclover
Mon May 27, 2013 8:27 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

Re: interface ethernet cable-test

< numbers > - ... yea saw that it is quite a new addition.

no error is given.
by patrickclover
Mon May 27, 2013 7:34 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

Re: interface ethernet cable-test

that above code doesn't seem to work just get a timeout error?

the code that works using ssh is /interface ethernet cable-test ether3
by patrickclover
Mon May 27, 2013 7:22 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

Re: interface ethernet cable-test

Cant seem to get the PEAR2\Net\RouterOS running how would this look using the PHP API?

Thank you for your help!
by patrickclover
Mon May 27, 2013 6:53 pm
Forum: Scripting
Topic: interface ethernet cable-test
Replies: 11
Views: 12586

interface ethernet cable-test

How would you run this command and display the output for all ethernet ports using the API?
by patrickclover
Mon May 27, 2013 6:50 pm
Forum: Scripting
Topic: Hostpot Host Bytes + Mac
Replies: 4
Views: 1515

Re: Hostpot Host Bytes + Mac

Works brilliantly, Thank you! for others here is what I ended up with. function ByteSize($bytes) { $size = $bytes / 1024; if($size < 1024) { $size = number_format($size, 2); $size .= ' KB'; } else { if($size / 1024 < 1024) { $size = number_format($size / 1024, 2); $size .= ' MB'; } else if ($size / ...
by patrickclover
Mon May 27, 2013 3:54 pm
Forum: Scripting
Topic: Hostpot Host Bytes + Mac
Replies: 4
Views: 1515

Re: Hostpot Host Bytes + Mac

Im using the RouterOS PHP API class v1.4 whats would the syntax be for that?

Thank you in advance for your help.
by patrickclover
Mon May 27, 2013 7:26 am
Forum: Scripting
Topic: Hostpot Host Bytes + Mac
Replies: 4
Views: 1515

Hostpot Host Bytes + Mac

I cant seem to figure this out, what im looking for is to get the API in php to give me the same output as /ip hotspot host print bytes but I cant get the api to do this?

Does anyone know how this might be achieved?