esp-open-lwip icon indicating copy to clipboard operation
esp-open-lwip copied to clipboard

redirect devices to specific website

Open AlphaArslan opened this issue 5 years ago • 5 comments

I understand that there is some routing happening on the ESP. what I want to do now is to always route the devices connected to the ESP NAT to a specific website.

how can this be achieved ?

AlphaArslan avatar Sep 28 '19 14:09 AlphaArslan

This can be done ba manipulating DNS or by rewriting addresses of HTTP requests. The challenge is, to switch off this redirect selectivley, once authentication is done.

I did an example with Arduino that does IP address-rewrite and switches the MAC addresses, once "authentication" has been done: You can find the code here: https://github.com/martin-ger/lwip_nat_arduino

martin-ger avatar Sep 29 '19 08:09 martin-ger

DNS manipulation can be bypassed if the client chooses to use another DNS or access sites by IP. right ? so, rewriting HTTP requests would be better I think. I will study your code and keep you updated thanks dude

AlphaArslan avatar Sep 29 '19 13:09 AlphaArslan

In CaptiveHotspot.ino, the hostspot doesn't have any internet access, does it ?

AlphaArslan avatar Oct 07 '19 12:10 AlphaArslan

but wait, there is actually no source ( C ) files in esp_wifi_repeater I have been looking for source files to learn from them but can't find them anywhere

AlphaArslan avatar Oct 07 '19 12:10 AlphaArslan

There are all sources in the user subdir.

In CaptiveHotspot.ino the ESP's STA side should be connected to the internet (the captive hotspot will work without, but then you get nothing once switched through).

martin-ger avatar Oct 07 '19 18:10 martin-ger