hotspot host script

There seems to be a problem with Hotspot and would like to put together a script that will resolve this automaticly until i can find out what is causing the issue.

Essentially a hotspot client is being given the same IP as our core router, this is not being handed out by the DHP server and its not staticly assigned anywhere in the network. I can see no reason for this to happen but it does and not only on this one client.

What I have decided to do in the interum is to look at the hosts table every 5 mins and see if our gateway IP has been assigned to anyone. If so then it removes that record frmo the hosts. Curently if i do this manually evryting works OK and the client can get back on the net.

However for some reason when I run..
/ip hotspot host find address=192.168.0.1
no value is returned, from what i have read this should return the index item then i can use that to delete the record similar to this…

:foreach i in=[/ip hotspot host find address=192.168.0.1]
do={[/ip hotspot host remove $i]}

Can anyone cast any light on what i should be doing?

Regards
Andrew

What is the IP Pool set to?

Name: hs-pool
Address: 192.168.0.128-192.168.0.254
Next Pool: none

OK, thanks for that reply, that kills the simple idea I had!

Do you have a rogue DHCP server running on a client network, perhaps on a CPE? Due to a misconfiguration on the hotspot, it might be that broadcast traffic (the DHCP request) is being routed between your clients, rather than being blocked. (Check Default Forward is not ticked in the wireless settings)

Is it possible for you to change the IP of the hotspot interface and the whole network subnet to some completely new range that is not a ‘common’ one used by wireless routers, e.g. a 10.x.x.x one? Then if you never solve the problem of this rogue client problem, it won’t matter anymore as they will never get the IP of the hotspot allocated to them.

The Mikrotik hotspot design allows clients to connect with any IP address, even IPs not assigned via DHCP. So changing the hotspot network subnet should not break any clients currently using a manually assigned IP outside of the new IP subnet. Note I said should. If you can, test this on a lab mockup before rolling out such a change!

Ron.