编辑:
我的问题是我无法通过以太网连接互联网。当我运行 时wget http://google.com
,我收到错误...failed: Name or service not known.
Chrome 和 Firefox 无法加载任何网站,原因是连接问题。
当我插入其他计算机时,以太网工作正常。只有这台特定的机器不工作。
根据以下评论编辑 2 条辣椒555
soverton@osr-ubuntu-2:~$ wget --spider http://google.com
Spider mode enabled. Check if remote file exists.
--2018-03-03 08:39:00-- http://google.com/
Resolving google.com (google.com)... failed: Name or service not known.
wget: unable to resolve host address ‘google.com’
soverton@osr-ubuntu-2:~$ ping -c3 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.56 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.69 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.66 ms
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.568/1.642/1.695/0.071 ms
soverton@osr-ubuntu-2:~$ ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=23.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=12.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=11.7 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 11.742/15.840/23.394/5.349 ms
soverton@osr-ubuntu-2:~$ systemd-resolve --status
Global
DNS Servers: 192.168.1.1
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
lines 8-30
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
lines 8-31
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
lines 8-32
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
lines 8-33
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.1
~
lines 8-37/37 (END)
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.1
~
~
lines 8-37/37 (END)
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.1
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 2 (enp0s25)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.1
编辑3
这显然是 DNS 查找问题。
我在另一台机器上找到了google.com的IP地址。
ping -c3 172.217.11.142
ping 时间大约为 40 毫秒。
当我跑步时nslookup google.com
,我得到;; connection timed ou; no servers could be reached
我尝试了解决方案这里和这里使用 DHCP 和静态没有任何好处。
我首先尝试使用 DHCP,然后尝试使用静态
soverton@osr-ubuntu-2:~$ sudo ifdown enp0s25 && sudo ifp -v enp0s25
ifdown: interface enp0s25 not configured
sudo: ifp: command not found
soverton@osr-ubuntu-2:~$ sudo ifdown enp0s25 && sudo ifup -v enp0s25
ifdown: interface enp0s25 not configured
Configuring interface enp0s25=enp0s25 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/sbin/dhclient -1 -v -pf /run/dhclient.enp0s25.pid -lf /var/lib/dhcp/dhclient.enp0s25.leases -I -df /var/lib/dhcp/dhclient6.enp0s25.leases enp0s25
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/enp0s25/5c:f9:dd:70:17:f6
Sending on LPF/enp0s25/5c:f9:dd:70:17:f6
Sending on Socket/fallback
DHCPDISCOVER on enp0s25 to 255.255.255.255 port 67 interval 3 (xid=0xe91bd312)
DHCPREQUEST of 192.168.1.10 on enp0s25 to 255.255.255.255 port 67 (xid=0x12d31be9)
DHCPOFFER of 192.168.1.10 from 192.168.1.1
DHCPACK of 192.168.1.10 from 192.168.1.1
bound to 192.168.1.10 -- renewal in 42067 seconds.
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/avahi-autoipd
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/ethtool
run-parts: executing /etc/network/if-up.d/wpasupplicant
soverton@osr-ubuntu-2:~$ sudo nano /etc/network/interfaces #use static
soverton@osr-ubuntu-2:~$ sudo ifdown enp0s25 && sudo ifup -v enp0s25
RTNETLINK answers: No such process
RTNETLINK answers: Cannot assign requested address
Configuring interface enp0s25=enp0s25 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 10.10.0.20/255.255.255.0 broadcast 10.10.0.255 dev enp0s25 label enp0s25
/bin/ip link set dev enp0s25 up
/bin/ip route add default via 10.10.0.10 dev enp0s25 onlink
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
run-parts: executing /etc/network/if-up.d/avahi-autoipd
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/ethtool
run-parts: executing /etc/network/if-up.d/wpasupplicant
soverton@osr-ubuntu-2:~$ nslookup google.com
;; connection timed out; no servers could be reached
原始帖子
我昨晚从 16.04 升级到了 17.10。甚至在重启之前,以太网就停止工作了。当我进入网络管理器并单击“自动以太网”时,我看到弹出如下图像:
我查阅了许多相关的帖子,但没有一个解决方案对我有用。
sudo nano /etc/NetworkManager/NetworkManager.conf
编辑为
[ifupdown] 管理=true
sudo service network-manager restart #issue not resolved
显示我的托管/非托管连接
nmcli d
DEVICE TYPE STATE CONNECTION
enp0s25 ethernet connectd Wired connection 1
lo loopback unmanaged
sudo nano /etc/network/interfaces
编辑为
auto lo
iface lo inet loopback
重启网络管理器,仍然不起作用
ifconfig
(I'm having to manually type this, I'm skipping over addresses)
enp0s25: flags=4163<UP, BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.8 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::5e1d:5c8:3898:bf5b prefixlen 64 scopeid 0x20<link>
ether .... txqueuelen 1000 (Ethernet)
RX packets 10591 bytes 964576 (964.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2499 bytes 258409 (258.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory ......
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefexlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 17472 bytes 1624396 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17472 bytes 162396 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lsb_release -a
确认我正在运行 17.10