Login with MAC on Hotspot

Hi,

Trying to setup a hotspot with multiple profiles here.

I need to have 4 user profiles with increasing limitations. Internal use → customers.

For internal use and regular customers I would like the MAC address to be used to automatically authenticate the user. My current test config still asks for a username/password.

Hotspot profile
/ip hotspot profile
set [ find default=yes ] login-by=mac,http-chap mac-auth-mode=
mac-as-username-and-password
add dns-name=login.bla hotspot-address=10.0.0.1 login-by=
mac,http-chap mac-auth-mode=mac-as-username-and-password name=hsprof1

For the user profiles I have:
/ip hotspot user profile
add address-pool=hotspot-pool mac-cookie-timeout=1d name=1-profile-platinum
rate-limit=512k/256k
add address-pool=hotspot-pool mac-cookie-timeout=1d name=2-profle-gold
rate-limit=512k/128k
add address-pool=hotspot-pool mac-cookie-timeout=12h name=3-profile-silver
rate-limit=384k/128k
add address-pool=hotspot-pool mac-cookie-timeout=12h name=4-profile-bronze
rate-limit=256k/128k

and then my test User:
/ip hotspot user
add limit-bytes-total=5000000 mac-address=XX:B8:37:BE:19:XX name=User
profile=1-profile-platinum server=hotspot

I’m not sure if I’m misunderstanding how MAC login works or if my config is wrong.

Normal logins work fine but I need that mac login :laughing:

Thanks in advance!

Hello,

try this:

/ip hotspot ip-binding add mac-address=XX:B8:37:BE:19:XX type=bypassed

They should be authenticated without asking for username/password.

Thanks for the suggestion - I will probably go with that for the internal stuff ie printers, tills, etc. but for logins like regulars (this is a coffee joint) or staff, it needs to happen automatically but
still be rate limited as well as cap limited.

Hi again,

I understand now what you really wanted.

I have tried the code you suggested but it still requires the login. I think here the MAC field just locks it to one device.

Sorry, but not sure how to help. If I find out something, I’ll post back.

I think I’ve got it, relevant parts are bolded:

Hotspot profile
/ip hotspot profile
set [ find default=yes ] login-by=mac,http-chap mac-auth-mode=
mac-as-username
add dns-name=login.bla hotspot-address=10.0.0.1 login-by=
mac,http-chap mac-auth-mode=mac-as-username-and-password name=hsprof1

/ip hotspot user
add limit-bytes-total=5000000 mac-address=XX:XX:XX:XX:XX:XX name=XX:XX:XX:XX:XX:XX
profile=1-profile-platinum server=hotspot

Not sure if it’s the correct way but it works and pretty sure you can do mac-as-username-and-password as well and just add MAC to the password field in the user.

Nice work.

I just tried it and it works fine.