Today I started a VM in Hyper-V. After I logged in to the VM using remote desktop, I noticed that I had no internet connectivity.
To solve this, I just restarted the ICS on the host system.
Below are the PowerShell commands to do so:
get-service sharedaccess | stop-service
get-service sharedaccess | start-service
Now it works fine.