2

On my main Ubuntu 16.04 machine I sometimes lose connectivity. When I try to ping the Google DNS I get the response: "connect: Network is unreachable".

I can fix it instantly by resetting the network interface, Turning wired network off and then on using a default GUI button. Does anyone know what the problem is?

Here's the ifconfig output:

enp2s0    Link encap:Ethernet  HWaddr c8:9c:dc:d9:76:59  
      inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::c46:e5e8:d89f:b5c6/64 Scope:Link
      inet6 addr: fdee:8069:28f3:0:5a3d:7482:bbd4:6520/64 Scope:Global
      inet6 addr: fdee:8069:28f3:0:685d:475b:a11a:b501/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:344379 errors:0 dropped:0 overruns:0 frame:0
      TX packets:190782 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:404790948 (404.7 MB)  TX bytes:14956805 (14.9 MB)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:24411 errors:0 dropped:0 overruns:0 frame:0
      TX packets:24411 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1 
      RX bytes:76904248 (76.9 MB)  TX bytes:76904248 (76.9 MB)

route output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         myhome.mynet    0.0.0.0         UG    100    0        0 enp2s0
10.0.0.0        *               255.255.255.0   U     100    0        0 enp2s0
link-local      *               255.255.0.0     U     1000   0        0 enp2s0

sudo lshw -C network

  *-network               
   description: Ethernet interface
   product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:02:00.0
   logical name: enp2s0
   version: 06
   serial: c8:9c:dc:d9:76:59
   size: 100Mbit/s
   capacity: 1Gbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet         physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl_nic/rtl8168e-2.fw ip=10.0.0.1 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
   resources: irq:26 ioport:e000(size=256) memory:fe400000-fe400fff memory:d0000000-d0003fff

And the wireless script output is here

If there are any other useful commands/files I should post let me know.

shepp
  • 23
  • Welcome to Ask Ubuntu! This script should give all the needed info to help you. Please upload it to pasteubuntu – M. Becerra Feb 27 '17 at 15:14
  • Edit your question to include the output of sudo lshw -C network and I can make a better recommendation. I want to see what driver your ethernet is using. Start new comments directed to me with @heynnema or I may miss them. – heynnema Feb 27 '17 at 16:18
  • @heynnema I updated the OP. – shepp Feb 28 '17 at 10:01
  • Run in a terminal sudo apt install r8168-dkms. Some r8168 revisions do not work well with r8169. – Pilot6 Feb 28 '17 at 18:44
  • @Pilot6 Did you notice that I marked this as a dup, AND answered the question, four hours earlier? – heynnema Feb 28 '17 at 21:16
  • @heynnema Yes i did ;-) But I do not think that installing synaptic to install one package is needed ))) – Pilot6 Feb 28 '17 at 21:19
  • @Pilot6 where do you see Synaptic in my answer? – heynnema Feb 28 '17 at 21:20
  • @heynnema That was another similar answer of yours;-) – Pilot6 Feb 28 '17 at 21:22
  • @Pilot6 that's why I marked it as dup, even though it was from Sep '16, and my answer, shown below, is an updated version of that one. Even when I mark as dup I still catch flak. – heynnema Feb 28 '17 at 21:24
  • I see no reason to VTC and answer at the same time. – Pilot6 Feb 28 '17 at 21:25
  • @Pilot6 because my current answer is an enhanced version of my answer from Sep '16. This answer doesn't use Synaptic. I marked this as dup so the OP could see the history, and to show if that the search had been used, they would have found their answer too. – heynnema Feb 28 '17 at 21:29
  • Why not expand the other answer? )) We have the same problem again. I am not telling that you just stole one of my answers )) that I posted years ago ;-) – Pilot6 Feb 28 '17 at 21:30

1 Answers1

0

As I thought, you're using the r8169 driver for your ethernet, and it's a buggy driver. One of its symptoms is the loss of connectivity. The fix is simple, install r8168-dkms.

In terminal...

  • sudo apt-get update
  • sudo apt-get install dkms r8168-dkms
  • reboot
heynnema
  • 70,711
  • r8169 is NOT a buggy driver. It is an in-tree driver, that does not perfectly support all revisions of the chip. I am using r8169 on all my computers. – Pilot6 Feb 28 '17 at 21:20
  • @Pilot6 it IS buggy if it "does not perfectly support all revisions of the chip". Also, you may not have the "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller" where this problem shows up. – heynnema Feb 28 '17 at 21:23
  • I do have RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller – Pilot6 Feb 28 '17 at 21:24
  • Thanks for the quick answer, I installed the module and I hope that's the end of my problems. – shepp Mar 03 '17 at 11:09