What's new

DNS redirect or captive portal

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Ctsvett

New Around Here
Hi guys,
New poster here but long time lurker.
I have a specific project I can’t find a solution for so I’m coming here.

Objective: using a ASUS router I have. or even just a windows 10 pc I have, I’d like to have a ssid that people can join and are redirected to a web server/ip address on the local network.
Caveats: there is not, nor will there be any actual internet connectivity. That presents a problem everything I try captive portal
I’d like as few devices as possible- this is for a portable installation. I’d love it if it was only a windows pc using internet connection sharing, but that’s not possible from what I can see. I want it to work for all mobile devices. (Apple, android, etc). The web server does need to be windows for some unrelated reasons- Linux would be nice but not possible.

now, I’m resigned myself to using a ASUS 3200 I have laying around. I installed Merlin on it. The windows pc running the web server will be hooked onto a lan port with a static ip.
Any ideas how to redirect, as if captive portal, a user to the ip addresss of the windows web server when they join the ssid?

Bonus points: the web server will he hosting one page (php script) where the user can do some stuff and then, when they are done on that page, any ideas how to bounce them off the wireless?

thanks
 
Hi guys,
New poster here but long time lurker.
I have a specific project I can’t find a solution for so I’m coming here.

Objective: using a ASUS router I have. or even just a windows 10 pc I have, I’d like to have a ssid that people can join and are redirected to a web server/ip address on the local network.
Caveats: there is not, nor will there be any actual internet connectivity. That presents a problem everything I try captive portal
I’d like as few devices as possible- this is for a portable installation. I’d love it if it was only a windows pc using internet connection sharing, but that’s not possible from what I can see. I want it to work for all mobile devices. (Apple, android, etc). The web server does need to be windows for some unrelated reasons- Linux would be nice but not possible.

now, I’m resigned myself to using a ASUS 3200 I have laying around. I installed Merlin on it. The windows pc running the web server will be hooked onto a lan port with a static ip.
Any ideas how to redirect, as if captive portal, a user to the ip addresss of the windows web server when they join the ssid?

Bonus points: the web server will he hosting one page (php script) where the user can do some stuff and then, when they are done on that page, any ideas how to bounce them off the wireless?

thanks

This seems pretty straight forward, to me.
When a router doesn't detect an internet connection AND has "Wan Down Redirect" enabled, dnsmasq is set to direct all queries to either 10.0.0.1 or it's own lan ipaddress. Usually it is 192.168.1.1 but it could be any thing. Just make sure dhcp is enabled for the lan/wlan and that the router is serving pages on http port 80 and on https port 443 also.

On a USB drive, create a linux native file system, ex3 or ext4, put all of the pages you want to serve in a single directory or that one directoy with sub-directories.

In linux, move into that directory and create a symlink from index.html to error.html with ln -s index.html error.html .
In the root of the drive, create a script to bind mount the folder from your USB drive to the /www directory
or edit the nvram setting
script_usbmount=
to script_usbmount="mount -o bind /tmp/mnt/%filesysem%/$your_directory /www" .

script_usbumount= will be used to unmount that directoy from /www with the command "sync ; umount /www"

When you Insert the usb drive in the device, it could get mounted to a number of places. But usually to /tmp/mnt/%filesystem%.
If there is a second partition on it , mine gets mounted to /tmp/mnt/jffs . Maybe I named the filesytem to jffs . I dont recall now. but they both get mounted in /tmp/mnt .

When the usb (thumb)drive gets mounted the router checks nvram contents to see if there is a script that needs to be ran once mounting is complete. If the settings are correct it will boot up , mount the usb , then bind mount the directory from the usb over the /www folder. The system will detect the wan isn't up yet and provide a webpage to the client devices to go there to sign in . That will be when they see the page(s) you have prepared for them.

I might have missed something or glossed over something else, but the basic premise should be there to do what you want. Or to get you pointed in the right direction.

Someone else may come along to add to this or make corrections.
It didn't break my router , but if you break yours, you can keep all the pieces.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top