Internet works when connecting directly to computer but keeps getting disconnected often when using via router.
Disable Connection on Demand / Connect Automatically
This sitting is usually found in Advanced Router Settings / Setup Control Panel.
For NetGear its under Advanced / WAN Setup.
Why it happens:
The router keeps disconnecting internet to save costs (ISP), this is not required nowadays when ISP's offer huge amount of bandwidth / unlimited internet access.