Je passe une semaine terrible à essayer de résoudre un problème de connexion Ethernet. L'Ethernet fonctionne bien pendant 1 minute avant que je perde la connexion. L'icône de réseau située en haut de la page indique constamment que la connexion est établie, mais je dois me déconnecter et me reconnecter en cliquant sur "Connexion filaire 1" pendant quelques secondes/minutes de connexion.
Pour résoudre ce problème, je dois exécuter une tâche cron toutes les minutes pour déconnecter et reconnecter avec les lignes de code suivantes:
#!/bin/bash
Sudo ifdown enp4s0
Sudo ifup enp4s0
S'il vous plaît aider. J'ai besoin d'une solution plus permanente pour une connexion Ethernet stable.
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
Choses que j'ai faites:
1) Installez le r8168-dkms à l’aide de Synaptic.
2) Définissez la section "Méthode" des paramètres IPv6 sur "Ignorer".
3) Changé mes serveurs DNS Internet en 8.8.8.8.8.8.4.4 ... etc.
4) Changez le "MTU" en 9000.
5) Fichier d'interface remplacé par: auto lo iface lo inet loopback auto enp4s0 iface enp4s0 inet dhcp
ainsi que pour statique.
6) Sudo apt-get purge r8168-dkms de la connexion filaire Ubuntu 14.04 continue de se déconnecter
7) Tout sur https://unixblogger.com/2011/10/18/the-pain-of-an-realtek-rtl8111rtl8168-ethernet-card/
8) Installez l’ancienne version de r8168, puis:
Sudo update-initramfs -u
echo "blacklist r8169" | Sudo tee -a /etc/modprobe.d/blacklist.conf
9) Lire les pages de https: // ubuntuforums dot org/archive/index.php/t-2291730.html
10) Tout sur https: // ubuntuforums point org/showthread.php? T = 2248047
11) Démarrage à froid.
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: // nosemaj point org/hardy-r8168
14) Testez le câble Ethernet avec d'autres périphériques.
15) Pleurer.
16) A demandé à ma mère.
MISE À JOUR # 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) ...
Commandes à supprimer:
Sudo apt-get remove r8168-dkms
Sudo apt-get purge r8168-dkms
Sudo /sbin/modprobe -r r8168
Aucune de ces commandes supprimées 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
Après avoir essayé et échoué avec r8168 V 8.042 ... j'ai essayé la version 8.043.02 et j'ai eu un certain succès, bien que nous ne soyons pas encore à la solution finale.
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.
UPDATE 5
Il semble que cette commande ait supprimé le pilote 8.044 et qu'il ne reste plus que le pilote 8.043.02.
Sudo apt-get -y dist-upgrade
D'après les commentaires ...
vous avez vraiment do besoin d'exécuter r8168-dkms dans votre configuration
annuler toutes les modifications que vous avez apportées ... elles ne résolvent pas le problème, mais en créent de nouvelles
Après un examen plus approfondi, je constate que vous utilisez le logiciel r8168-dkms (8.044.02-NAPI) pour Ubuntu 17.10 (sur un système 16.04). S'il vous plaît installez la version correcte et retester.
Dans votre interface graphique réseau, vous avez configuré plusieurs profils de "connexion filaire". Ils s'appelleraient Connexion filaire, Connexion filaire 1, Connexion filaire 2, etc. Supprimez tout sauf la connexion filaire.
Mise à jour # 1:
En supposant que l’état actuel est que dkms status
affiche 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)"
Remarque: vous devrez peut-être confirmer les valeurs correctes de r8168/8.041. (module/version) en recherchant /usr/src
ou /var/lib/dkms/r8168
.
dkms status
Devrait montrer r8168, 8.041.0 installed
.
reboot
modinfo r8168 | grep -i version
Devrait dire 8.041.00
.
Mise à jour # 2:
Mise à jour # 3:
Nous allons supprimer complètement r8168-dkms et supprimer la liste noire r8169, puis réinstaller r8168-dkms à partir du dépôt Ubuntu.
Sudo dkms remove r8168/8.043.02 -k "$(uname -r)/$(uname -p)"
Sudo apt-get purge r8168-dkms
cd /var/lib/dkms
ls -al
cd /usr/src
ls -al
find /lib -name r8168.ko
cd /etc/modprobe.d
ls -al r8168*
grep -i r816 *
cd
name__Sudo modprobe -r r8168
Sudo update-initramfs -u -k "$(uname -r)"