Community discussions

MikroTik App
 
tarasius
just joined
Topic Author
Posts: 5
Joined: Thu Apr 16, 2015 1:06 pm

WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Thu Apr 16, 2015 1:15 pm

Good day.
I need a WiFi hotspot which will open the html page after connection, and does not have internet. I found that the best way to do it is to use authorisation of the hotspot.
I created hotspot on Mikrotik device (RouterOS v. 6.27) When I plug in internet cable, everything works - any url opened by client is redirected to the login page.
But I need the same functionality without internet - connect to wifi, get html page no matter on URL entered, nothing more.
The problem is that redirection does not work when no internet is plugged in. The hotspot page can be open by DNS name of hotspot, and ask for the login, but it has no effect. Other domains try to be opened and fail of course because of no internet, instead of redirection to the login page.
It looks like DNS server works differently with and without internet.
Here is export of my settings.
/interface bridge
add admin-mac=4C:5E:0C:0B:D5:17 auto-mac=no name=bridge-local
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=\
    20/40mhz-Ce disabled=no distance=indoors frequency=auto \
    l2mtu=1600 mode=ap-bridge rx-chains=0,1 ssid="VVR HotSpot" \
    tx-chains=0,1 wireless-protocol=802.11
/interface ethernet
set [ find default-name=ether1 ] name=ether1-gateway
set [ find default-name=ether2 ] name=ether2-master-local
set [ find default-name=ether3 ] master-port=ether2-master-local \
    name=ether3-slave-local
set [ find default-name=ether4 ] master-port=ether2-master-local \
    name=ether4-slave-local
/ip neighbor discovery
set ether1-gateway discover=no
/ip hotspot profile
add dns-name=hotspot.vvr hotspot-address=10.10.10.1 login-by=\
    cookie,http-pap name=hsprof2
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
add name=hs-pool-5 ranges=10.10.10.2-10.10.10.254
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=bridge-local \
    name=default
add address-pool=hs-pool-5 disabled=no interface=wlan1 \
    lease-time=1h name=dhcp1
/ip hotspot
add address-pool=hs-pool-5 disabled=no interface=wlan1 name=\
    hotspot2 profile=hsprof2
/interface bridge port
add bridge=bridge-local interface=ether2-master-local
add bridge=bridge-local disabled=yes interface=wlan1
/ip address
add address=192.168.88.1/24 comment="default configuration" \
    interface=bridge-local network=192.168.88.0
add address=10.10.10.1/24 comment="hotspot network" interface=\
    wlan1 network=10.10.10.0
/ip dhcp-client
add comment="default configuration" dhcp-options=\
    hostname,clientid disabled=no interface=ether1-gateway
/ip dhcp-server network
add address=10.10.10.0/24 comment="hotspot network" dns-server=\
    10.10.10.1 gateway=10.10.10.1
add address=192.168.88.0/24 comment="default configuration" \
    gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes cache-max-ttl=0s \
    query-server-timeout=0ms query-total-timeout=0ms
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add chain=input comment="default configuration" protocol=icmp
add chain=input comment="default configuration" connection-state=\
    established,related
add action=drop chain=input comment="default configuration" \
    in-interface=ether1-gateway
add chain=forward comment="default configuration" \
    connection-state=established,related
add action=drop chain=forward comment="default configuration" \
    connection-state=invalid
add action=drop chain=forward comment="default configuration" \
    connection-nat-state=!dstnat connection-state=new \
    in-interface=ether1-gateway
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment=\
    "place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment=\
    "default configuration" out-interface=ether1-gateway
add action=masquerade chain=srcnat comment=\
    "masquerade hotspot network" src-address=10.10.10.0/24
add action=masquerade chain=srcnat comment=\
    "masquerade hotspot network" src-address=10.10.10.0/24
/ip hotspot user
add name=admin password=vvradmin
/system clock
set time-zone-name=Europe/Kiev
/system routerboard settings
set cpu-frequency=650MHz protected-routerboot=disabled
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=ether2-master-local
add interface=ether3-slave-local
add interface=ether4-slave-local
add interface=wlan1
add interface=bridge-local
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=ether2-master-local
add interface=ether3-slave-local
add interface=ether4-slave-local
add interface=wlan1
add interface=bridge-local
Help me please to find a problem or configure it from starting point. Maybe this can be achieved not with WiFi hotspot but with some NAT rules?
 
User avatar
czolo
Member
Member
Posts: 423
Joined: Fri Mar 04, 2005 9:49 am
Location: Poland (Warsaw)
Contact:

Re: WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Mon Apr 27, 2015 10:01 pm

You have to redirect all requests in DNS to one IP. Serach the solution in the forum (hint *.*)
 
tarasius
just joined
Topic Author
Posts: 5
Joined: Thu Apr 16, 2015 1:06 pm

Re: WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Mon Apr 27, 2015 10:51 pm

You have to redirect all requests in DNS to one IP. Serach the solution in the forum (hint *.*)
I already did it but it helps partly - works in Windows, iOS but not in Android. I posted this problem as separate question.
http://forum.mikrotik.com/viewtopic.php?f=7&t=96207
 
User avatar
r0berts
newbie
Posts: 49
Joined: Mon Jul 30, 2018 3:29 pm

Re: WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Fri Aug 03, 2018 12:59 am

How did it go? I am working on something similar
 
tarasius
just joined
Topic Author
Posts: 5
Joined: Thu Apr 16, 2015 1:06 pm

Re: WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Fri Aug 03, 2018 1:15 am

How did it go? I am working on something similar
DNS server gives one static IP for all requests. I implemented it without hotspot. Don't know how it is now, as I left those company where I worked on this feature.
 
delhite2
just joined
Posts: 13
Joined: Fri May 10, 2019 4:45 pm

Re: WiFi hotspot without internet that redirects all requests to the static page and popups it after connection

Wed Oct 14, 2020 9:23 am

viewtopic.php?p=822430#p822430
Solved!

Sent from my LYA-L29 using Tapatalk

Who is online

Users browsing this forum: ds37577, GoogleOther [Bot] and 11 guests