MBP connects to WiFi but not to internet
After talking in a chat with the OP. I suggested the following solution, which in the end solved the issue.



Follow these instructions to reinstall macOS:


  Start up from macOS Recovery
  
  
  macOS Recovery installs different versions of macOS depending on the key combination you use while starting up. Turn on or restart your
  Mac, then immediately hold down one of these combinations:
  
  
  
  2.Release the keys when you see the Apple logo or a spinning globe.
  
  Install macOS
  
  
  Choose Reinstall macOS (or Reinstall OS X) from the utilities window.
  Click Continue, then follow the onscreen instructions. You'll be asked to select your disk. If you don't see it, click Show All Disks.
  Click Install. Your Mac restarts after installation is complete.