This is likely caused by power management or auto-negotiation. If the power management fails to "get it right" then obviously the NIC fails to work for a minute, and if the auto-negotiation gets jacked then you get no connections at all.
Pregame: ip link
to get your ethernet interface name. It's usually number two.
Step #1: Make sure the auto-negotiation isn't changing up on you.
sudo ethtool -s eth0 speed 1000 duplex full autoneg off
Obviously, just switch the eth0 to whatever your interface name is. You can get full instructions on the tool with the -h option, which will explain even more settings.
Step #2: Kill the power management.
sudo echo off > /sys/class/net/eth0/power/control
Again, replace eth0 with your interface name. This will disable the power management on this interface until a reboot.
Step #3: Retest.
Run all your programs again.
If you test and want to keep this setting permanently, you will have to put those lines in /etc/rc.local
to run after booting.
If neither of these help the likely culprit is probably the actual wire between the computer and the router. It's possible for the little RJ-45 connectors to break internally, or the wires to have been stomped or pierced by another object. This is especially true if you tested the machine somewhere else and it worked.
Hope this helps. -Sean
EDIT
Add these to /etc/rc.local
:
#!/bin/bash
ethtool -s eth0 speed 1000 duplex full autoneg off
echo off > /sys/class/net/eth0/power/control
Save the file, and then do: chown root:root /etc/rc.local
, and chmod +x /etc/rc.local
. It will come up every boot that way after that. Remember to use whatever your network interface name is NOT eth0.