我有一个双启动系统,其中 Windows 10 和 Ubuntu 16.04。Windows 10 可以访问互联网,但 Ubuntu 16.04 不能。我已检查 Windows 10 中未在以太网上启用 WOL。您可以看到 Ubuntu 16.04 中的以太网状态 (eno1) 已启动。
以下是一些结果
$ ping 8.8.8.8
connect: Network is unreachable
从上面可以看出这不是域服务器的问题(事实上,在此之前我曾尝试更改/etc/resolv.conf
为包含行nameserver 8.8.8.8
,但没有成功,后来我发现这不是域服务器的问题)
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 18:31:bf:ce:35:39 brd ff:ff:ff:ff:ff:ff 3: enp14s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 18:31:bf:ce:35:3a brd ff:ff:ff:ff:ff:ff 5: br-e5e68b901b8d: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:bc:39:1c:1b brd ff:ff:ff:ff:ff:ff 6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:90:09:22:e9 brd ff:ff:ff:ff:ff:ff
$ ifconfig -a
br-e5e68b901b8d Link encap:Ethernet HWaddr 02:42:bc:39:1c:1c
inet addr:172.18.0.1 Bcast:172.18.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
docker0 Link encap:Ethernet HWaddr 02:42:90:09:22:ec
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eno1 Link encap:Ethernet HWaddr 18:31:bf:ce:35:3c
inet6 addr: fe80::fd89:7b2:8432:3e66/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:302 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:50635 (50.6 KB) TX bytes:10704 (10.7 KB)
Interrupt:20 Memory:fb600000-fb620000
enp14s0 Link encap:Ethernet HWaddr 18:31:bf:ce:35:3c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:fb300000-fb37ffff
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:37180 errors:0 dropped:0 overruns:0 frame:0
TX packets:37180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14199410 (14.1 MB) TX bytes:14199410 (14.1 MB)
欢迎任何评论,并非常感谢!
答案1
我通过这种方法解决:假设接口名为eno1(从命令中找到ifconfig
)
- sudo service network-manager stop - sudo ifconfig eno1 up - sudo dhclient eno1 - sudo service network-manager start