hi
i have mikrotik router ver 2.8 and have to generate pop up for the clients when clients 90% of package have been used.
is it possible, if yes please let me know the scripts
(both the case hourly and data transfer based package)
hi
i have mikrotik router ver 2.8 and have to generate pop up for the clients when clients 90% of package have been used.
is it possible, if yes please let me know the scripts
(both the case hourly and data transfer based package)
Well, you can’t do something like that with MT, sorry…
We will have a feature (most likely in v2.9) that allows you to redirect any http request after x minutes or every x minutes…
This will be for the free hotspots…
John
Well, actually, you can ![]()
First of all, you will need such a message to sit in the virtual root on some IP addres, i.e.: http://someIPaddress:someport/ should pop-up your message.
Then, refer to the following thread to set up the data transfer package system:
http://forum.mikrotik.com//viewtopic.php?t=308
Note, that you should slightly modify the logging script:
:local sum; :local traf;
:set sum 0
/ip firewall rule accounting{
:foreach i in [find] do={:incr sum}
:for i from=1 to=$sum do={
:set traf [get [find comment=("user" . $i)]
bytes]
:set traf ($traf/1073741824*100)
:if ($traf>90) do={/ip firewall dst-nat add limit-count=1 limit-time=356d dst-port=80 protocol=tcp action=nat to-dst-address=<someIPaddress> to-dst-port=<someport> src-address=[get [find comment=("user" . $i)]dst-address]
:log facility=System-Info message=("user" . $i .
" exceeded 90% of 1Gb limit!")}
}
}
Hehe, Eugene, you devil ![]()
Nice to see that you guys watch our threads…
Cheers…
Devil is lived spelled backwards ![]()
Thax Eugene
Hmm…this is a good idea but won’t this arrangement block all http access to the user once he has reached 90%? How do you ‘undo’ the dst-nat rule once the user has seen his message?
limit-count=1
The rule will match only once.
I tried to use this method to redirect people that have not paid thier monthly bill
I give them a static IP in 192.168.66.x range and then mangle those packets with a mark called del
add chain=dstnat src-address=192.168.66.0/24 protocol=tcp dst-port=80
packet-mark=del action=dst-nat to-addresses=66.x.x.35 to-ports=80
I can see in Torch that It send packets out to 66.x.x.35, but none ever return.
any ideas?
You need a properly configured web server on 66.x.x.35, as I mentioned before.
It is a properly configured website. When I looked at torch without the rule on, I noticed the since I am using a hotspot that I have a transparent http proxy and all http trafffic goes throught the hotpsot proxy address, I think I need to apply my rule after the proxy?
Is the no-virtualhost webserver configured correctly to serve a website or is it correctly configured to handle redirections? ![]()
hmm it is a virtual server..I have a webserver that I can remove all virtual serverss
Ill try it and report back
mean time that you guys are at it, Eugene can you also be so kind enough to share the code for users reaching 90% of their time limit (up-time fro pre-paid users).
A lot of us would love to have this feature on their hotspot setups.
thasnk you.
Robert S.
BTW, Eugene, can the
http://someIPaddress:someport/
be placed on the /hotspot folder? or somewhere else?
If my hotspot is on 10.5.50.1, then should the address of the reminder be:
“http://10.5.50.1/remider.html” just like all the other default MT webpages?
so I set the dst-nat rule to goto 66.151.140.2 and have no luck..any ideas?
If I set the login page to redirect to my web server it works, so I know the web server is correct, I fell like I have a rule issue.
Perhaps-error- redirection on the web server isnt working properly?
It should redirect to the redirection html file you want to display if user is trying to access something that doesnt exist. (This will create a funky loops if your webpage is incomplete, btw).
You also want to add a redirect on the index.html file to point to index2.html on 0 seconds depending on what result you want.
Maybe you need to white-list the server?
After the initial redirection done by the routeros gateway you have to make the client realize that it must speak with the server directly (it’s not a permanent redirection, now is it?)
It’s been 5 years since i did this so i might have forgotten a detail or two.
Assuming the code above works, and I hope you’ll forgive me this presumption,
you need to check your web server configuration. It should give the warning page to any (that’s important) HTTP GET request. Try to telnet to the port your web server is listening on and issue an arbitrary GET request. This should display the warning page.
2infomate:
Yes, it can, but it’s certainly not a supported configuration ![]()
ok here is my telnet to my webserver
here is my rule
note:.. since I am on rc7 and using hotspot, I had to figure out that since the web proxy is on I had to not look for port 80, but port 64874
When I use 80, it never works.
add chain=dstnat src-address=192.168.66.0/24 protocol=tcp dst-port=64874
packet-mark=del action=dst-nat to-addresses=66.151.140.2 to-ports=64874
comment=“” disabled=no
telnet 66.151.140.2 80
HTTP/1.1 400 Bad Request
Server: Microsoft-IIS/5.0
Date: Wed, 27 Jul 2005 15:04:58 GMT
Content-Type: text/html
Set-Cookie: EGSOFT_ID=64.74.213.85-2386335888.29725372; expires=Fri, 31-Dec-2010 00:00:00 GMT; path=/
Content-Length: 87
Connection to host lost.