Hey all,
RouterOS version: 4.11
We are breaking our brains to get working this. Found few posts in Forum/Google but there is no final solution.
I want to setup Hotspot and give to clients Public IP addresses, but only after authorization. I don’t want to waste all my public address pool, cause of this before authorization I want to give addresses from private pool ( e.g. 172.16.0.0/24 ) and only after authorization do 1 to 1 NAT on Hotspot.
What I’ve tried and didn’t work:
Client <—>wlan1 MIKROTIK ether1<—> Core Router
Mikrotik configuration
User authorization is local
1/ wlan1 - 172.16.0.1
2/ ether1 - 10.10.0.2 - Lets assume this is a public subnet
IP Addresses
/ip address
add address=10.10.0.2/24 broadcast=10.10.0.255 comment="" disabled=no interface=ether1 network=10.10.0.0
add address=172.16.0.1/24 broadcast=172.16.0.255 comment="" disabled=no interface=wlan1 network=172.16.0.0
IP Pools
/ip pool
add name=dhcp_pool1 ranges=172.16.0.2-172.16.0.254
add name=hotspot_public ranges=10.10.0.100-10.10.0.200
Hotspot configuration
/ip hotspot profile
set default dns-name="" hotspot-address=0.0.0.0 html-directory=hotspot http-cookie-lifetime=3d http-proxy=0.0.0.0:0 \
login-by=cookie,http-chap name=default rate-limit="" smtp-server=0.0.0.0 split-user-domain=no use-radius=no
add dns-name=hotspot.domain.am hotspot-address=172.16.0.1 html-directory=hotspot http-proxy=0.0.0.0:0 login-by=http-chap \
name=hsprof1 rate-limit="" smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot
add address-pool=dhcp_pool1 addresses-per-mac=2 disabled=no idle-timeout=5m interface=wlan1 keepalive-timeout=none name=\
hotspot1 profile=hsprof1
/ip hotspot user profile
set default address-pool=hotspot_public keepalive-timeout=2m name=default shared-users=1 status-autorefresh=1m \
transparent-proxy=no
/ip hotspot ip-binding
add address=172.16.0.0/24 comment="" disabled=no
add address=0.0.0.0/0 comment="" disabled=no type=blocked
/ip hotspot user
add comment="" disabled=no name=test password=test profile=default
NAT Rules
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="masquerade hotspot network" disabled=no src-address=172.16.0.0/24
Problem:
Client connects to AP ( wlan1 interface ) and gets IP address from DHCP Server private pool ( 172.16.0.0/24 ). When open Login page, input credentials and press OK button it loops and doesn’t get any reply from Hotspot side. But at the same time on Mikrotik I see that user loged in.
[root@MikroTik] > /ip hotspot active print
Flags: R - radius, B - blocked
# USER ADDRESS UPTIME SESSION-TIME-LEFT IDLE-TIMEOUT
0 test 10.10.0.100 19m14s 5m
[root@MikroTik] > /ip hotspot host print
Flags: S - static, H - DHCP, D - dynamic, A - authorized, P - bypassed
# MAC-ADDRESS ADDRESS TO-ADDRESS SERVER IDLE-TIMEOUT
0 A 40:61:86:42:AF:61 172.16.0.254 10.10.0.100 hotspot1 5m
Updated:
It works fine when I assign public address/net (10.10.0.0/24) on wlan1 interface, but in this case I must have one extra IP/subnet on ether1 ( will be from another private address range, don’t want to waste some extra Public addresses ).