Score:0

Dnsmasq how to make captive portal pop up

bt flag

I am trying to implement captive portal with dnsmasq. In dnsmasq config address=/#/10.42.0.1 doesn't work, so I have to use ugly:

address=/com/10.42.0.1
address=/uk/10.42.0.1
address=/org/10.42.0.1
address=/gov/10.42.0.1 ...

This redirects all listed domains fine, if in browser you go anywhere, however captive portal browser doesn't pop up by itself (checked no mac win and linux), and there is problem if site redirects to https (like facebook), my portal page is http only.

So how should it be setup correcltly to replace all domain names or even just make browser pop up with captive portal page?

UPD: acording to man page:

--address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive.

So how can I make sure there is no upstream hosts for the NetworkManager - dnsmasq?

vidarlo avatar
ar flag
Why do you want to roll your own?
Mira avatar
bt flag
@vidarlo I use NetworkManager as hotspot, it uses it's own dnsmasq plugin, so i assumed it will be the easiest way to setup captive portal - with dns redirect.
vidarlo avatar
ar flag
What is your end goal here? Just redirect everyone to one page, or to actually provide internet access once authenticated?
Mira avatar
bt flag
@vidarlo redirect to one page, but ideally webbrowser with page should pop up when connected to hotspot. Now i got redirected not immediately on connect to wifi, but only hwen browser is opened by user. With internet access after auth i got no problem
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.