iPhone WiFi roaming and DHCP issues
The issue, to recap, is that when you have multiple WiFi Access Points on the same SSID (WiFi name), the iPhone will move between these mostly seamlessly like any other device, but not quite.
It seems that some times when changing AP, and this is surprisingly frequent, the iPhone will not regain its IPv4 address when it does so, leaving you with no IPv4 connectivity, a 169.254. address on the WiFi settings screen, and most things broken. Logs show it is not even trying DHCP. It even stays broken when you have "Wifi assist" that should use mobile if the WiFi is not working, even though it knows that for IPv4 the WiFi is not working!
The test case I have for this was Unifi APs, and FireBrick DHCP, using WPA Personal (i.e. simple password) security, and also having IPv6 on the network. The IPv6 is fine.
Switching to only 5GHz
First thing I tried was only setting on 5GHz, and not 2GHz. The iPhones we have all do 5GHz. It helped as problem was not so frequent, I think, but did not fix it.
Then we tried different SSIDs for each AP. This is tedious. It also meant it hung on to the wrong AP for too long with poor signal before switching. When it switched it worked and got an IP address via DHCP.
One simple trick with multiple SSIDs was to set a min-RSSI in the config for the Unifi. This meant it switched more readily between the SSIDs as I moved around. I have tried this for over a week. It works. But again, is rather tedious with each AP on a different SSID. Not how it should be.
This is the only solution we have yet found reliable.
I set the phone to use a fixed IP, netmask, gateway, and DNS when on the SSID I was using, and set all APs to the same SSID. This seemed to work, but has failed in a similar way, nonIP connectivity. Oddly even IPv6 did not work. This rather confirms it is an issue on the iPhone with DHCP on WiFi. The DHCP server in this case has no clue that the SSIDs. All indications are that it is the iPhone that has a bug.
Not tried. Well, I did, but it needs RADIUS and EAP. I tried an EAP accept, and even an EAP MD5 challenge and no joy. If anyone has a pcap of RADIUS/EAP for WPA Enterprise with an iPhone when it works, send me it and I'll code a server and test. Rumour is iPhones do work differently in Enterprise mode. This may be another solution, but the need for a RADIUS server would thwart most people.
All we really need is for Apple to fix this - it is tedious having to find a work around like this.
Updated: Fixed IP did not works
Update: Could it be the Unifi kit and not Apple? Well, yes, it could be, but googling other people with issues suggested Apple. I am trying newer Unifi firmware now.
Update: Two days of testing roaming on Unifi firmware 126.96.36.19969 and no problems yet - I'll keep testing.