![在 Ubuntu 16.04 中暂停 PC 并重新启动后,有线连接无法连接](https://linux22.com/image/1001893/%E5%9C%A8%20Ubuntu%2016.04%20%E4%B8%AD%E6%9A%82%E5%81%9C%20PC%20%E5%B9%B6%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E5%90%8E%EF%BC%8C%E6%9C%89%E7%BA%BF%E8%BF%9E%E6%8E%A5%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5.png)
挂起电脑并重新启动后有线连接无法连接。系统是 Ubuntu 16.04 LTS。
命令输出lspci
:
00:00.0 Host bridge: Intel Corporation Device 590f (rev 05)
00:02.0 VGA compatible controller: Intel Corporation Device 5902 (rev 04)
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)
00:1c.5 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #6 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)
并且输出lspci -k | grep -iA3 ethernet
(我不知道这个命令显示什么,但是我在谷歌中寻找答案时遇到了这个命令):
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)
Subsystem: ASRock Incorporation Motherboard (one of many)
Kernel driver in use: r8169
Kernel modules: r8169`
编辑于 2017 年 9 月 9 日星期六:我尝试从 realtek 网站安装 r8168 驱动程序。首先,我按照此网站中的手动说明进行操作:https://unixblogger.com/2016/08/11/how-to-get-your-realtek-rtl8111rtl8168-working-updated-guide/
我尝试通过在终端输入代码来安装依赖项:
sudo apt-get install build-essential linux-headers-$(uname -r)
然后我从 Realtek 的网站下载了驱动程序:http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2
我下载的版本支持最高 4.7 版的内核 Linux 驱动程序。我不确定是不是这个原因导致了我的问题。
然后我通过以下代码将已经安装并正在运行的 r8169 驱动程序列入黑名单:
user@linux:~$ sudo sh -c 'echo blacklist r8169 >> /etc/modprobe.d/blacklist.conf'
然后我通过以下代码解压了档案:tar xfvj 0009-r8168-8.044.02.tar.bz2
显示了以下输出:
r8168-8.044.02/
r8168-8.044.02/autorun.sh
r8168-8.044.02/Makefile
r8168-8.044.02/README
r8168-8.044.02/src/
r8168-8.044.02/src/Makefile
r8168-8.044.02/src/Makefile_linux24x
r8168-8.044.02/src/r8168.h
r8168-8.044.02/src/r8168_asf.c
r8168-8.044.02/src/r8168_asf.h
r8168-8.044.02/src/r8168_dash.h
r8168-8.044.02/src/r8168_fiber.h
r8168-8.044.02/src/r8168_n.c
r8168-8.044.02/src/r8168_realwow.h
r8168-8.044.02/src/rtltool.c
r8168-8.044.02/src/rtltool.h
r8168-8.044.02/src/rtl_eeprom.c
r8168-8.044.02/src/rtl_eeprom.h
之后我进入该文件夹r8168-8.044.02/
并编译了脚本 autorun.sh sudo ./autorun.sh
,它在终端上显示了以下输出:
Check old driver and unload it.
rmmod r8169
Build the module and install
At main.c:158:
- SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:175
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:178
sign-file: certs/signing_key.pem: No such file or directory
Backup r8169.ko
rename r8169.ko to r8169.bak
DEPMOD 4.10.0-33-generic
load module r8168
Updating initramfs. Please wait.
update-initramfs: Generating /boot/initrd.img-4.10.0-33-generic
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
Completed.
然后我运行此代码:lsmod | grep r8168
输出:r8168 499712 0
然后我就跑sudo ethtool -i enp2s0
。
之后,我暂停了我的 PC 并重新打开它,但它遇到了同样的问题,暂停后它无法连接到有线连接。我不得不重新启动它才能获得有效的以太网连接。重新启动后,我尝试自动安装它而不是手动安装,所以我编辑了/etc/apt/sources.list
,我将其更改xenial main restricted
为xenial main restricted universe
。然后我sudo apt-get update
,然后我sudo apt-get install r8168-dkms
。但是,当我暂停 PC 时,这些事情也没有帮助。所以,我不得不再次重新启动才能获得互联网连接。
重新启动后,我按照此站点上的一些说明进行操作:https://nosemaj.org/hardy-r8168。
我跑:
sudo bash
然后rmmod r8169
输出哪个rmmod: ERROR: Module r8169 is not currently loaded
。
然后make clean
输出:
make -C src/ clean
make[1]: Entering directory '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src'
make -C /lib/modules/4.10.0-33-generic/build SUBDIRS=/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src clean
make[2]: Entering directory '/usr/src/linux-headers-4.10.0-33-generic'
CLEAN /home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src/.tmp_versions
rm: cannot remove '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src/.tmp_versions/r8168.mod': Permission denied
Makefile:1569: recipe for target 'clean' failed
make[2]: *** [clean] Error 1
make[2]: Leaving directory '/usr/src/linux-headers-4.10.0-33-generic'
Makefile:99: recipe for target 'clean' failed
make[1]: *** [clean] Error 2
make[1]: Leaving directory '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src'
Makefile:47: recipe for target 'clean' failed
make: *** [clean] Error 2
然后make modules
输出:
make -C src/ modules
make[1]: Entering directory '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src'
make -C /lib/modules/4.10.0-33-generic/build SUBDIRS=/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src modules
make[2]: Entering directory '/usr/src/linux-headers-4.10.0-33-generic'
rm: cannot remove '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src/.tmp_versions/r8168.mod': Permission denied
Makefile:1511: recipe for target 'crmodverdir' failed
make[2]: *** [crmodverdir] Error 1
make[2]: Leaving directory '/usr/src/linux-headers-4.10.0-33-generic'
Makefile:95: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/garakchy/my_stuff_002/drivers_I_downloaded/r8168-8.044.02/src'
Makefile:40: recipe for target 'modules' failed
make: *** [modules] Error 2
然后make install
等等。毕竟,我暂停了我的 PC 并重新打开它,它完全崩溃了,完全停止了工作,更不用说不工作的以太网连接了。我的 PC 卡住了。我重新启动。重新启动后,我的 PC 暂时工作正常,但我想回到默认安装的 r8169 驱动程序。所以,我改变了modprobe.d/blacklist.conf
,我在那里删除了 r8169,并改写了 r8168。
命令输出sudo lshw -class 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: 02
serial: d0:50:99:72:eb:0c
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd 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 ip=192.168.1.26 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:17 ioport:e000(size=256) memory:d0010000-d0010fff memory:d0000000-d000ffff memory:90000000-9000ffff
即使我已将其列入黑名单,它仍然显示 r8168 为驱动程序。
以下是我认为有用的其他一些信息:http://paste.ubuntu.com/25497742/
########## wireless info START ##########
Report from: 09 Sep 2017 16:58 +03 +0300
Booted last: 09 Sep 2017 00:00 +03 +0300
Script from: 25 Mar 2017 07:04 UTC +0000
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
##### kernel ############################
Linux 4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Parameters: ro, quiet, splash, vt.handoff=7
##### desktop ###########################
Ubuntu
##### lspci #############################
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 02)
Subsystem: ASRock Incorporation Motherboard (one of many) [1849:8168]
Kernel driver in use: r8168
##### lsusb #############################
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 046d:c52f Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
##### PCMCIA card info ##################
##### rfkill ############################
##### lsmod #############################
mxm_wmi 16384 0
wmi 16384 1 mxm_wmi
##### interfaces ########################
auto lo
iface lo inet loopback
##### ifconfig ##########################
enp2s0 Link encap:Ethernet HWaddr <MAC 'enp2s0' [IF1]>
inet addr:192.168.1.26 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::9d89:9a06:9c3c:aa5f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:841359 errors:0 dropped:0 overruns:0 frame:0
TX packets:508522 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1206038659 (1.2 GB) TX bytes:39262133 (39.2 MB)
Interrupt:17 Base address:0xd000
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:3258 errors:0 dropped:0 overruns:0 frame:0
TX packets:3258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:329425 (329.4 KB) TX bytes:329425 (329.4 KB)
##### iwconfig ##########################
enp2s0 no wireless extensions.
lo no wireless extensions.
##### route #############################
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp2s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s0
##### resolv.conf #######################
nameserver 127.0.1.1
search home
##### network managers ##################
Installed:
NetworkManager
Running:
root 826 1 0 15:07 ? 00:00:00 /usr/sbin/NetworkManager --no-daemon
##### NetworkManager info ###############
GENERAL.DEVICE: enp2s0
GENERAL.TYPE: ethernet
GENERAL.NM-TYPE: NMDeviceEthernet
GENERAL.VENDOR: Realtek Semiconductor Co., Ltd.
GENERAL.PRODUCT: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (Motherboard (one of many))
GENERAL.DRIVER: r8168
GENERAL.DRIVER-VERSION: 8.044.02-NAPI
GENERAL.FIRMWARE-VERSION:
GENERAL.HWADDR: <MAC 'enp2s0' [IF1]>
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.REASON: 0 (No reason given)
GENERAL.UDI: /sys/devices/pci0000:00/0000:00:1c.5/0000:02:00.0/net/enp2s0
GENERAL.IP-IFACE: enp2s0
GENERAL.IS-SOFTWARE: no
GENERAL.NM-MANAGED: yes
GENERAL.AUTOCONNECT: yes
GENERAL.FIRMWARE-MISSING: no
GENERAL.NM-PLUGIN-MISSING: no
GENERAL.PHYS-PORT-ID: --
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-UUID: 10942507-8479-3f0f-aa05-39f5cfc92e15
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/0
GENERAL.METERED: no (guessed)
CAPABILITIES.CARRIER-DETECT: yes
CAPABILITIES.SPEED: 100 Mb/s
CAPABILITIES.IS-SOFTWARE: no
WIRED-PROPERTIES.CARRIER: on
CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/{0}
CONNECTIONS.AVAILABLE-CONNECTIONS[1]: 10942507-8479-3f0f-aa05-39f5cfc92e15 | Wired connection 1
IP4.ADDRESS[1]: 192.168.1.26/24
IP4.GATEWAY: 192.168.1.1
IP4.ROUTE[1]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]: 192.168.1.1
IP4.DOMAIN[1]: home
DHCP4.OPTION[1]: requested_ms_classless_static_routes = 1
DHCP4.OPTION[2]: requested_domain_search = 1
DHCP4.OPTION[3]: requested_host_name = 1
DHCP4.OPTION[4]: requested_time_offset = 1
DHCP4.OPTION[5]: requested_domain_name = 1
DHCP4.OPTION[6]: requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[7]: requested_broadcast_address = 1
DHCP4.OPTION[8]: requested_wpad = 1
DHCP4.OPTION[9]: requested_netbios_scope = 1
DHCP4.OPTION[10]: next_server = 0.0.0.0
DHCP4.OPTION[11]: expiry = 1505045259
DHCP4.OPTION[12]: requested_interface_mtu = 1
DHCP4.OPTION[13]: requested_subnet_mask = 1
DHCP4.OPTION[14]: routers = 192.168.1.1
DHCP4.OPTION[15]: dhcp_message_type = 5
DHCP4.OPTION[16]: ip_address = 192.168.1.26
DHCP4.OPTION[17]: requested_static_routes = 1
DHCP4.OPTION[18]: domain_name = home
DHCP4.OPTION[19]: dhcp_renewal_time = 43200
DHCP4.OPTION[20]: requested_domain_name_servers = 1
DHCP4.OPTION[21]: broadcast_address = 192.168.1.255
DHCP4.OPTION[22]: domain_name_servers = 192.168.1.1 192.168.1.1
DHCP4.OPTION[23]: requested_ntp_servers = 1
DHCP4.OPTION[24]: dhcp_lease_time = 86400
DHCP4.OPTION[25]: dhcp_rebinding_time = 75600
DHCP4.OPTION[26]: requested_netbios_name_servers = 1
DHCP4.OPTION[27]: subnet_mask = 255.255.255.0
DHCP4.OPTION[28]: network_number = 192.168.1.0
DHCP4.OPTION[29]: requested_routers = 1
DHCP4.OPTION[30]: dhcp_server_identifier = 192.168.1.1
IP6.ADDRESS[1]: fe80::9d89:9a06:9c3c:aa5f/64
IP6.GATEWAY:
##### NetworkManager.state ##############
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
##### NetworkManager.conf ###############
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
##### NetworkManager profiles ###########
##### iw reg get ########################
Region: Europe/Istanbul (based on set time zone)
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
##### iwlist channels ###################
enp2s0 no frequency information.
lo no frequency information.
##### iwlist scan #######################
enp2s0 Interface doesn't support scanning.
lo Interface doesn't support scanning.
##### module infos ######################
##### module parameters #################
##### /etc/modules ######################
##### modprobe options ##################
[/etc/modprobe.d/blacklist-ath_pci.conf]
blacklist ath_pci
[/etc/modprobe.d/blacklist.conf]
blacklist evbug
blacklist usbmouse
blacklist usbkbd
blacklist eepro100
blacklist de4x5
blacklist eth1394
blacklist snd_intel8x0m
blacklist snd_aw2
blacklist i2c_i801
blacklist prism54
blacklist bcm43xx
blacklist garmin_gps
blacklist asus_acpi
blacklist snd_pcsp
blacklist pcspkr
blacklist amd76x_edac
blacklist r8168
[/etc/modprobe.d/blacklist-rare-network.conf]
alias net-pf-3 off
alias net-pf-6 off
alias net-pf-9 off
alias net-pf-11 off
alias net-pf-12 off
alias net-pf-19 off
alias net-pf-21 off
alias net-pf-36 off
[/etc/modprobe.d/iwlwifi.conf]
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
[/etc/modprobe.d/mlx4.conf]
softdep mlx4_core post: mlx4_en
##### rc.local ##########################
exit 0
##### pm-utils ##########################
##### udev rules ########################
##### dmesg #############################
[ 27.284525] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[ 27.284681] enp2s0: 0xffff9b47c0c8d000, <MAC 'enp2s0' [IF1]>, IRQ 17
[ 27.312137] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[ 30.374732] r8168: enp2s0: link up
[ 30.374745] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0: link becomes ready
########## wireless info END ############
我不知道该怎么办。你能帮我吗?谢谢