Internet not connected after sleep wake even though wifi is connected after awake

I was having the same issue on one of my machines running both macOS Catalina and Big Sur. Tried forgetting the network and joining again, doing an SMC reset, and a few other solutions with no luck.

I was finally able to find a fix for it today (also posted it here https://alihaghani.me/blog/fix-mac-not-having-internet-access-on-wake):

  1. Go to System Preference → Network
  2. Select 'Advanced...' in the bottom right corner
  3. Go to the TCP/IP tab
  4. Enter 'ConnecMac' in the DHCP Client ID field
  5. Select 'Renew DHCP Lease' above the field
  6. Press OK
  7. In the System Preferences → Network, select the Location dropdown
  8. Select 'Edit Locations...'
  9. Select the plus sign to add a new location
  10. Enter 'Home' as its name

You may try this , i had same issue. Your computer may be set to disconnect automatically If you have to redial your dial-up modem Internet connection after not using your Mac for a few moments, or reconnect your PPPoE connection, your Mac may be set to disconnect automatically when the connection is idle.

1.Choose Apple menu > System Preferences, then click Network.

2.Select your modem port (internal or external) or your PPPoE configuration in the list at the left, then click Advanced.

3.Click PPP, then make sure “Prompt every __ minutes to maintain connection” is not selected, or if it is selected, increase the number of minutes that the computer can remain idle before disconnecting.