The fix that worked for me with this problem is: If your modem is plugged in an electric distributor (to connect electric wires of your computer, printer, scanner, etc), unplug the modem and plug it into a separate wall electric outlet.
I have experienced a double-fold annoying problem with internet and printer:
1- Internet connection is not stable. Errors in browsers appear such as Site cannot be reached; Internet was interrupted. The site I browse will display an error message and resume work in seconds. I could not send even emails because of this problem.
2- My HP Laser Jet M1217nfw connected through the network at home would not work properly. It very frequently moves into a never-ending cycle of ‘initializing’
The printer’s problem happened because the modem had apparently electric problems that it would disconnect internally and reconnect, causing the printer to lose its IP connection with the modem.