Community discussions

MikroTik App
 
dragon2611
Member Candidate
Member Candidate
Topic Author
Posts: 179
Joined: Fri Sep 25, 2009 12:06 am

Router OS 5.0 X86 Hotspot wrong IP address

Sun May 15, 2011 3:02 pm

Will update to Version 5.2 shortly and retest but noticed this bug in 5.0

Connected a friends laptop to my guest network in order to download some updates onto it, went to the router's IP address after authenticating and got the status screen

The status screen shows

Welcome Guest1
IP 192.168.0.9
etc

However the laptops IP address on the guest network is 192.168.0.8, there isn't a 192.168.0.9 on the network.

Winbox correctly shows 192.168.0.8 being authenticated against hotspot so it's only the status display in the browser that's incorrect
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Router OS 5.0 X86 Hotspot wrong IP address

Sun May 15, 2011 3:09 pm

Check "/ip hotspot host". Compare the "address" value to the "to-address" value. Are they the same? This is the hotspot 1:1 NAT feature.
 
dragon2611
Member Candidate
Member Candidate
Topic Author
Posts: 179
Joined: Fri Sep 25, 2009 12:06 am

Re: Router OS 5.0 X86 Hotspot wrong IP address

Sun May 15, 2011 3:23 pm

hmm Upgraded to 5.2 and now it's showing 192.168.0.3 for the same client.

Although I think I now know why

if I look in hosts under hotspot it shows 192.168.0.8 bound to 192.168.0.3 :lol:
 
dragon2611
Member Candidate
Member Candidate
Topic Author
Posts: 179
Joined: Fri Sep 25, 2009 12:06 am

Re: Router OS 5.0 X86 Hotspot wrong IP address

Sun May 15, 2011 3:25 pm

Check "/ip hotspot host". Compare the "address" value to the "to-address" value. Are they the same? This is the hotspot 1:1 NAT feature.
Ah yes thanks just spotted that actually, why it would 1:1 NAT to an IP in the same subnet seems a bit silly, is it a feature of Hotspot or a misconfiguration on my part?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Router OS 5.0 X86 Hotspot wrong IP address

Sun May 15, 2011 3:31 pm

The 1:1 NAT is used on all ip addresses. If the dhcp server on that interface issues the ip, then the "address" and the "to-address" are normally the same. That would be indicated in "/ip hotspot host" by a 'H'. If the client device ip was not issued by the dhcp server, that is indicated by a 'D'. Those ips are probably not going to be the same.

The hotspot does not presume that the client ip is in the same subnet. If the ip was not issued by the dhcp server, the hotspot will presume the client ip is not in the same subnet, and will get one for that mac address to do the 1:1 NAT.
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Router OS 5.0 X86 Hotspot wrong IP address

Mon May 16, 2011 1:50 am

http://wiki.mikrotik.com/wiki/Manual:Ho ... an_Address

One-to-one NAT can be disabled by un-setting the address-pool parameter under /ip hotspot. ie:
/ip hotspot set 0 address-pool=none
 
dragon2611
Member Candidate
Member Candidate
Topic Author
Posts: 179
Joined: Fri Sep 25, 2009 12:06 am

Re: Router OS 5.0 X86 Hotspot wrong IP address

Tue May 17, 2011 12:51 am

http://wiki.mikrotik.com/wiki/Manual:Ho ... an_Address

One-to-one NAT can be disabled by un-setting the address-pool parameter under /ip hotspot. ie:
/ip hotspot set 0 address-pool=none
That just seems to cause the clients to end up without a usable IP address.

my android phone for instance got a 172.xxx.xxx.xxx address
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Router OS 5.0 X86 Hotspot wrong IP address

Tue May 17, 2011 12:53 am

Do you have a DHCP server running on that interface? It should grab an address from that DHCP server pool.
 
dragon2611
Member Candidate
Member Candidate
Topic Author
Posts: 179
Joined: Fri Sep 25, 2009 12:06 am

Re: Router OS 5.0 X86 Hotspot wrong IP address

Tue May 17, 2011 1:08 am

Do you have a DHCP server running on that interface? It should grab an address from that DHCP server pool.
Yes
[admin@MikroTik] > ip dhcp-server print detail 
Flags: X - disabled, I - invalid 
 0   name="My-Lan" interface=Lan lease-time=3d address-pool=My-lan 
     bootp-support=static add-arp=yes authoritative=after-2sec-delay 

 1   name="Public" interface=Public lease-time=3d address-pool=Public 
     bootp-support=static add-arp=yes authoritative=after-2sec-delay 
     always-broadcast=yes 
[admin@MikroTik] > 
[admin@MikroTik] > 
[admin@MikroTik] > ip dhcp-server print detail 
Flags: X - disabled, I - invalid 
 0   name="My-Lan" interface=Lan lease-time=3d address-pool=My-lan 
     bootp-support=static add-arp=yes authoritative=after-2sec-delay 

 1   name="Public" interface=Public lease-time=3d address-pool=Public 
     bootp-support=static add-arp=yes authoritative=after-2sec-delay 
     always-broadcast=yes 
[admin@MikroTik] > 
[admin@MikroTik] > 
Router OS is running on an Alex 2d3 with 3 physical interfaces configured

LAN goes off to my AP/Switch
WAN goes to the DSL router
Public goes to the DSL router.

The DSL router support "Port mapping" where it's Physical ports can be mapped (To Isolate various interfaces from each other) but It doesn't support Vlan Tagging.

I've configured the DSL router so the Wi-FI ap is bridged to the port that's connected to "public" and Isolated from everything else and that WAN is bridged to the DSL interface, the only way traffic from the AP on the DSL Router to the internet is via RouterOS

There's also firewall rules in place to prevent anything on the guest network accessing my main network and policy based routing sending it out via a different ISP (VPN)
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Router OS 5.0 X86 Hotspot wrong IP address

Tue May 17, 2011 1:19 pm

Are you certain that there is not another dhcp server on the network? And I don't mean one of yours. I just finished dealing with a situation like this two weeks ago. A client had a dhcp server on my localnet.

Two ways to check:

1) Use "/ip dhcp-server alert" to check for dhcp servers on a localnet.

2) Disable your dhcp server temporarily and then renew a client ip lease. If it gets a new ip, then there is a second dhcp server on your localnet.

ADD: If the localnet is wireless, and there is a second dhcp server, set the wireless "default-forwarding=no". That stopped the dhcp server from issuing ips to my clients.

Of the two ways, I prefer using the dhcp-server alert. It provides the ip of the dhcp server.

Who is online

Users browsing this forum: No registered users and 57 guests