14.04 中出现间歇性有线网络问题

14.04 中出现间歇性有线网络问题

从昨天开始,我的有线网络连接每 30 秒左右就会断线几秒钟。据我所知,我没有对我的网络进行任何更改。

输出ifconfig -a

➜  ~  ifconfig -a
eth0      Link encap:Ethernet  HWaddr 6c:f0:49:b9:b1:7f  
          inet addr:192.168.0.16  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::6ef0:49ff:feb9:b17f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9783 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10101682 (10.1 MB)  TX bytes:1215142 (1.2 MB)
          Interrupt:48 Base address:0x8000 

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:96691 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96691 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13594355 (13.5 MB)  TX bytes:13594355 (13.5 MB)

lspci |grep Ethernet

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

ping 我的路由器:

➜  ~  ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.435 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.571 ms
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=1.03 ms

输出如下route

➜  ~  route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     1      0        0 eth0

来自 /var/logs/syslog 的一些消息:

➜  ~  tail -f /var/log/syslog 
Jun  6 10:37:34 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:37:34 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:37:37 lolbox dnsmasq[1138]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:37:37 lolbox dnsmasq[1362]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:37:39 lolbox dhclient: XMT: Solicit on eth0, interval 8660ms.
Jun  6 10:37:39 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:37:39 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:37:47 lolbox dhclient: XMT: Solicit on eth0, interval 16820ms.
Jun  6 10:37:47 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:37:47 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:04 lolbox dhclient: XMT: Solicit on eth0, interval 34410ms.
Jun  6 10:38:04 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:38:04 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:16 lolbox NetworkManager[862]: <warn> (eth0): DHCPv6 request timed out.
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> (eth0): canceled DHCP transaction, DHCP client pid 13045
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> (eth0): device state change: activated -> failed (reason 'ip-config-unavailable') [100 120 5]
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> NetworkManager state is now DISCONNECTED
Jun  6 10:38:16 lolbox NetworkManager[862]: <warn> Activation (eth0) failed for connection 'Wired connection 1'
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) complete.
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> (eth0): device state change: failed -> disconnected (reason 'none') [120 30 0]
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> (eth0): deactivating device (reason 'none') [0]
Jun  6 10:37:34 lolbox whoopsie[1133]: online
Jun  6 10:38:16 lolbox whoopsie[1133]: offline
Jun  6 10:38:16 lolbox dbus[485]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Jun  6 10:38:16 lolbox dbus[485]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> (eth0): canceled DHCP transaction, DHCP client pid 13044
Jun  6 10:38:16 lolbox NetworkManager[862]: <warn> DNS: plugin dnsmasq update failed
Jun  6 10:38:16 lolbox NetworkManager[862]: <info> Removing DNS information from /sbin/resolvconf
Jun  6 10:38:16 lolbox avahi-daemon[619]: Withdrawing address record for fe80::6ef0:49ff:feb9:b17f on eth0.
Jun  6 10:38:16 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:38:16 lolbox avahi-daemon[619]: Interface eth0.IPv6 no longer relevant for mDNS.
Jun  6 10:38:16 lolbox avahi-daemon[619]: Withdrawing address record for 192.168.0.16 on eth0.
Jun  6 10:38:16 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.16.
Jun  6 10:38:16 lolbox avahi-daemon[619]: Interface eth0.IPv4 no longer relevant for mDNS.
Jun  6 10:38:16 lolbox dnsmasq[1362]: setting upstream servers from DBus
Jun  6 10:38:17 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:38:17 lolbox avahi-daemon[619]: New relevant interface eth0.IPv6 for mDNS.
Jun  6 10:38:17 lolbox avahi-daemon[619]: Registering new address record for fe80::6ef0:49ff:feb9:b17f on eth0.*.
Jun  6 10:38:18 lolbox dnsmasq[1138]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Auto-activating connection 'Wired connection 1'.
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) starting connection 'Wired connection 1'
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> (eth0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> NetworkManager state is now CONNECTING
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> (eth0): device state change: prepare -> config (reason 'none') [40 50 0]
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> (eth0): device state change: config -> ip-config (reason 'none') [50 70 0]
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> dhclient started with pid 13160
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Beginning DHCPv6 transaction (timeout in 45 seconds)
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> dhclient started with pid 13161
Jun  6 10:38:18 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jun  6 10:38:18 lolbox avahi-daemon[619]: Withdrawing address record for fe80::6ef0:49ff:feb9:b17f on eth0.
Jun  6 10:38:18 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:38:18 lolbox avahi-daemon[619]: Interface eth0.IPv6 no longer relevant for mDNS.
Jun  6 10:38:18 lolbox dhclient: Internet Systems Consortium DHCP Client 4.2.4
Jun  6 10:38:18 lolbox dhclient: Copyright 2004-2012 Internet Systems Consortium.
Jun  6 10:38:18 lolbox dhclient: All rights reserved.
Jun  6 10:38:18 lolbox dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jun  6 10:38:18 lolbox dhclient: 
Jun  6 10:38:19 lolbox dhclient: Internet Systems Consortium DHCP Client 4.2.4
Jun  6 10:38:19 lolbox dhclient: Copyright 2004-2012 Internet Systems Consortium.
Jun  6 10:38:19 lolbox dhclient: All rights reserved.
Jun  6 10:38:19 lolbox dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jun  6 10:38:19 lolbox dhclient: 
Jun  6 10:38:19 lolbox NetworkManager[862]: <info> (eth0): DHCPv4 state changed nbi -> preinit
Jun  6 10:38:19 lolbox dhclient: Bound to *:546
Jun  6 10:38:19 lolbox dhclient: Listening on Socket/eth0
Jun  6 10:38:19 lolbox dhclient: Sending on   Socket/eth0
Jun  6 10:38:19 lolbox NetworkManager[862]: <info> (eth0): DHCPv6 state changed nbi -> preinit6
Jun  6 10:38:19 lolbox dhclient: Listening on LPF/eth0/6c:f0:49:b9:b1:7f
Jun  6 10:38:19 lolbox dhclient: Sending on   LPF/eth0/6c:f0:49:b9:b1:7f
Jun  6 10:38:19 lolbox dhclient: Sending on   Socket/fallback
Jun  6 10:38:19 lolbox dhclient: DHCPREQUEST of 192.168.0.16 on eth0 to 255.255.255.255 port 67 (xid=0x3fc9376d)
Jun  6 10:38:19 lolbox dhclient: XMT: Solicit on eth0, interval 1020ms.
Jun  6 10:38:19 lolbox dhclient: send_packet6: Cannot assign requested address
Jun  6 10:38:19 lolbox dhclient: dhc6: send_packet6() sent -1 of 77 bytes
Jun  6 10:38:20 lolbox dhclient: DHCPACK of 192.168.0.16 from 192.168.0.1
Jun  6 10:38:20 lolbox dhclient: bound to 192.168.0.16 -- renewal in 41481 seconds.
Jun  6 10:38:20 lolbox NetworkManager[862]: <info> (eth0): DHCPv4 state changed preinit -> reboot
Jun  6 10:38:20 lolbox NetworkManager[862]: <info>   address 192.168.0.16
Jun  6 10:38:20 lolbox NetworkManager[862]: <info>   prefix 24 (255.255.255.0)
Jun  6 10:38:20 lolbox NetworkManager[862]: <info>   gateway 192.168.0.1
Jun  6 10:38:20 lolbox NetworkManager[862]: <info>   nameserver '83.255.245.11'
Jun  6 10:38:20 lolbox NetworkManager[862]: <info>   nameserver '193.150.193.150'
Jun  6 10:38:20 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Configure Commit) scheduled...
Jun  6 10:38:20 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) started...
Jun  6 10:38:20 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.16.
Jun  6 10:38:20 lolbox avahi-daemon[619]: New relevant interface eth0.IPv4 for mDNS.
Jun  6 10:38:20 lolbox avahi-daemon[619]: Registering new address record for 192.168.0.16 on eth0.IPv4.
Jun  6 10:38:20 lolbox dhclient: XMT: Solicit on eth0, interval 2110ms.
Jun  6 10:38:20 lolbox dhclient: send_packet6: Cannot assign requested address
Jun  6 10:38:20 lolbox dhclient: dhc6: send_packet6() sent -1 of 77 bytes
Jun  6 10:38:20 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:38:20 lolbox avahi-daemon[619]: New relevant interface eth0.IPv6 for mDNS.
Jun  6 10:38:20 lolbox avahi-daemon[619]: Registering new address record for fe80::6ef0:49ff:feb9:b17f on eth0.*.
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> (eth0): device state change: ip-config -> secondaries (reason 'none') [70 90 0]
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) complete.
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> (eth0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> NetworkManager state is now CONNECTED_GLOBAL
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> Writing DNS information to /sbin/resolvconf
Jun  6 10:38:21 lolbox dnsmasq[1362]: setting upstream servers from DBus
Jun  6 10:38:21 lolbox dnsmasq[1362]: using nameserver 127.0.0.1#53
Jun  6 10:38:21 lolbox dnsmasq[1362]: using nameserver 193.150.193.150#53
Jun  6 10:38:21 lolbox dnsmasq[1362]: using nameserver 83.255.245.11#53
Jun  6 10:38:21 lolbox NetworkManager[862]: <info> Activation (eth0) successful, device activated.
Jun  6 10:38:21 lolbox whoopsie[1133]: message repeated 2 times: [ offline]
Jun  6 10:38:21 lolbox whoopsie[1133]: online
Jun  6 10:38:21 lolbox ntpdate[13217]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Jun  6 10:38:21 lolbox ntpdate[13217]: no servers can be used, exiting
Jun  6 10:38:22 lolbox dnsmasq[1138]: reading /var/run/dnsmasq/resolv.conf
Jun  6 10:38:22 lolbox dnsmasq[1138]: using nameserver 127.0.1.1#53
Jun  6 10:38:22 lolbox dhclient: XMT: Solicit on eth0, interval 4080ms.
Jun  6 10:38:22 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:38:22 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:26 lolbox dhclient: XMT: Solicit on eth0, interval 8450ms.
Jun  6 10:38:26 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:38:26 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:35 lolbox dhclient: XMT: Solicit on eth0, interval 16630ms.
Jun  6 10:38:35 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:38:35 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:51 lolbox dhclient: XMT: Solicit on eth0, interval 34860ms.
Jun  6 10:38:51 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:38:51 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:38:58 lolbox dnsmasq[1138]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:38:58 lolbox dnsmasq[1362]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:39:04 lolbox NetworkManager[862]: <warn> (eth0): DHCPv6 request timed out.
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> (eth0): canceled DHCP transaction, DHCP client pid 13161
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> (eth0): device state change: activated -> failed (reason 'ip-config-unavailable') [100 120 5]
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> NetworkManager state is now DISCONNECTED
Jun  6 10:39:04 lolbox NetworkManager[862]: <warn> Activation (eth0) failed for connection 'Wired connection 1'
Jun  6 10:38:22 lolbox whoopsie[1133]: online
Jun  6 10:39:04 lolbox whoopsie[1133]: offline
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) complete.
Jun  6 10:39:04 lolbox dbus[485]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> (eth0): device state change: failed -> disconnected (reason 'none') [120 30 0]
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> (eth0): deactivating device (reason 'none') [0]
Jun  6 10:39:04 lolbox dbus[485]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> (eth0): canceled DHCP transaction, DHCP client pid 13160
Jun  6 10:39:04 lolbox avahi-daemon[619]: Withdrawing address record for fe80::6ef0:49ff:feb9:b17f on eth0.
Jun  6 10:39:04 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:39:04 lolbox avahi-daemon[619]: Interface eth0.IPv6 no longer relevant for mDNS.
Jun  6 10:39:04 lolbox avahi-daemon[619]: Withdrawing address record for 192.168.0.16 on eth0.
Jun  6 10:39:04 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.16.
Jun  6 10:39:04 lolbox avahi-daemon[619]: Interface eth0.IPv4 no longer relevant for mDNS.
Jun  6 10:39:04 lolbox NetworkManager[862]: <warn> DNS: plugin dnsmasq update failed
Jun  6 10:39:04 lolbox NetworkManager[862]: <info> Removing DNS information from /sbin/resolvconf
Jun  6 10:39:04 lolbox dnsmasq[1362]: setting upstream servers from DBus
Jun  6 10:39:05 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:39:05 lolbox avahi-daemon[619]: New relevant interface eth0.IPv6 for mDNS.
Jun  6 10:39:05 lolbox avahi-daemon[619]: Registering new address record for fe80::6ef0:49ff:feb9:b17f on eth0.*.
Jun  6 10:39:06 lolbox dnsmasq[1138]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Auto-activating connection 'Wired connection 1'.
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) starting connection 'Wired connection 1'
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> (eth0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> NetworkManager state is now CONNECTING
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> (eth0): device state change: prepare -> config (reason 'none') [40 50 0]
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> (eth0): device state change: config -> ip-config (reason 'none') [50 70 0]
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> dhclient started with pid 13270
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Beginning DHCPv6 transaction (timeout in 45 seconds)
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> dhclient started with pid 13271
Jun  6 10:39:07 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jun  6 10:39:07 lolbox avahi-daemon[619]: Withdrawing address record for fe80::6ef0:49ff:feb9:b17f on eth0.
Jun  6 10:39:07 lolbox avahi-daemon[619]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:39:07 lolbox avahi-daemon[619]: Interface eth0.IPv6 no longer relevant for mDNS.
Jun  6 10:39:07 lolbox dhclient: Internet Systems Consortium DHCP Client 4.2.4
Jun  6 10:39:07 lolbox dhclient: Copyright 2004-2012 Internet Systems Consortium.
Jun  6 10:39:07 lolbox dhclient: All rights reserved.
Jun  6 10:39:07 lolbox dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jun  6 10:39:07 lolbox dhclient: 
Jun  6 10:39:08 lolbox dhclient: Internet Systems Consortium DHCP Client 4.2.4
Jun  6 10:39:08 lolbox dhclient: Copyright 2004-2012 Internet Systems Consortium.
Jun  6 10:39:08 lolbox dhclient: All rights reserved.
Jun  6 10:39:08 lolbox dhclient: For info, please visit https://www.isc.org/software/dhcp/
Jun  6 10:39:08 lolbox dhclient: 
Jun  6 10:39:08 lolbox dhclient: Bound to *:546
Jun  6 10:39:08 lolbox dhclient: Listening on Socket/eth0
Jun  6 10:39:08 lolbox dhclient: Sending on   Socket/eth0
Jun  6 10:39:08 lolbox kernel: [ 1446.098590] type=1400 audit(1402043948.002:75): apparmor="DENIED" operation="signal" profile="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=13273 comm="nm-dhcp-client." requested_mask="send" denied_mask="send" signal=term peer="/sbin/dhclient"
Jun  6 10:39:08 lolbox kernel: [ 1446.098599] type=1400 audit(1402043948.002:76): apparmor="DENIED" operation="signal" profile="/sbin/dhclient" pid=13273 comm="nm-dhcp-client." requested_mask="receive" denied_mask="receive" signal=term peer="/usr/lib/NetworkManager/nm-dhcp-client.action"
Jun  6 10:39:08 lolbox NetworkManager[862]: <info> (eth0): DHCPv4 state changed nbi -> preinit
Jun  6 10:39:08 lolbox dhclient: Listening on LPF/eth0/6c:f0:49:b9:b1:7f
Jun  6 10:39:08 lolbox dhclient: Sending on   LPF/eth0/6c:f0:49:b9:b1:7f
Jun  6 10:39:08 lolbox dhclient: Sending on   Socket/fallback
Jun  6 10:39:08 lolbox dhclient: DHCPREQUEST of 192.168.0.16 on eth0 to 255.255.255.255 port 67 (xid=0x3e0183b9)
Jun  6 10:39:08 lolbox dhclient: XMT: Solicit on eth0, interval 1050ms.
Jun  6 10:39:08 lolbox dhclient: send_packet6: Cannot assign requested address
Jun  6 10:39:08 lolbox dhclient: dhc6: send_packet6() sent -1 of 77 bytes
Jun  6 10:39:09 lolbox dhclient: DHCPACK of 192.168.0.16 from 192.168.0.1
Jun  6 10:39:09 lolbox dhclient: bound to 192.168.0.16 -- renewal in 35498 seconds.
Jun  6 10:39:09 lolbox NetworkManager[862]: <info> (eth0): DHCPv4 state changed preinit -> reboot
Jun  6 10:39:09 lolbox NetworkManager[862]: <info>   address 192.168.0.16
Jun  6 10:39:09 lolbox NetworkManager[862]: <info>   prefix 24 (255.255.255.0)
Jun  6 10:39:09 lolbox NetworkManager[862]: <info>   gateway 192.168.0.1
Jun  6 10:39:09 lolbox NetworkManager[862]: <info>   nameserver '83.255.245.11'
Jun  6 10:39:09 lolbox NetworkManager[862]: <info>   nameserver '193.150.193.150'
Jun  6 10:39:09 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Configure Commit) scheduled...
Jun  6 10:39:09 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) started...
Jun  6 10:39:09 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.16.
Jun  6 10:39:09 lolbox avahi-daemon[619]: New relevant interface eth0.IPv4 for mDNS.
Jun  6 10:39:09 lolbox avahi-daemon[619]: Registering new address record for 192.168.0.16 on eth0.IPv4.
Jun  6 10:39:09 lolbox avahi-daemon[619]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::6ef0:49ff:feb9:b17f.
Jun  6 10:39:09 lolbox avahi-daemon[619]: New relevant interface eth0.IPv6 for mDNS.
Jun  6 10:39:09 lolbox avahi-daemon[619]: Registering new address record for fe80::6ef0:49ff:feb9:b17f on eth0.*.
Jun  6 10:39:10 lolbox dhclient: XMT: Solicit on eth0, interval 2180ms.
Jun  6 10:39:10 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:39:10 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> (eth0): device state change: ip-config -> secondaries (reason 'none') [70 90 0]
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) complete.
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> (eth0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> NetworkManager state is now CONNECTED_GLOBAL
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> Writing DNS information to /sbin/resolvconf
Jun  6 10:39:10 lolbox dnsmasq[1362]: setting upstream servers from DBus
Jun  6 10:39:10 lolbox dnsmasq[1362]: using nameserver 127.0.0.1#53
Jun  6 10:39:10 lolbox dnsmasq[1362]: using nameserver 193.150.193.150#53
Jun  6 10:39:10 lolbox dnsmasq[1362]: using nameserver 83.255.245.11#53
Jun  6 10:39:10 lolbox NetworkManager[862]: <info> Activation (eth0) successful, device activated.
Jun  6 10:39:10 lolbox whoopsie[1133]: message repeated 2 times: [ offline]
Jun  6 10:39:10 lolbox whoopsie[1133]: online
Jun  6 10:39:10 lolbox ntpdate[13339]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Jun  6 10:39:10 lolbox ntpdate[13339]: no servers can be used, exiting
Jun  6 10:39:11 lolbox dnsmasq[1138]: reading /var/run/dnsmasq/resolv.conf
Jun  6 10:39:11 lolbox dnsmasq[1138]: using nameserver 127.0.1.1#53
Jun  6 10:39:12 lolbox dhclient: XMT: Solicit on eth0, interval 4350ms.
Jun  6 10:39:12 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:39:12 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:39:16 lolbox dhclient: XMT: Solicit on eth0, interval 8740ms.
Jun  6 10:39:16 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:39:16 lolbox dhclient: IA_NA status code NoAddrsAvail.
Jun  6 10:39:17 lolbox dnsmasq[1138]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:39:17 lolbox dnsmasq[1362]: Maximum number of concurrent DNS queries reached (max: 150)
Jun  6 10:39:25 lolbox dhclient: XMT: Solicit on eth0, interval 17610ms.
Jun  6 10:39:25 lolbox dhclient: RCV: Advertise message on eth0 from fe80::120d:7fff:fe97:9d54.
Jun  6 10:39:25 lolbox dhclient: IA_NA status code NoAddrsAvail.

/etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

#no-auto-default=6C:F0:49:B9:B1:7F,

[ifupdown]
managed=false

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

lshw -C network

  ➜  ~  sudo lshw -C 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:04:00.0
         logical name: eth0
         version: 03
         serial: 6c:f0:49:b9:b1:7f
         size: 1Gbit/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.038.00-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
         resources: irq:48 ioport:de00(size=256) memory:fbeff000-fbefffff memory:fbef8000-fbefbfff memory:fbe00000-fbe1ffff

答案1

我不完全确定为什么这个方法有效,但似乎有效。这不是一个理想的解决方案,但至少有效。

我所做的是删除了路由器中设置的地址保留,并将其设置IPv4 Settings → Method为“自动(DHCP)”而不是“手动”(我之前曾尝试手动设置,虽然“有效”,但并未解决我的问题)。我还IPv6 Settings → Method凭直觉将其设置为“忽略”。

之后,我重启了resolveconfnetwork-manager服务,但似乎没有帮助。所以我尝试重启服务networking,但失败了。在谷歌上搜索了一下后,似乎不支持这种方式重启网络接口,所以我改为手动重启它们:

sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a

这似乎奏效了。我不确定静态 IP 分配是否与此有关,或者是否禁用了 IPv6,但无论如何,它现在起作用了。

答案2

我在从 12.x 升级到 kubuntu 14.04 后也遇到了同样的间歇性网络连接问题。我偶然搜索了“关闭 ipv6”页面,结果发现 askubuntu:禁用 ipv6。我按照 sysctl 的步骤操作,现在问题似乎解决了。便宜。

相关内容