Phone uses 3G even when connected to WiFi I've a Moto-G XT1033. When I connect the phone to WiFi, it connects fine, shows the WiFi icon but uses 3G for internet. H+ or E is shown over mobile signal icon and an exclamation mark on WiFi.

Here's a screenshot:



I've to manually disable mobile data to force the phone to use WiFi. Then it works just fine. 

Here's with data disabled



Also, this problem appeared only after I upgraded from kitkat to lollipop official ROM. Now I've switched to CM12 but the problem persists. 

My WiFi uses proxy to connect to the internet and this problem is only on WiFi networks that use proxy.

Any idea what causes this or how to fix it.
Just disable captive portal detection. In the terminal, or in adb shell, issue the command

settings put global captive_portal_detection_enabled 0


and reboot.