Is the Pi connected via Wifi and a USB ethernet adaptor? You may find the USB Wifi NIC is going to sleep, I edited /etc/modprobe.d/8192cu.conf and added

    options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

and it solved the problem for me but this info depends on the chipset, I'm using the Edimax USB wifi adaptors so you may have to search for the solution for your chipset.