Cannot connect: Obtaining IP address This is not a duplicate of 'Android stuck on obtaining IP address' and similar questions

When I try to connect to my home network with my android phone, it displays this message and never connects:

"Obtaining ip address...".


This only happens when it tries to connect directly to the modem, rather than another access point (which is much much slower in my case). 

I have followed tips online, the standard reconnect, reboot everything etc.; aswell as changing from DHCP to static IP. After assigning a static IP I successfully connect to the modem, but I have no internet connection. Rebooting and using different IPs does not help.

This problem is infuriating. Sometimes when I leave it for (DHCP) ages (10-20 mins) it manages to connect successful, but then the connection typically breaks down again maybe half an hour later.

The modem in question is a virgin media fibre modem, model EVW3226 manufactured by Ubee.

The internet works perfectly on all other devices we have, although sometimes it crops up on the Samsung tablet aswell.

The problem device in question is my Oneplus X running the latest version of oxygen (android 6.0.1 in this case) for this device.
Does your modem have free addresses in dhcp pool? I didn't configure this model but I had some device with restricted internet access for static configured IP. anyway it's look like your dhcp server has some issues.