Community discussions

MikroTik App
 
ali_hacker
newbie
Topic Author
Posts: 32
Joined: Sat Oct 13, 2007 1:36 pm

Script To Load A Specific Webpage

Wed Jun 15, 2016 3:12 pm

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
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Script To Load A Specific Webpage

Wed Jun 15, 2016 9:24 pm

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
 
ali_hacker
newbie
Topic Author
Posts: 32
Joined: Sat Oct 13, 2007 1:36 pm

Re: Script To Load A Specific Webpage

Fri Feb 10, 2017 1:50 am

well i will try and thanks for your reply
 
ali_hacker
newbie
Topic Author
Posts: 32
Joined: Sat Oct 13, 2007 1:36 pm

Re: Script To Load A Specific Webpage

Sat Feb 11, 2017 9:32 am

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

Who is online

Users browsing this forum: No registered users and 23 guests