[Feature request] Random credentials per each guest network (one time network)

I want to have options that allow to generate random credentials per each guest network (one time network).

Something like this:
I open app, press “generate one time network”, then something like that generates: “SSID: ejf61skkb” “KEY: nY0Bfcaja“. Preferably with QR code

This what I can share with my guests. After they will leave I will just press “delete network” and it should be gone forever.


Many devices have “remember network” option. So to completely avoid this, I should change SSID and password each time. It will be more easier to automate such things.

It is extremely easy to add.

This is example:
-- File: /usr/lib/lua/luci/model/cbi/network/guest_network.lua

local http = require("luci.http")
local json = require("luci.json")
local uci = require("luci.model.uci").cursor()

local M = {}

function M.index()
    local page = {}
    page.title = "One-Time Guest Network"
    page.section = luci.i18n.translate("One-Time Guest Network")

    local s = uci:get("wireless", "guest")
    if not s then
        s = uci:add("wireless", "wifi-iface")
        s[".name"] = "guest"
        s.network = "guest"

    local ssid = s.ssid
    local key = s.key

    if http.formvalue("generate") then
        ssid = string.format("guest-%s", math.random(1, 1000000))
        key = string.format("%s%s%s%s%s",
            string.char(math.random(65, 90)),
            string.char(math.random(65, 90)),
            string.char(math.random(65, 90)),
            string.char(math.random(65, 90)),
            string.char(math.random(65, 90))
        s.ssid = ssid
        s.key = key

    if http.formvalue("delete") then
        uci:delete("wireless", "guest")
        ssid = nil
        key = nil

    page.section = page.section .. [[
            <input type="submit" name="generate" value="Generate One-Time Network" />
            <input type="submit" name="delete" value="Delete Network" />
        <h2>One-Time Guest Network Credentials</h2>
        <p>SSID: ]] .. ssid .. [[</p>
        <p>KEY: ]] .. key .. [[</p>

    return page

return M

And add the following lines to /etc/config/luci :

config luci
    option index '/luci-static/index.html'

config cbi
    option network '/luci/admin/network'
    option guest_network '/luci/admin/network/guest_network'

@alzhao @yuxin.zou

Imho this is nice but not the correct way. Multiple SSIDs will hit a limit sooner or later and pollute the Wi-Fi traffic.

The correct way would be to use RADIUS which is the same hotels work, for example.

1 Like

We'll discuss the feature of automatically updating guest Wi-Fi passwords.

But for the SSID, it doesn't seem necessary to change it over and over again, does it? Connecting by scanning isn't available on all devices, and having a fixed SSID seems to make it easier for others to connect.