如何阻止我的以太网网络连接断开?

Sea*_*ill 16 networking 11.04 realtek

我的基于以太网的网络连接无法始终如一。我正在对网关运行 ping,它将:

  • 工作一分钟
  • 冻结、超时或提供多秒响应时间
  • 重复

如果它被卡住并且我通过网络管理器小程序禁用/启用网络,一切都会再次正常工作一分钟。传输 280 个数据包后,我的数据包丢失率为 41%。我尝试了不同的电缆并连接到网关,但这没有效果。到网关的距离只有大约 3 英尺。

如果我切换到 Windows,似乎工作正常,但 Ubuntu 是我的主要操作系统,我现在甚至无法使用它,因为我依赖于网络。

我的设置...

  • 操作系统:Ubuntu 11.04,双启动 Windows 7
  • 主板:技嘉Z68X-UD4-B3
  • CPU:英特尔酷睿 i7 2600K

编辑

稍微澄清一下......网络管理器仍然显示我已连接,但我无法访问网关或其他任何东西。NM 绝不会提示连接丢失,调用 ifconfig 显示我仍有 IP 地址。

我尝试使用不同的电缆连接到不同的网关,但出现了同样的问题。

按照要求:

lspci | grep -i eth
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

dmesg | tail -f
[   14.024709] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro,commit=0
[   14.026443] EXT4-fs (sda7): re-mounted. Opts: commit=0
[   14.176101] hda-intel: IRQ timing workaround is activated for card #2. Suggest a bigger bdl_pos_adj.
[   23.917731] eth0: no IPv6 routers present
[  726.109697] r8169 0000:07:00.0: eth0: link up
[  733.169494] r8169 0000:07:00.0: eth0: link up
[  753.930119] r8169 0000:07:00.0: eth0: link up
[  880.787332] r8169 0000:07:00.0: eth0: link up
[ 1159.161283] r8169 0000:07:00.0: eth0: link up
[ 1406.623550] r8169 0000:07:00.0: eth0: link up
Run Code Online (Sandbox Code Playgroud)

编辑

@roland-taylor:网络在 Windows 下始终可用。Ping 不会超时,应用程序不会抱怨网络不可用,大量下载不会中断或变慢。

小智 13

下载realtek官方驱动。

http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=5&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2

然后从linux内核中删除r8169模块。

# rmmod r8169

<Quick install with proper kernel settings>
Unpack the tarball :
# tar vjxf r8168-8.aaa.bb.tar.bz2
Change to the directory:
# cd r8168-8.aaa.bb
If you are running the target kernel, then you should be able to do :
# ./autorun.sh (as root or with sudo)
You can check whether the driver is loaded by using following commands.
# lsmod | grep r8168
# ifconfig -a
If there is a device name, ethX, shown on the monitor, the linux
driver is loaded. Then, you can use the following command to activate
the ethX.
# ifconfig ethX up
Run Code Online (Sandbox Code Playgroud)

最后,将 r8169 驱动程序列入黑名单,将以下内容添加到 /etc/modprobe.d/blacklist.conf:

#blacklist r8169 driver
blacklist r8169
Run Code Online (Sandbox Code Playgroud)

我在http://www.rvdavid.net/how-to-get-gigabit-speeds-from-rtl81118168b-pci-express-gigabit-ethernet-controller-on-ubuntu-linux/ 上找到了它,它工作正常。现在一切都很好,网速。


Dre*_*rew 8

只是为了下次我的 SSD 爆炸时我可以找到它。以下是在 Ubuntu w/Linux Kernel 3.x 上移除损坏的 r8169 和插入 r8168 的说明。

内核 3.x

  • 下载r8168
  • 如果仍然标记为未解决,请应用此补丁
  • 停止:如果您打算使用 DKMS,请立即跳至 DKMS 部分。
  • 运行sudo ./autogen.sh,它将构建模块,删除旧模块(如果需要,将其列入黑名单)并将 r8168.ko 安装到 /lib/modules/'uname -r'/drivers/net/。

数据管理系统

DKMS 将在新内核安装时构建和安装模块。您还需要将旧模块列入黑名单。

如果您还没有将旧模块列入黑名单。

echo 'rmmod r8169' | sudo tee /etc/modprobe.d/blacklist.conf
Run Code Online (Sandbox Code Playgroud)

安装 DKMS 和 gcc。

sudo apt-get install dkms gcc

将模块源文件复制到一个永久位置,这样以后就不会意外删除它们。

sudo cp -R r8168-8.025.00 /usr/src

echo 'PACKAGE_NAME=r8168
PACKAGE_VERSION=8.025.00
MAKE[0]="make"
BUILT_MODULE_NAME[0]=r8168
BUILT_MODULE_LOCATION[0]="src/"
DEST_MODULE_LOCATION[0]="/kernel/updates/dkms"
AUTOINSTALL="YES"' | sudo tee /usr/src/r8168-8.025.00/dkms.conf
Run Code Online (Sandbox Code Playgroud)

然后跑,

dkms add -m r8168 -v 8.025.00
dkms build -m r8168 -v 8.025.00
dkms install -m r8168 -v 8.019.00
sudo update-initramfs -u
Run Code Online (Sandbox Code Playgroud)