[hotspot] login page base on interface vlan name (on Ver. 3)

hi.. greeting all,

currently i’m using mikrotik version 2.9.51 to serve more than 50 hotspot-location.
i use 1 vlan each location and each vlan is bridged together so i only need 1 hotspot services on that bridge.
while for login-page, i use another server. currently all is running well

–sample part of my config–

#
/ interface vlan 
add name="vlan-greengarden" arp=enabled vlan-id=6 interface=ether2  disabled=no 
#
/ interface bridge 
add name="bridge1"
#
/ interface bridge port 
add interface=vlan-greengarden bridge=bridge1 disabled=no 
#
/ ip hotspot 
add name="HOTSPOT" interface=bridge1 address-pool=pool1 profile=default \
    idle-timeout=15m keepalive-timeout=none addresses-per-mac=1 disabled=no

– a line in login.html to redirect login page base on its location–

document.write('<form name="redirect" action="https://login.page.net/indexWeb.php?lok=$(interface-name)" method="post">')

here the question: :slight_smile:
why on version 3.xx, its doesn’t know the vlan name, only know the bridge name…?

so, the result of login URL based on above example:

-- on version 3.xx ==> https://login.page.net/indexWeb.php?lok=bridge1 
-- on version 2.9.x ==> https://login.page.net/indexWeb.php?lok=vlan-greengarden

if i want use ver 3.xx, is there another way or solution so my login-page can be diferent each vlan?

thanks and regards

From the (incomplete) documentation for version 3: “interface-name - physical HotSpot interface name (in case of bridged interfaces, this will return the actual bridge port name)”, so that’s expected behavior.

As far as I know your only two options are to run more than one Hotspot service (which shouldn’t be a problem), one on each VLAN interface, or to determine what to display based on the client IP address (pass on “$(ip)” as a GET parameter to your external server).

@fewi
wow.. that must be a lot of hotspot services and IP pools on my box since there are many vlan location ... :open_mouth:

thanks anyway for the input

for mikrotik developer, is there any way that in the future version 3, that mikrotik can know the vlan-name in bridged port from $(interface-name) parameter?

thanks and regards