问题:
网络不能ping通,dmesg显示很多
[6127619.851454] r8169 0000:02:00.0: eth0: link up [6127758.849559] r8169 0000:02:00.0: eth0: link up [6133605.103557] r8169 0000:02:00.0: eth0: link up [6137391.798434] r8169 0000:02:00.0: eth0: link up
重启后变好,等不久又不能ping通。
思路:
1.lspci 、lshw查看硬件型号,
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
2.查看驱动状态。
lsmod: r8169 62190 0 modinfo r8169 filename: /lib/modules/3.2.0-57-generic/kernel/drivers/net/ethernet/realtek/r8169.ko firmware: rtl_nic/rtl8168f-2.fw firmware: rtl_nic/rtl8168f-1.fw firmware: rtl_nic/rtl8105e-1.fw firmware: rtl_nic/rtl8168e-3.fw firmware: rtl_nic/rtl8168e-2.fw firmware: rtl_nic/rtl8168e-1.fw firmware: rtl_nic/rtl8168d-2.fw firmware: rtl_nic/rtl8168d-1.fw version: 2.3LK-NAPI license: GPL description: RealTek RTL-8169 Gigabit Ethernet driver author: Realtek and the Linux r8169 crew <netdev@vger.kernel.org> srcversion: 68C95644833EA999EB53AF1 alias: pci:v00000001d00008168sv*sd00002410bc*sc*i* alias: pci:v00001737d00001032sv*sd00000024bc*sc*i* alias: pci:v000016ECd00000116sv*sd*bc*sc*i* alias: pci:v00001259d0000C107sv*sd*bc*sc*i* alias: pci:v00001186d00004302sv*sd*bc*sc*i* alias: pci:v00001186d00004300sv*sd*bc*sc*i* alias: pci:v000010ECd00008169sv*sd*bc*sc*i* alias: pci:v000010ECd00008168sv*sd*bc*sc*i* alias: pci:v000010ECd00008167sv*sd*bc*sc*i* alias: pci:v000010ECd00008136sv*sd*bc*sc*i* alias: pci:v000010ECd00008129sv*sd*bc*sc*i* depends: intree: Y vermagic: 3.2.0-57-generic SMP mod_unload modversions parm: use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int) parm: debug:Debug verbosity level (0=none, ..., 16=all) (int)
为什么硬件型号是r8168,而驱动型号是r8169呢,应该是这个问题。因为ubuntu驱动中没有r8168型号的驱动。要自己手动更换。
下载驱动:
驱动地址:http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2
参考文档:http://ubuntuforums.org/showthread.php?t=1992200
截取步骤:
1) Download the driver and expand it into a new directory. cd to the top directory in the expanded directory. 2) sudo make clean modules 3) sudo make install 4) Verify that new file r8168.ko exists in directory /lib/modules/3.2.0-24-generic/kernel/drivers/net/ethernet/realtek/ 5) blacklist r8169 6) Edit /etc/initramfs-tools/modules and add a line with "r8168" on it. 7) sudo depmod -a 8 ) sudo update-initramfs -v -u -k `uname -r` 9) Reboot