Internet keeps failing despite connected wifi on 16.04

Just so that we don't have an unsolved question which is actually solved by this comment by Pilot6

This command seems to work (it worked for me and the original poster):

sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi 11n_disable=1"