2

I have recently installed Ubuntu 16.04 for dual-booting on a desktop that already had Windows 10 installed, and I'm having network issues in Ubuntu. The connection works perfectly fine in Windows. I have a wired connection.

In Ubuntu, it appears like I can only actually have the connection work for a few seconds, up to maybe a minute. Most of the time, when I attempt to go to a new webpage for example, it fails. In can rather consistently fix this every time by manually breaking the connection (Ubuntu appears to think it is still connected, just Firefox can't actually find any pages), and re-connecting. Then it'll work for a few seconds, which I can use to quickly browse to the page I wanted to go to.

I did find many other similar questions and answers, but most answers seem to be about specifically editing certain files or entering commands in the terminal based on output the specific user had. So... I don't think it's a good idea for me to just blindly follow any such instructions from answers given to other people based on their output which may be different in my case, and rather just ask for my situation specifically here.

I did follow the following steps in Windows which I found somewhere, but this didn't fix the issue for me:

Right click my computer and choose "Properties"
--> "Hardware" tab   --> Device Manager
 --> Network Adapters
  --> "double click" Realtek ...
   --> Advanced tab
    --> Wake-On-Lan After Shutdown
     --> Enable

I also saw it mentioned somewhere that it might help to completely shut down Windows and manually turn on the PC again, instead of rebooting from Windows and then booting into Ubuntu, but this also makes no difference for me.

Some commands and the output I receive from Ubuntu:

in:

$ lspci | grep -i eth

output:

06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)

in:

$ ifconfig -a

output:

enp6s0    Link encap:Ethernet  HWaddr d0:17:c2:d3:d8:19  
      inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
      inet6 addr: fe80::5eb0:b570:8edf:ddf7/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:18521 errors:0 dropped:0 overruns:0 frame:0
      TX packets:16981 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:11094182 (11.0 MB)  TX bytes:1719007 (1.7 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:7164 errors:0 dropped:0 overruns:0 frame:0
      TX packets:7164 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:528834 (528.8 KB)  TX bytes:528834 (528.8 KB)

in:

$ sudo lshw -C network

output:

  *-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:06:00.0
   logical name: enp6s0
   version: 15
   serial: d0:17:c2:d3:d8:19
   size: 1Gbit/s
   capacity: 1Gbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix 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=rtl8168h-2_0.0.2 02/26/15 ip=192.168.2.1 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
   resources: irq:123 ioport:d000(size=256) memory:f7104000-f7104fff memory:f7100000-f7103fff

Please also let me know if any of the stuff I pasted above is actually sensitive and if I should delete it :P


EDIT

in:

sudo lshw -C CPU

out:

  *-cpu                   
   description: CPU
   product: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
   vendor: Intel Corp.
   physical id: 43
   bus info: cpu@0
   version: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
   serial: To Be Filled By O.E.M.
   slot: LGA1151
   size: 900MHz
   capacity: 3600MHz
   width: 64 bits
   clock: 100MHz
   capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp cpufreq
   configuration: cores=4 enabledcores=4 threads=4

in:

sudo lshw -C network | grep -i driver

out:

configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.2.1 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s

in:

free -h

out:

total        used        free      shared  buff/cache   available

Mem: 15G 1,5G 12G 46M 1,1G 13G Swap: 15G 0B 15G

in:

swapon -s

out:

Filename                Type        Size    Used    Priority

/dev/sdb7 partition 15998972 0 -1


EDIT 2:

in:

dkms status

out:

r8168, 8.041.00: added

in:

sudo apt-get install dkms r8168-dkms

out:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
r8168-dkms is already the newest version (8.041.00-1).
dkms is already the newest version (2.2.0.3-2ubuntu11.3).
0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.

EDIT 3:

in:

dkms status

out:

r8168, 8.042.00, 4.10.0-28-generic, x86_64: installed

EDIT 4:

in:

ls -al /usr/src

out:

total 28
drwxr-xr-x  7 root root 4096 Sep 10 20:00 .
drwxr-xr-x 11 root root 4096 Aug  1 13:24 ..
drwxr-xr-x 27 root root 4096 Aug  1 13:23 linux-headers-4.10.0-28
drwxr-xr-x  7 root root 4096 Aug  1 13:23 linux-headers-4.10.0-28-generic
drwxr-xr-x 27 root root 4096 Sep 10 20:00 linux-headers-4.10.0-33
drwxr-xr-x  7 root root 4096 Sep 10 20:00 linux-headers-4.10.0-33-generic
drwxr-xr-x  2 root root 4096 Sep 10 16:16 r8168-8.042.00

2 Answers2

3

You have a r8168 ethernet controller, and it's using a buggy r8169 driver.

Replace the driver this way:

In terminal...

sudo apt-get update

sudo apt-get install dkms r8168-dkms

reboot

Disable secure boot in your BIOS.

Update #1:

dkms status shows us that the r8168 didn't complete its installation, so we'll have to do it manually.

In terminal...

sudo dkms build r8168/8.041.00 -k "$(uname -r)/$(uname -p)"
sudo dkms install r8168/8.041.00 -k "$(uname -r)/$(uname -p)"

dkms status
   # should show "r8168, 8.041.00: installed"

reboot

sudo lshw -C network
    # should show ethernet driver=r8168

Note: since the user was actually running 16.04.1/2/3, a slightly newer version of r8168 was needed. See r8168-dkms build fails on ubuntu 16.04.2.

wget http://mirrors.kernel.org/ubuntu/pool/universe/r/r8168/r8168-dkms_8.042.00-2_all.deb
sudo dpkg -i r8168-dkms_8.042.00-2_all.deb

Update #2:

You also have a problem with the MTU setting for your DSL connection.

For DSL, a common MTU setting is 1492. Just go ahead and try this value first and see if your web sites are now accessible.

To determine the correct setting, start with all MTU settings = 1500 and VPN = off. (VPN requires different testing).

In terminal:

ping [-c count] [-M do] [-s packet_size] [host]

The options used are:

  • c count: number of times to ping
  • M hint: Select Path MTU Discovery strategy. may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
  • s packet_size: Specifies the number of data bytes to be sent.

You should always start at 1472 and work your way down by 10 each time. Once you get a reply, go up by 1 until you get a fragmented packet. Take that value (last good value) and add 28 to the value to account for the various TCP/IP headers. Eg. let's say that 1452 was the proper packet size (where you first got an ICMP reply to your ping). The actual MTU size would be 1480, which is the optimum for the network we're working with.

ping -c 4 -M do -s 1472 8.8.8.8 # this will probably show fragmentation

ping -c 4 -M do -s 1462 8.8.8.8 # may show fragmentation

ping -c 4 -M do -s 1452 8.8.8.8 # no fragmentation?

ping -c 4 -M do -s 1453 8.8.8.8 # still no fragmentation?

reference: How to determine the proper MTU size with ICMP pings

heynnema
  • 70,711
  • Comments are not for extended discussion; this conversation has been moved to chat. – Thomas Ward Sep 10 '17 at 19:56
  • @heynnema My connection appears to be stable now. I have been able to browse for a while without issues, and didn't even have to disconnect/reconnect after a reboot. The only extra step I took after following all of your instructions was to set Method in the IPv6 Settings tab in the Network Manager to "Ignore". Thanks again for all your help! – Dennis Soemers Sep 11 '17 at 12:10
  • @DennisSoemers glad its working for you now! Thanks for the update. – heynnema Sep 11 '17 at 12:26
0

I had similar issues which were resolved by disabling IPv6 (didn't work but said to help) and finally installing ifplugd

This seems to have done the trick as my network connection has been stable for a couple of weeks now.

Simon
  • 1