When you plug your computer into the cable modems Ethernet port are you able to connect to the internet? If you can, your problem is the default gateway setting in your D-Link is not set to the cable modems IP address.
We use the term 'Bad Gateway' as the direction of the next hop is not known.
Think of it this way... You're on the shore of a large lake, looking out you can't see the other shoreline on the other side so you don't know if its there or not. But, if your friend got into a boat and went half way where he can see both you and the distant shoreline he could relay your signal. Thats the problem here.