Ubuntu14.04不能上网,请各位大神帮忙。

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Ubuntu14.04不能上网,请各位大神帮忙。

#1

帖子 sRs_Razer » 2014-09-02 13:23

http://zhidao.baidu.com/question/130251 ... up2&oldq=1
本人菜鸟一枚~这个是我在百度知道上的提问。查看有线连接信息什么都很正常啊,就是打不开网页。但是切换到win7就行。求各位大神解答!
taohunter
帖子: 1555
注册时间: 2012-03-31 3:29

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#2

帖子 taohunter » 2014-09-02 13:45

sRs_Razer 写了:http://zhidao.baidu.com/question/130251 ... up2&oldq=1
本人菜鸟一枚~这个是我在百度知道上的提问。查看有线连接信息什么都很正常啊,就是打不开网页。但是切换到win7就行。求各位大神解答!
呵呵,最近怎么这么多dhcp已经拿到ip却上不了网的案例,扎堆出现啊 :em04 。看了你在百度知道上的信息,似乎最大的可能是ubuntu上的有线网卡使用了有问题的驱动。

先把下面的命令的输出都贴上来看一下吧:

代码: 全选

uname -a
lspci
sudo lshw -C network
ifconfig 
ping 192.168.1.1 -c 4
tail /var/log/syslog -n 20
另外问一下,你的有线网络的配置是否是系统默认配置的,自己没有用命令直接修改过网络配置文件吧?
三年后终于回到16.04--稳定了!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#3

帖子 poloshiao » 2014-09-02 19:18

查看有线连接信息什么都很正常啊,就是打不开网页。
1. sudo ls -al /etc/resolv.conf
2. sudo cat /etc/resolv.conf
把結果直接複製 貼上來
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#4

帖子 sRs_Razer » 2014-09-03 8:37

taohunter 写了:
sRs_Razer 写了:http://zhidao.baidu.com/question/130251 ... up2&oldq=1
本人菜鸟一枚~这个是我在百度知道上的提问。查看有线连接信息什么都很正常啊,就是打不开网页。但是切换到win7就行。求各位大神解答!
呵呵,最近怎么这么多dhcp已经拿到ip却上不了网的案例,扎堆出现啊 :em04 。看了你在百度知道上的信息,似乎最大的可能是ubuntu上的有线网卡使用了有问题的驱动。

先把下面的命令的输出都贴上来看一下吧:

代码: 全选

uname -a
lspci
sudo lshw -C network
ifconfig 
ping 192.168.1.1 -c 4
tail /var/log/syslog -n 20
另外问一下,你的有线网络的配置是否是系统默认配置的,自己没有用命令直接修改过网络配置文件吧?
谢谢您的解答和帮助。我回去上传信息。
我的网络手动设置过IP 网管 和DNS,别的没有设置过。
我的网络是河南联通,如果用pppoe的话提示扫描了一个接口 但访问集中器没有响应 有可能是网线或者调制解调器的的线缆没接好 导致这样的另一原因可能是其他的pppoe进程正占用调制解调器。这是怎么回事儿?
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#5

帖子 sRs_Razer » 2014-09-03 10:09

poloshiao 写了:
查看有线连接信息什么都很正常啊,就是打不开网页。
1. sudo ls -al /etc/resolv.conf
2. sudo cat /etc/resolv.conf
把結果直接複製 貼上來
谢谢您的帮助。我中午就上传
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#6

帖子 sRs_Razer » 2014-09-03 11:41

taohunter 写了:
sRs_Razer 写了:http://zhidao.baidu.com/question/130251 ... up2&oldq=1
本人菜鸟一枚~这个是我在百度知道上的提问。查看有线连接信息什么都很正常啊,就是打不开网页。但是切换到win7就行。求各位大神解答!
呵呵,最近怎么这么多dhcp已经拿到ip却上不了网的案例,扎堆出现啊 :em04 。看了你在百度知道上的信息,似乎最大的可能是ubuntu上的有线网卡使用了有问题的驱动。

先把下面的命令的输出都贴上来看一下吧:

代码: 全选

uname -a
lspci
sudo lshw -C network
ifconfig 
ping 192.168.1.1 -c 4
tail /var/log/syslog -n 20
另外问一下,你的有线网络的配置是否是系统默认配置的,自己没有用命令直接修改过网络配置文件吧?
我贴上来了
gofox@gofox-To-be-filled-by-O-E-M:~$ uname -a
Linux gofox-To-be-filled-by-O-E-M 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
gofox@gofox-To-be-filled-by-O-E-M:~$ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B) (rev 02)
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B)
00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port D)
00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port H)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller (rev 40)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn PRO [Radeon HD 7850]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
02:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
gofox@gofox-To-be-filled-by-O-E-M:~$ sudo lshw -C network
[sudo] password for gofox:
*-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:03:00.0
logical name: eth0
version: 06
serial: 94:de:80:2a:f5:58
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.100 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:73 ioport:d000(size=256) memory:d0004000-d0004fff memory:d0000000-d0003fff
gofox@gofox-To-be-filled-by-O-E-M:~$ ifconfig
eth0 Link encap:以太网 硬件地址 94:de:80:2a:f5:58
inet 地址:192.168.1.100 广播:192.168.1.255 掩码:255.255.255.0
inet6 地址: fe80::96de:80ff:fe2a:f558/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:31 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:35 错误:0 丢弃:611 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:4309 (4.3 KB) 发送字节:5059 (5.0 KB)

lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:1054 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:1054 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:84166 (84.1 KB) 发送字节:84166 (84.1 KB)

gofox@gofox-To-be-filled-by-O-E-M:~$ ping 192.168.1.1 -c 4
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.100 icmp_seq=1 Destination Host Unreachable
From 192.168.1.100 icmp_seq=2 Destination Host Unreachable
From 192.168.1.100 icmp_seq=3 Destination Host Unreachable
From 192.168.1.100 icmp_seq=4 Destination Host Unreachable

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3000ms
pipe 3
gofox@gofox-To-be-filled-by-O-E-M:~$ tail /var/log/syslog -n 20
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.926344] ---[ end trace f68773f9b988bca3 ]---
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.932415] r8169 0000:03:00.0 eth0: link up
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: no servers can be used, exiting
Sep 3 11:15:41 gofox-To-be-filled-by-O-E-M whoopsie[1006]: offline
Sep 3 11:16:09 gofox-To-be-filled-by-O-E-M kernel: [ 85.984761] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:01 gofox-To-be-filled-by-O-E-M CRON[2447]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Sep 3 11:17:27 gofox-To-be-filled-by-O-E-M kernel: [ 164.012906] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:51 gofox-To-be-filled-by-O-E-M kernel: [ 188.029088] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:15 gofox-To-be-filled-by-O-E-M kernel: [ 212.045170] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:51 gofox-To-be-filled-by-O-E-M kernel: [ 248.069269] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:15 gofox-To-be-filled-by-O-E-M kernel: [ 272.085347] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:51 gofox-To-be-filled-by-O-E-M kernel: [ 308.109475] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[909]: Job `cron.daily' started
Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[2602]: Updated timestamp for job `cron.daily' to 2014-09-03
Sep 3 11:20:15 gofox-To-be-filled-by-O-E-M kernel: [ 332.125563] r8169 0000:03:00.0 eth0: link up
Sep 3 11:20:51 gofox-To-be-filled-by-O-E-M kernel: [ 368.149702] r8169 0000:03:00.0 eth0: link up
Sep 3 11:22:03 gofox-To-be-filled-by-O-E-M kernel: [ 440.201919] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:03 gofox-To-be-filled-by-O-E-M kernel: [ 500.238182] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:39 gofox-To-be-filled-by-O-E-M kernel: [ 536.262303] r8169 0000:03:00.0 eth0: link up
gofox@gofox-To-be-filled-by-O-E-M:~$
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#7

帖子 sRs_Razer » 2014-09-03 12:01

poloshiao 写了:
查看有线连接信息什么都很正常啊,就是打不开网页。
1. sudo ls -al /etc/resolv.conf
2. sudo cat /etc/resolv.conf
把結果直接複製 貼上來
谢谢

gofox@gofox-To-be-filled-by-O-E-M:~$ sudo ls -al /etc/resolv.conf
[sudo] password for gofox:
lrwxrwxrwx 1 root root 29 8月 28 20:05 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
gofox@gofox-To-be-filled-by-O-E-M:~$ sudo cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#8

帖子 poloshiao » 2014-09-03 14:21

sudo ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 8月 28 20:05 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
sudo cat /etc/resolv.conf
nameserver 127.0.1.1
1. gksudo gedit /run/resolvconf/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

nameserver 127.0.1.1
2. 如果是第一次使用 gksudo
需要先安裝 gksu 套件
3. ping -c 3 forum.ubuntu.org.cn
看看 有沒有回應
如果有 請再貼文
taohunter
帖子: 1555
注册时间: 2012-03-31 3:29

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#9

帖子 taohunter » 2014-09-03 14:45

sRs_Razer 写了: 。。。
gofox@gofox-To-be-filled-by-O-E-M:~$ lspci
。。。
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
02:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
gofox@gofox-To-be-filled-by-O-E-M:~$ sudo lshw -C network
[sudo] password for gofox:
*-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:03:00.0
logical name: eth0
version: 06
serial: 94:de:80:2a:f5:58
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.100 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:73 ioport:d000(size=256) memory:d0004000-d0004fff memory:d0000000-d0003fff
gofox@gofox-To-be-filled-by-O-E-M:~$ ifconfig
eth0 Link encap:以太网 硬件地址 94:de:80:2a:f5:58
inet 地址:192.168.1.100 广播:192.168.1.255 掩码:255.255.255.0
inet6 地址: fe80::96de:80ff:fe2a:f558/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:31 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:35 错误:0 丢弃:611 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:4309 (4.3 KB) 发送字节:5059 (5.0 KB)
。。。
gofox@gofox-To-be-filled-by-O-E-M:~$ tail /var/log/syslog -n 20
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.926344] ---[ end trace f68773f9b988bca3 ]---
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.932415] r8169 0000:03:00.0 eth0: link up
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: no servers can be used, exiting
Sep 3 11:15:41 gofox-To-be-filled-by-O-E-M whoopsie[1006]: offline
Sep 3 11:16:09 gofox-To-be-filled-by-O-E-M kernel: [ 85.984761] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:01 gofox-To-be-filled-by-O-E-M CRON[2447]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Sep 3 11:17:27 gofox-To-be-filled-by-O-E-M kernel: [ 164.012906] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:51 gofox-To-be-filled-by-O-E-M kernel: [ 188.029088] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:15 gofox-To-be-filled-by-O-E-M kernel: [ 212.045170] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:51 gofox-To-be-filled-by-O-E-M kernel: [ 248.069269] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:15 gofox-To-be-filled-by-O-E-M kernel: [ 272.085347] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:51 gofox-To-be-filled-by-O-E-M kernel: [ 308.109475] r8169 0000:03:00.0 eth0: link up

Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[909]: Job `cron.daily' started
Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[2602]: Updated timestamp for job `cron.daily' to 2014-09-03
Sep 3 11:20:15 gofox-To-be-filled-by-O-E-M kernel: [ 332.125563] r8169 0000:03:00.0 eth0: link up
Sep 3 11:20:51 gofox-To-be-filled-by-O-E-M kernel: [ 368.149702] r8169 0000:03:00.0 eth0: link up
Sep 3 11:22:03 gofox-To-be-filled-by-O-E-M kernel: [ 440.201919] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:03 gofox-To-be-filled-by-O-E-M kernel: [ 500.238182] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:39 gofox-To-be-filled-by-O-E-M kernel: [ 536.262303] r8169 0000:03:00.0 eth0: link up
gofox@gofox-To-be-filled-by-O-E-M:~$
不出所料,应该是你的网卡使用了错误的驱动,见红色字体的内容:

你的网卡是“RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller”,不应使用r8169这个内核驱动模块来驱动,否则就出现象你现在这样拿到了dhcp的ip地址,但网卡却一直处于不断“r8169 0000:03:00.0 eth0: link up”的状态。这样是无法使用有线网络的。

正确的驱动要到realtek的网站下载,自己安装。
http://www.realtek.com.tw/downloads/dow ... wn=false#2

选择上面这个链接中unix条目下那个“LINUX driver for kernel 3.x and 2.6.x and 2.4.x”、版本为“8.038”的文件下载。下载好文件,解压到你的家目录中,然后在家目录中执行以下命令:

代码: 全选

cd r8168-8.038.00
sudo ./autorun.sh
驱动安装完成,重启系统。你的有线网络就应该正常了。

如想确认新的驱动的情况,执行

代码: 全选

sudo lshw -C network |grep r8168
在输出中如果看到“driver=r8168 driverversion=8.038.00-NAPI”,那么就说明系统已经使用了正确的驱动了。
三年后终于回到16.04--稳定了!
sRs_Razer
帖子: 11
注册时间: 2014-08-30 15:26
系统: Ubuntu&win7

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#10

帖子 sRs_Razer » 2014-09-03 21:45

taohunter 写了:
sRs_Razer 写了: 。。。
gofox@gofox-To-be-filled-by-O-E-M:~$ lspci
。。。
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
02:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
gofox@gofox-To-be-filled-by-O-E-M:~$ sudo lshw -C network
[sudo] password for gofox:
*-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:03:00.0
logical name: eth0
version: 06
serial: 94:de:80:2a:f5:58
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.100 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:73 ioport:d000(size=256) memory:d0004000-d0004fff memory:d0000000-d0003fff
gofox@gofox-To-be-filled-by-O-E-M:~$ ifconfig
eth0 Link encap:以太网 硬件地址 94:de:80:2a:f5:58
inet 地址:192.168.1.100 广播:192.168.1.255 掩码:255.255.255.0
inet6 地址: fe80::96de:80ff:fe2a:f558/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:31 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:35 错误:0 丢弃:611 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:4309 (4.3 KB) 发送字节:5059 (5.0 KB)
。。。
gofox@gofox-To-be-filled-by-O-E-M:~$ tail /var/log/syslog -n 20
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.926344] ---[ end trace f68773f9b988bca3 ]---
Sep 3 11:15:27 gofox-To-be-filled-by-O-E-M kernel: [ 43.932415] r8169 0000:03:00.0 eth0: link up
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Sep 3 11:15:30 gofox-To-be-filled-by-O-E-M ntpdate[2071]: no servers can be used, exiting
Sep 3 11:15:41 gofox-To-be-filled-by-O-E-M whoopsie[1006]: offline
Sep 3 11:16:09 gofox-To-be-filled-by-O-E-M kernel: [ 85.984761] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:01 gofox-To-be-filled-by-O-E-M CRON[2447]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Sep 3 11:17:27 gofox-To-be-filled-by-O-E-M kernel: [ 164.012906] r8169 0000:03:00.0 eth0: link up
Sep 3 11:17:51 gofox-To-be-filled-by-O-E-M kernel: [ 188.029088] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:15 gofox-To-be-filled-by-O-E-M kernel: [ 212.045170] r8169 0000:03:00.0 eth0: link up
Sep 3 11:18:51 gofox-To-be-filled-by-O-E-M kernel: [ 248.069269] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:15 gofox-To-be-filled-by-O-E-M kernel: [ 272.085347] r8169 0000:03:00.0 eth0: link up
Sep 3 11:19:51 gofox-To-be-filled-by-O-E-M kernel: [ 308.109475] r8169 0000:03:00.0 eth0: link up

Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[909]: Job `cron.daily' started
Sep 3 11:19:56 gofox-To-be-filled-by-O-E-M anacron[2602]: Updated timestamp for job `cron.daily' to 2014-09-03
Sep 3 11:20:15 gofox-To-be-filled-by-O-E-M kernel: [ 332.125563] r8169 0000:03:00.0 eth0: link up
Sep 3 11:20:51 gofox-To-be-filled-by-O-E-M kernel: [ 368.149702] r8169 0000:03:00.0 eth0: link up
Sep 3 11:22:03 gofox-To-be-filled-by-O-E-M kernel: [ 440.201919] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:03 gofox-To-be-filled-by-O-E-M kernel: [ 500.238182] r8169 0000:03:00.0 eth0: link up
Sep 3 11:23:39 gofox-To-be-filled-by-O-E-M kernel: [ 536.262303] r8169 0000:03:00.0 eth0: link up
gofox@gofox-To-be-filled-by-O-E-M:~$
不出所料,应该是你的网卡使用了错误的驱动,见红色字体的内容:

你的网卡是“RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller”,不应使用r8169这个内核驱动模块来驱动,否则就出现象你现在这样拿到了dhcp的ip地址,但网卡却一直处于不断“r8169 0000:03:00.0 eth0: link up”的状态。这样是无法使用有线网络的。

正确的驱动要到realtek的网站下载,自己安装。
http://www.realtek.com.tw/downloads/dow ... wn=false#2

选择上面这个链接中unix条目下那个“LINUX driver for kernel 3.x and 2.6.x and 2.4.x”、版本为“8.038”的文件下载。下载好文件,解压到你的家目录中,然后在家目录中执行以下命令:

代码: 全选

cd r8168-8.038.00
sudo ./autorun.sh
驱动安装完成,重启系统。你的有线网络就应该正常了。

如想确认新的驱动的情况,执行

代码: 全选

sudo lshw -C network |grep r8168
在输出中如果看到“driver=r8168 driverversion=8.038.00-NAPI”,那么就说明系统已经使用了正确的驱动了。
太感谢您了!!
按照您说的终于解决了上网问题!
这次学到了很多。非常感激!
也感谢另一位的帮助,谢谢!
wbq813
帖子: 1
注册时间: 2018-10-06 21:10
系统: ubuntu18.04

Re: Ubuntu14.04不能上网,请各位大神帮忙。

#11

帖子 wbq813 » 2018-10-06 21:11

我是Ubuntu18.04遇到了一样的问题,但是按照这个步骤重新安装了驱动还是断断续续
回复