无法在 Cloudera VM 中获取互联网连接

无法在 Cloudera VM 中获取互联网连接

我无法从 Cloudera VM 连接到互联网。我在 Oracle VM 的网络设置下有 2 个网络适配器,分别是 NAT 和 Bridged

在两条电缆连接选项中都进行了检查请让我知道我必须做的配置更改

我可以 ping 8.8.8.8

[cloudera@quickstart ~]$ ping 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=57 time=9.48 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=14.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=9.68 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=8.28 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=8.88 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=57 time=8.41 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=57 time=14.2 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=57 time=8.35 ms
^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7440ms
rtt min/avg/max/mdev = 8.282/10.216/14.378/2.416 ms

路由表信息

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
0.0.0.0         10.0.2.2        0.0.0.0         UG        0 0          0 eth0

答案1

您目前可以通过该虚拟机访问互联网,eth0因为您可以从虚拟机 ping 8.8.8.8。这似乎可能是 DNS 问题。首先,让我们看看 DNS 是否正确允许出站:

nslookup自行运行并执行以下操作:

>server 8.8.8.8
默认服务器:8.8.8.8
地址:8.8.8.8#53
> www.google.com
服务器:8.8.8.8
地址:8.8.8.8#53

非权威答案:
名称:www.google.com
地址:172.217.2.132

如果您收到响应(如示例中所示),则需要进行修改/etc/resolv.conf以使用正确的 DNS 服务器。请记住,Linux 发行版可能会覆盖此文件,因此请检查文档以确保这是您需要放置它的位置,因为不同的 Linux 发行版有不同的选项:

/etc/resolv.conf
名称服务器 8.8.8.8。

完成后,尝试ping www.google.com看看是否得到回应。

相关内容