You need to check for Internet connection:
- Settings > Connectivity > USB > Advanced > Internet Access > Via computer
- Settings > Connectivity > Internet & Streaming settings > Allow local conn. > Yes
Once you complete these steps you can use Internet. Make sure the phone is attached to the computer.