Ubuntu 16.04 O driver Realtek RTL8111 / 8168/8411 Ethernet não está mantendo uma conexão persistente

4

Estou com uma semana terrível tentando resolver um problema com minha conexão ethernet. A ethernet funciona bem por 1 minuto antes que eu perca a conexão. O ícone de redes no topo constantemente lê como conectado, mas eu tenho que desconectar e reconectar clicando em "Conexão com fio 1" por alguns segundos / minutos de conexão.

Para contornar esse problema, tenho uma tarefa cron executando a cada minuto para desconectar e reconectar com as seguintes linhas de código:

#!/bin/bash
sudo ifdown enp4s0
sudo ifup enp4s0

Por favor ajude. Eu preciso de uma solução mais permanente para uma conexão Ethernet estável.

lspci | grep -i realtek

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

lsmod | grep r816

r8168                 499712  0

dmesg | grep r816
    [    2.207551] r8168: loading out-of-tree module taints kernel.
    [    2.207789] r8168: module verification failed: signature and/or required key missing - tainting kernel
    [    2.208146] r8168 Gigabit Ethernet driver 8.044.02-NAPI loaded
    [    2.208243] r8168 0000:04:00.0: Default use INTx.
    [    2.230190] r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
    [    2.230194] r8168  Copyright (C) 2017  Realtek NIC software team <[email protected]> 
    [    2.305436] r8168 0000:04:00.0 enp4s0: renamed from eth0
    [   23.483150] r8168: enp4s0: link up
    [  866.740512] r8168: enp4s0: link up
    [71714.965195] r8168: enp4s0: link up
    [71773.494292] r8168: enp4s0: link up

sudo ethtool enp4s0

Settings for enp4s0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Speed: Unknown!
    Duplex: Half
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Supports Wake-on: pumbg
    Wake-on: ug
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: no



ifconfig
enp4s0    Link encap:Ethernet  HWaddr 00:26:18:11:78:a8  
          inet addr:192.168.26.30  Bcast:192.168.27.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:394947 errors:0 dropped:0 overruns:0 frame:0
          TX packets:278710 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:270000748 (270.0 MB)  TX bytes:37833932 (37.8 MB)
          Interrupt:18 Base address:0xa000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:38302 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:3045435 (3.0 MB)  TX bytes:3045435 (3.0 MB)

lshw

*-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:04:00.0
                logical name: enp4s0
                version: 01
                serial: 00:26:18:11:78:a8
                size: 1Gbit/s
                capacity: 1Gbit/s
                width: 64 bits
                clock: 33MHz
                capabilities: bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
                configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.044.02-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
                resources: irq:18 ioport:d800(size=256) memory:f9fff000-f9ffffff memory:f9fc0000-f9fdffff

cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo 
iface lo inet loopback



# The primary network interface
auto enp4s0
allow-hotplug enp4s0
iface enp4s0 inet dhcp

pre-up ifconfig enp4s0 hw ether 00:26:18:11:78:A8

cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=true

uname -r
4.8.0-58-generic

Coisas que fiz:

1) Instale o r8168-dkms usando o Synaptic.
2) Defina a seção "Método" das configurações de IPv6 para "ignorar". 3) Alterei meus servidores DNS da Internet para 8.8.8.8,8.8.4.4 ... etc.
4) Mude o "MTU" para 9000.
5) Arquivo de interface alterado para: auto lo iface lo inet loopback auto enp4s0 iface enp4s0 inet dhcp

bem como para estática.
6) sudo apt-get expurgo r8168-dkms de Conexão com fio do Ubuntu 14.04 continue desconectando
7) Tudo no link
8) Instale a versão antiga do r8168 e, em seguida:

sudo update-initramfs -u 
echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf

9) Leia as páginas de link org / archive / index.php / t-2291730.html
10) Tudo em https: // ubuntuforums dot org / showthread.php? T = 2248047
11) Inicialização a frio.
12)

sudo sh -c "echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo sh -c "echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo sh -c "echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo sysctl -p
sudo sed -i 's/false/true/g' /etc/NetworkManager/NetworkManager.conf
sudo reboot -i NOW

13) https: // narizmaj dot org / hardy-r8168
14) Teste o cabo ethernet com outros dispositivos.
15) Chorando

16) Perguntou a minha mãe.

UPDATE # 1

dkms status
bbswitch, 0.8, 4.8.0-36-generic, x86_64: installed
bbswitch, 0.8, 4.8.0-58-generic, x86_64: installed
nvidia-375, 375.66, 4.8.0-36-generic, x86_64: installed
nvidia-375, 375.66, 4.8.0-58-generic, x86_64: installed
r8168, 8.041.00: added

modinfo r8168 | grep -i version
version:        8.044.02-NAPI
srcversion:     5388F61A23A68A548D001CF
vermagic:       4.8.0-58-generic SMP mod_unload modversions 

sudo apt-get purge r8168-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  r8168-dkms*
0 upgraded, 0 newly installed, 1 to remove and 13 not upgraded.
After this operation, 1,109 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 243432 files and directories currently installed.)
Removing r8168-dkms (8.041.00-1) ...

------------------------------
Deleting module version: 8.041.00
completely from the DKMS tree.
------------------------------
Done.
Purging configuration files for r8168-dkms (8.041.00-1) ...

Comandos para remover:

sudo apt-get remove r8168-dkms
sudo apt-get purge r8168-dkms
sudo /sbin/modprobe -r r8168

Nenhum desses comandos removido 8.044.

UPDATE # 2

dkms status
bbswitch, 0.8, 4.8.0-36-generic, x86_64: installed
bbswitch, 0.8, 4.8.0-58-generic, x86_64: installed
nvidia-375, 375.66, 4.8.0-36-generic, x86_64: installed
nvidia-375, 375.66, 4.8.0-58-generic, x86_64: installed
r8168, 8.041.00: added

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

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=4.8.0-58-generic -C /lib/modules/4.8.0-58-generic/build M=/var/lib/dkms/r8168/8.041.00/build....(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/r8168-dkms.0.crash'
Error! Bad return status for module build on kernel: 4.8.0-58-generic (x86_64)
Consult /var/lib/dkms/r8168/8.041.00/build/make.log for more information.

cat /var/lib/dkms/r8168/8.041.00/build/make.log

DKMS make.log for r8168-8.041.00 for kernel 4.8.0-58-generic (x86_64)
Tue Jul 11 16:03:35 AST 2017
make: Entering directory '/usr/src/linux-headers-4.8.0-58-generic'
  LD      /var/lib/dkms/r8168/8.041.00/build/built-in.o
  CC [M]  /var/lib/dkms/r8168/8.041.00/build/r8168_n.o
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c: In function ‘rtl8168_fix_features’:
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:4212:30: error: ‘NETIF_F_ALL_CSUM’ undeclared (first use in this function)
                 features &= ~NETIF_F_ALL_CSUM;
                              ^
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:4212:30: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c: In function ‘rtl8168_start_xmit’:
/var/lib/dkms/r8168/8.041.00/build/r8168_n.c:24599:12: error: ‘struct net_device’ has no member named ‘trans_start’
         dev->trans_start = jiffies;
            ^
scripts/Makefile.build:289: recipe for target '/var/lib/dkms/r8168/8.041.00/build/r8168_n.o' failed
make[1]: *** [/var/lib/dkms/r8168/8.041.00/build/r8168_n.o] Error 1
Makefile:1491: recipe for target '_module_/var/lib/dkms/r8168/8.041.00/build' failed
make: *** [_module_/var/lib/dkms/r8168/8.041.00/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.8.0-58-generic'

UPDATE # 3

Depois de tentar e falhar com o r8168 V 8.042 ... Eu tentei a versão 8.043.02 e tive algum tipo de sucesso, embora ainda não tenhamos chegado à solução final.

sudo dkms build r8168/8.043.02 -k "$(uname -r)/$(uname -p)"
Module r8168/8.043.02 already built for kernel 4.8.0-58-generic/4

sudo dkms install r8168/8.043.02 -k "$(uname -r)/$(uname -p)"
Module r8168/8.043.02 already installed on kernel 4.8.0-58-generic/x86_64

dkms status
bbswitch, 0.8, 4.8.0-58-generic, x86_64: installed
nvidia-375, 375.66, 4.8.0-58-generic, x86_64: installed
r8168, 8.043.02, 4.8.0-58-generic, x86_64: installed (WARNING! Diff between built and installed module!)

UPDATE # 4

ls -al /var/lib/dkms/r8168
total 12
drwxr-xr-x 3 root root 4096 Jul 11 16:43 .
drwxr-xr-x 5 root root 4096 Jul 11 16:42 ..
drwxr-xr-x 4 root root 4096 Jul 11 16:43 8.043.02
lrwxrwxrwx 1 root root   32 Jul 11 16:43 kernel-4.8.0-58-generic-x86_64 -> 8.043.02/4.8.0-58-generic/x86_64

modinfo r8168 | grep -i version
version:        8.044.02-NAPI
srcversion:     5388F61A23A68A548D001CF
vermagic:       4.8.0-58-generic SMP mod_unload modversions 


ls -al /lib/modules/4.8.0-58-generic/updates/dkms
total 18624
drwxr-xr-x 2 root root     4096 Jul  1 11:01 .
drwxr-xr-x 3 root root     4096 Jul  1 11:00 ..
-rw-r--r-- 1 root root    22720 Jul  1 11:00 bbswitch.ko
-rw-r--r-- 1 root root    85488 Jul  1 11:01 nvidia_375_drm.ko
-rw-r--r-- 1 root root 16735368 Jul  1 11:01 nvidia_375.ko
-rw-r--r-- 1 root root  1086360 Jul  1 11:01 nvidia_375_modeset.ko
-rw-r--r-- 1 root root  1124728 Jul  1 11:01 nvidia_375_uvm.ko

modinfo /lib/modules/4.8.0-58-generic/updates/dkms/r8168.ko
modinfo: ERROR: Module /lib/modules/4.8.0-58-generic/updates/dkms/r8168.ko not found.

ATUALIZAÇÃO 5

Parece que este comando removeu o driver 8.044 e agora tudo o que resta é o driver 8.043.02.

sudo apt-get -y dist-upgrade
    
por Gpu Center 07.07.2017 / 23:56

1 resposta

3

Dos comentários ...

  1. você realmente faz precisa executar o r8168-dkms em sua configuração

  2. desfaça todas as alterações que você fez ... elas não corrigiram o problema, apenas criaram novas

  3. Após uma análise mais detalhada, vejo que você está usando o r8168-dkms (8.044.02-NAPI) para o Ubuntu 17.10 (em um sistema 16.04). Por favor, instale a versão correta e teste novamente .

  4. Na sua GUI de rede, você tem vários perfis de "Conexão com fio" configurados. Eles seriam denominados Conexão com fio, Conexão com fio 1, Conexão com fio 2, etc. Excluir tudo, exceto para Conexão com fio.

Atualização # 1:

Assumindo que o status atual é que dkms status mostra r8168, 8.041.00 : added ...

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

Nota: você pode ter que confirmar os valores corretos de r8168 / 8.041.00 (module / version) procurando em /usr/src ou /var/lib/dkms/r8168 .

dkms status

Deve mostrar r8168, 8.041.0 installed .

reboot
modinfo r8168 | grep -i version

Deveria dizer 8.041.00 .

Atualização nº 2:

  • r8168 v8.041.00 era muito antigo para 16.04.2 (kernel 4.8.0-58)
  • agora estamos usando o r8168 v8.043.02

Atualização 3:

Removeremos completamente o r8168-dkms e o un-blacklist r8169 e, em seguida, reinstalaremos o r8168-dkms dos repositórios do Ubuntu.

  • sudo dkms remove r8168/8.043.02 -k "$(uname -r)/$(uname -p)"
  • sudo apt-get purge r8168-dkms
  • cd /var/lib/dkms
  • %código%
    • não deve mostrar r8168
  • ls -al
  • %código%
    • não deve mostrar r8168.043.02
  • %código%
    • não deve mostrar r8168.ko
  • cd /usr/src
  • %código%
    • não deve mostrar arquivos
  • %código%
    • edita a saída do grep em questão como atualização #n
  • ls -al
  • find /lib -name r8168.ko
  • cd /etc/modprobe.d
  • pare aqui, faça um ping me no @heynnema
por heynnema 08.07.2017 / 01:27