Network keeps going to sleep, but wakes after I ping out to any other server. *Not a reboot issue

Issues related to configuring your network
Post Reply
JeffO
Posts: 2
Joined: 2018/03/06 01:38:04

Network keeps going to sleep, but wakes after I ping out to any other server. *Not a reboot issue

Post by JeffO » 2018/03/06 01:59:06

I'm running a fresh minimal install of CentOS7 as a HyperV 2016 guest.
I've tried with and without all updates installed.

The Network adapter used is the HyperV Standard Network adapter, not the Legacy network adapter.

Other than setting a static IP address I have changed nothing else.

No matter what I do eth0 seems to go to sleep within a few hours.
To wake it all I need do is to console in through HyperV and ping anything else on the network,
eth0 will wake and begin working. I've looked for days for an answer and have been unable to find
a solution. Anyone have any ideas on how to keep it from going to sleep.?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Network keeps going to sleep, but wakes after I ping out to any other server. *Not a reboot issue

Post by TrevorH » 2018/03/06 10:16:55

Try using a standard ethernet card model to eliminate potential bugs in the (not so widely tested) microsoft adapter code. Pick an Intel E1000 model and use that. If that still does it then check in /var/log/messages and/or the dmesg command for errors.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Network keeps going to sleep, but wakes after I ping out to any other server. *Not a reboot issue

Post by pjsr2 » 2018/03/06 10:46:26

The source of this problem could be on your CentOS guest or on you HyperV host, but it could also be a problem of a router in your network that drops routing information if the connection is "quiet" for a long time.

Anyway, as a workaround, I would add a small cron job that pings some external address (perhaps your gateway) at regular intervals.

JeffO
Posts: 2
Joined: 2018/03/06 01:38:04

Re: Network keeps going to sleep, but wakes after I ping out to any other server. *Not a reboot issue

Post by JeffO » 2018/03/08 21:17:49

TrevorH wrote:Try using a standard ethernet card model to eliminate potential bugs in the (not so widely tested) microsoft adapter code. Pick an Intel E1000 model and use that. If that still does it then check in /var/log/messages and/or the dmesg command for errors.
This is a HyperV installation, there are two network models to choose from. Legacy Network Adapter and Standard Network Adapter. I've checked the log areas and see nothing regarding the network going to sleep or stopping. Thanks though.
pjsr2 wrote:The source of this problem could be on your CentOS guest or on you HyperV host, but it could also be a problem of a router in your network that drops routing information if the connection is "quiet" for a long time.

Anyway, as a workaround, I would add a small cron job that pings some external address (perhaps your gateway) at regular intervals.
I have made a cron job to ping every minute, but that's kind of a crude workaround that I really don't want to keep. I have used CentOS 7 on a number of virtual machines, but those installations were build 1611 on a Server 2012 R2 HyperV Install. The one I'm having issues with is build 1708 on a Server 2016 HyperV Install. I'm in the process of testing different builds of CentOS 7 on both Server versions to see if maybe it's a bug in the newer release of CentOS7 or if CentOS7 just isn't compatible with Server 2016.

I've never seen this issue before, I know it's not a router issues because I have other test machines (with other OS's) that do nothing and they are always reachable.

Post Reply