If your Mac is connected to a Wi-Fi network but can't connect to websites, email, and all other internet services, try these solutions.
To connect to the internet over Wi-Fi, your Mac must first be connected to a Wi-Fi network, and that network must provide a connection to the internet. To connect to a Wi-Fi network, click Wi-Fi in Control Center or the menu bar, then choose a network from the menu. If websites, email, and all other internet services remain unavailable after connecting to Wi-Fi, try the following solutions.
Restart your Mac
Restarting might help because your Mac then automatically renews the internet address it was assigned when joining the Wi-Fi network. Or you can renew the IP address manually. This is known as renewing the DHCP lease. If the lease expired and the address is already in use by another device, your Mac is assigned a new address.
Update your Mac
Update the software on your Mac, and make sure that the date and time are set correctly.
Check VPN or other security software
If you installed VPN or other software that monitors or interacts with your network connections, that software could be affecting access to the internet. Learn about network issues related to VPN and other software.
Use the built-in diagnostic tools
Wi-Fi Recommendations. Click Wi-Fi in Control Center or the menu bar and check for a menu item named Wi-Fi Recommendations. If you see it, your Mac has detected an issue and has recommendations. Choose Wi-Fi Recommendations to learn more.*
Wireless Diagnostics. Press and hold the Option key on your keyboard while clicking Wi-Fi in Control Center or the menu bar, then choose Open Wireless Diagnostics from the menu. Learn more about using Wireless Diagnostics to analyze your wireless environment.
Update the Wi-Fi router
If you manage the network's Wi-Fi router, install the latest firmware updates for the router, as recommended by its manufacturer. It might also help to simply restart the router and use Apple's recommended settings for Wi-Fi routers and access points.
Try a different network or contact your ISP
If you can access the internet when connected to a different network, or you're not sure, check with your network administrator or Internet Service Provider (ISP) to make sure that your network is working properly.
If the Mac cannot connect to wifi and wifi is greyed out in system preferences, most of the times this is an hardware error with your wifi antenna. Contact Apple support to set your MacBook up for service