There are many reasons for this problem; one of the reasons is that Windows Update failed to install or update the Network drivers, in that case, you have to update the required driver manually.
If you see the message Security or firewall might be blocking the connection following completion of Windows Network Diagnostics to determine what’s causing internet or network connection issues on ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results