Page 1 of 1

Script To Load A Specific Webpage

Posted: Wed Jun 15, 2016 3:12 pm
by ali_hacker
Hello  :D
I was woundring if there is a script that can redirect customers that just connected to MT PPPOE server to A specific webpage for few seconds , then they can browse the internet after that normally
if any ideas available  i would be so appreciated for  sharing them  :D  :D

Re: Script To Load A Specific Webpage

Posted: Wed Jun 15, 2016 9:24 pm
by ZeroByte
You could make a dstnat firewall rule which has a rate limit per src-ip of 1 per day, and it should also match src-address-list=newusers
Then in the pppoe profile, you can specify an "on-connect" script that adds the remote user's IP to the "newusers" list with a 1hr timeout.
So if they browse the web within an hour, they'll get redirected by the rule, but only once.

EDIT: The website you redirect the packet to will need to be configured to accept ANY target URL, and reply with a redirect header to whatever "welcome!" page you intend to display. If you like, you could run HTTP proxy on the Mikrotik itself, and create a proxy rule that denies all possible destinations, and replies with a redirect URL to your welcome page (hosted on some other box - ROS can't be used as a web server). If you use the proxy feature, the dstnat action would be "redirect" with to-ports=8080

Re: Script To Load A Specific Webpage

Posted: Fri Feb 10, 2017 1:50 am
by ali_hacker
well i will try and thanks for your reply

Re: Script To Load A Specific Webpage

Posted: Sat Feb 11, 2017 9:32 am
by ali_hacker
HI I WAS wondering about the script i should put in "on-connect" so it can add the user ip address to the address list:::: if you can help with
Regards