Occasionally losing wired LAN connection on Ubuntu 16.04

14

4

I've recently put Ubuntu MATE 16.04 on a computer, which I'm using as a file server, among other things. Twice in the past few days it's lost connection to the LAN. I was in a hurry to get it back up, so I unplugged the connection and replugged. It pulled an IP address again and reconnected to the network.

Now I'm starting to think it probably wasn't just an isolated incident and I'm going to have to figure out why it's losing its connection.

The first time it happened I noticed the network didn't have IP/DNS etc, but I didn't dig any further than that.

The next time this happens, how should I go about figuring out why the network device has lost the DHCP info and didn't query the DHCP server for a new lease (unless it did and failed for some reason)?

Update: I was going through some steps trying to diagnose what's been going on, I started off from this guide. When I got down to dhclient and ran sudo dhclient the machine reconnected to the network.

Pastie of diagnostics while I was disconnected. Did I miss anything?

Update 2: I think I found the culprit in /var/log/syslog.

Jun 11 10:40:19 nvidia avahi-daemon[886]: Withdrawing address record for 192.168.1.200 on enp4s0.
Jun 11 10:40:19 nvidia avahi-daemon[886]: Leaving mDNS multicast group on interface enp4s0.IPv4 with address 192.168.1.200.
Jun 11 10:40:19 nvidia avahi-daemon[886]: Interface enp4s0.IPv4 no longer relevant for mDNS.

leetwanker

Posted 2016-06-09T18:22:18.280

Reputation: 695

1Check cables to make sure they are not bad? Check if energy savings options are off to prevent network card sleep? – Peter – 2016-06-10T05:47:36.180

This is probably un-constructive, but if all you are using it for it a file-server, why do you need a GUI? Why not ubuntu-server? Although, I am not sure if this would fix your specific issue, I would first look into the Network-Manage service and Setting to see if there is a configuration issue. Maybe it is stopping? Or Maybe if you go to Edit Connections and select the Wired Connect 1 Unless you renamed it (Mine is called "Auto Wired") and under general make sure Auto Connect when network is available. – asmith – 2017-03-02T07:43:03.247

It could also be that on top of what Peter said, if you have a cable issues, router/switch issue where port disconnects or get powered down, or power saver is on and those with the Auto Connect not selected would cause this to happen every time there is a temp loss of network connection, even milliseconds. – asmith – 2017-03-02T07:44:57.353

Does this article help? http://www.hecticgeek.com/2017/04/ubuntu-17-04-systemd-dns-issues/

– Jeremy J Wong – 2017-06-01T23:42:13.833

So dhclient was not running (i.e., crashed)? – Marcel Waldvogel – 2017-06-27T11:50:56.957

Meet the same issue in Ubuntu-16.04. Before the upgrade, I uses 14.04, it has no such issue. – pengguang001 – 2017-07-21T07:53:58.147

Have you tried configuring a static IP address? I don't think the avahi-daemon is relevant here. – multithr3at3d – 2018-01-15T19:19:03.647

@multithr3at3d im suffering from a similiar problem. i have tried both DHCP and Static ips, both with same effect. – Gewure – 2018-03-02T04:05:45.867

@Gewure comments are not the place to ask a question. Post a new question. – multithr3at3d – 2018-03-02T04:13:08.253

I recently encountered this issue on Mint 17, which is based on Ubuntu 16.04 I think. I didn't find the issue when I re-booted to Windows. I wasn't able to solve it in the end, had to reinstall the entire OS. :-( This worked but it's rather crude. – James Smith – 2018-10-25T14:01:52.737

Answers

1

This is most likely an issue with avahi daemon and more than likely with .local domain.

Follow those steps in that order, one at the time:

  • change your domain from .local to FQDN
  • disable avahi from seeing this interface.
  • disable IPv6 if you don't use it
  • disable/remove avahi daemon if you don't need it ( I would start with this as you probably have no need for avahi anyway)

Chris

Posted 2016-06-09T18:22:18.280

Reputation: 1 766

2can you explain a little further why avahi could be the root? @Chris – Gewure – 2018-03-02T03:58:57.060

0

You don't say how often you lose the connect, but if you're using DHCP instead of a fixed IP, my first guess is that you are encountering the DHCP Lease Time set in your router.

Set your router DHCP range to leave out a chunk of adresses, then set your server to a fixed IP within the chunk not subject to DHCP.

user10216038

Posted 2016-06-09T18:22:18.280

Reputation: 107