Community discussions

MikroTik App
 
nerdtron
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

hotspot does not redirect to login page

Thu Dec 19, 2013 7:01 am

Hi all, I have the following config:
The setup is lan network ports (192.168.14.0/24) will be routed to wan1 and wifi users (192.168.15.0/24) will be routed on wan2.
It seems to be working as expected.

Problem: When I activate the hotspot for wifi users, users are not redirected to the login page. They have to manually type http://192.168.15.1/login.html and then be able to login.
Any ideas?
/interface ethernet
set [ find default-name=ether1 ] name=port1
set [ find default-name=ether2 ] name=port2
set [ find default-name=ether3 ] name=port3
set [ find default-name=ether4 ] master-port=port3 name=port4
set [ find default-name=ether5 ] master-port=port3 name=port5

/interface wireless
set [ find default-name=wlan1 ] default-ap-tx-limit=1024000 disabled=no l2mtu=2290 mode=ap-bridge

/ip pool
add name=dhcp_pool1 ranges=192.168.15.50-192.168.15.200
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=wlan1 lease-time=6h name=server1

/ip address
add address=192.168.15.1/24 comment=wifi interface=wlan1 network=192.168.15.0
add address=192.168.46.100/24 comment=wan2 interface=port2 network=192.168.46.0
add address=192.168.20.100/24 comment=wan1 interface=port1 network=192.168.20.0
add address=192.168.14.100/24 comment=lan interface=port3 network=192.168.14.0

/ip dhcp-server network
add address=192.168.15.0/24 dns-server=208.67.222.222,208.67.220.220 gateway=192.168.15.1 netmask=24

/ip dns
set allow-remote-requests=yes servers=208.67.222.222,208.67.220.220

/ip firewall address-list
add address=192.168.14.0/24 list=lan-users
add address=192.168.15.0/24 list=wifi-users

/ip firewall mangle
add action=mark-routing chain=prerouting comment=lan-to-wan1 new-routing-mark=to_wan1 passthrough=no src-address-list=lan-users
add action=mark-routing chain=prerouting comment=wifi_to_wan2 new-routing-mark=to_wan2 passthrough=no src-address-list=wifi-users

/ip firewall nat
add action=masquerade chain=srcnat src-address=192.168.14.0/24
add action=masquerade chain=srcnat src-address=192.168.15.0/24

/ip route
add check-gateway=ping comment=vpn distance=1 gateway=192.168.20.1 routing-mark=to_wan1
add check-gateway=ping comment=internet distance=2 gateway=192.168.46.1 routing-mark=to_wan2
 
nerdtron
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

Re: hotspot does not redirect to login page

Thu Dec 19, 2013 11:51 am

I think I solved it (I still need to confirm if packets are marked correctly), in case somebody will encounter same problem.

Add hotspot=auth on mangle rule for wifi and then add a nat line.
/ip firewall nat add chain=pre-hotspot dst-address-type=!local hotspot=auth

Who is online

Users browsing this forum: anav, patg, quezhou, vagrik and 216 guests