Hello everyone. I am new to OpenWrt. So I need help.
I have installed OpenWrt to Tp-link Archer C60 AC1350.
I can not implement one scenario with OpenWrt.
When a new device is connected to the router, the router should redirect it to the server for authorization. The server returns some web page where the user accepts the terms and enters his credentials. After that server should authorize the new connecting device, and the router should provide an internet connection for 2 hours. After 2 hours, the router should stop providing internet to the device and the device should repeat the authorization process with the server as stated above.
Is it possible to describe the steps to implement such a scenario?
How the router and the server should be configured?
What packages should be installed to the OpenWrt or Is it possible to provide any tutorial or documentation regarding this topic?
I have tried different methods but it did not work. I implemented a server using Node js. It was running on my computer locally. The OpenWrt did not redirect the new connection to the Node js server.
In production mode, the server will be in the cloud.
I think you are looking for a captive portal: https://openwrt.org/docs/guide-user/services/captive-portal/start
In general, what did you already try?
1 Like
Thank you for your answer.
I thought about the RADIOUS server. I tried hostapd, hostapd-utils. But they did not work.
I haven't set this up myself, so see this more as suggestions than advice:
For the Captive Portal solution, OpenNDS seems good:
https://opennds.readthedocs.io/en/stable/install.html#installing-on-openwrt
It supports username/password forms out of the box.
Regarding authentication: Seems like most Captive Portals forward the entered credentials to a FAS (Forward Authentication Service). This service should be hosted remotely (read: on another server, not your OpenWrt device).
There are a variety of FAS services out there. Authentik or Authelia were the first ones that popped up during my search.
Thank you for your response. It turns out I have a new issue.
I tried to install opennds. But I have an OpenWrt 18.06 version on my router. As documentation states opennds is not compatible with OpenWrt 18.06. I should upgrade OpenWrt it to make it compatible with opennds. I have a Tp-link Archer c60 v3 router. I tried to upgrade the OpenWrt to 23.05. It showed an error: "The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform."
I followed the documentation from https://openwrt.org/toh/tp-link/archer_c60_v2.
Image URL: https://downloads.openwrt.org/releases/23.05.0/targets/ath79/generic/openwrt-23.05.0-ath79-generic-tplink_archer-c60-v3-squashfs-sysupgrade.bin
Now I am planning to upgrade OpenWrt from CLI with sysupgrade using-f flag. But it is risky. Is it possible to upgrade the OpenWrt to 23.05 safely.
P.S. I tried NoDogSplash for demo purpose. It worked. Unfortunately, this package does not support Forwarding Authentication Service API (FAS).
AFAIK a sysupgrade from 18.06 to a current OpenWrt version is not supported. So the router needs to be reflashed. I don't know what the best way to that is, though. In any case, don't force the upgrade.
Also, most of the wiki pages don't have the latest image referenced. Always use the Firmware Selector to download OpenWrt: https://firmware-selector.openwrt.org