# Ethernet keeps timing out

## Xander314

I am setting up my main box after replacing the SSD, and I'm mainly doing this over SSH from my laptop. Whenever I leave it alone for a while (e.g. emerging a big package), the SSH connection has been interrupted by the time I return. On further investigation on the main box itself, it seems the whole connection has failed somehow. However, 

```
ifconfig eth0
```

 still shows the connection as active with an IP assigned. If I run

```
ping www.google.com
```

then it hangs for a while then starts running normally. After this starts working, I can successfully connect via SSH again.

I would appreciate any suggestions as I'm not really sure where to start with this. I wonder if the ethernet adapter is going into some kind of power saving mode when the connection becomes idle. However, that would be odd since I'm using the exact same kernel config and kernel as before I started reinstalling. I apologise for the lack of information but I'm not really sure where to start debugging this.

----------

## szatox

Looks more like a shitty connection.

You could try launching mtr instead of ping. Let it run for some time, perhaps it would show you where that problem occurs.

----------

## ct85711

 *Quote:*   

> still shows the connection as active with an IP assigned

 

By active IP, is it a normal IP address that you get or a trash IP like 169.x.x.x...  The 169.x.x.x address is the APIPA (trash address), a good indicator you lost your IP address.

When your you internet is down, did you ping like 8.8.8.8 to see if that works?  That can tell you that the DNS servers you are using may be the issue.

If pinging 8.8.8.8 doesn't work, try pinging to see if you can ping your default gateway (you must have a normal IP address, you can get the info from ifconfig, otherwise the address typically ends with .1 or .254

Each part helps narrow down the more common issues, like DHCP, DNS; if you can't ping to your default gateway, you may want to check your modem/router...

----------

## Roman_Gruber

Check that your ssh client has a setting to send keepalive packets to the server, and configure /etc/ssh/sshd_config for these settings 

*) ClientAliveInterval

*) ClientAliveCountMax

----------

## Xander314

 *Quote:*   

> 
> 
> Check that your ssh client has a setting to send keepalive packets to the server, and configure /etc/ssh/sshd_config for these settings 
> 
> *) ClientAliveInterval 
> ...

 

These are set. I think this is a problem with the network rather than SSH itself.

 *Quote:*   

> 
> 
> By active IP, is it a normal IP address that you get or a trash IP like 169.x.x.x... The 169.x.x.x address is the APIPA (trash address), a good indicator you lost your IP address. 
> 
> 

 

It was the correct IP assigned by my network administrator (via DHCP).

Thanks for the responses, but the problem seems to have disappeared so can't really pursue this in more depth for now.

----------

## Princess Nell

Are you using NetworkManager by any chance? This might be completely unrelated, but I've been having some strange problems after the latest upgrade that only went away after downgrading to the previous version. The symptom is that the new version, 1.4.4-r1, didn't acquire an ip address on the ethernet interface, despite the interface being up and activity lights on at both ends. Downgrading to 1.4.0-r1 seems to have fixed it. Stranger yet, the upgrade happened four days ago, I used the machine every day since, and the problem only appeared today.

----------

## Xander314

No, just netifrc with dhcpcd.

----------

