femindharamshi10
Posts: 102
Joined: Thu Jan 07, 2016 1:28 pm

autoredirect all pages on rpi ap

Fri Mar 25, 2016 1:13 pm

i have created a AP on my Rpi using hostapd and dhcpd
when a user connects to this ap and tries to open a webpage, it should automatically redirect to 192.168.69.1 and so the connected device can only access 192.168.69.1 and nothing else. How do i do it ?

User avatar
DougieLawson
Posts: 40583
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: autoredirect all pages on rpi ap

Fri Mar 25, 2016 1:20 pm

Search GOOGLE for "captive portal".
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.


femindharamshi10
Posts: 102
Joined: Thu Jan 07, 2016 1:28 pm

Re: autoredirect all pages on rpi ap

Fri Mar 25, 2016 1:45 pm

DougieLawson wrote:Search GOOGLE for "captive portal".
umm.. i did that many times but could not find a answer for my question. PLEASE HELP!

User avatar
DougieLawson
Posts: 40583
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: autoredirect all pages on rpi ap

Fri Mar 25, 2016 4:44 pm

Is Google broken in your part of the world?
http://sirlagz.net/2013/08/23/how-to-ca ... pberry-pi/
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: autoredirect all pages on rpi ap

Fri Mar 25, 2016 5:15 pm

Hi,
correct answer to this question is captive portal.
Captive portal is a system that intercept connection and display some advertising, and request identification to continue accessing internet.
But, today captive portal have a trouble, most web access is done using https. And intercepting https break security, and can be a criminal offense.
Captive portal can use some techniques, like packet interception and routing redirection, and dns wildcards.
Due security concern (to wifi users), I'm not comfortable to explain in detail how to do a basic access redirection.
Some firewall script/daemon have option to do this.
But, the idea is:
If redirect to same host that run a target page.
Use prerounting and redirect to local host.
If the page is on other server, use advanced routing table to route to server, and on server use prerouting do redirect to local host.
It is very similar to do a transparent proxy.

Sorry.

femindharamshi10
Posts: 102
Joined: Thu Jan 07, 2016 1:28 pm

Re: autoredirect all pages on rpi ap

Fri Mar 25, 2016 6:04 pm

pksato wrote:Hi,
correct answer to this question is captive portal.
Captive portal is a system that intercept connection and display some advertising, and request identification to continue accessing internet.
But, today captive portal have a trouble, most web access is done using https. And intercepting https break security, and can be a criminal offense.
Captive portal can use some techniques, like packet interception and routing redirection, and dns wildcards.
Due security concern (to wifi users), I'm not comfortable to explain in detail how to do a basic access redirection.
Some firewall script/daemon have option to do this.
But, the idea is:
If redirect to same host that run a target page.
Use prerounting and redirect to local host.
If the page is on other server, use advanced routing table to route to server, and on server use prerouting do redirect to local host.
It is very similar to do a transparent proxy.

Sorry.
how do i use advanced routing table to route to server, and on server use prerouting do redirect to local host

Return to “General discussion”