我已将Ubuntu 12.04 Server安装在主机Windows 8.1上的VMWare Workstation 10.0中
/etc/network/interfaces配置如下。
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.171.132
netmask 255.255.255.0
gateway 192.168.171.1网络适配器设置为Custom: VMnet 8 (NAT)
从我的主机Windows中,我可以看到VMNet 8有IPv4 : 192.168.171.1,这应该是/etc/network/interfaces的网关,也就是。
如果我将它设置为DHCP,我可以从VM连接到互联网,并得到一个IP of 192.168.171.131
但问题是,我不能连接到互联网,当我设置它的静态。
请告诉我哪里弄错了?
发布于 2014-04-09 12:48:47
如果在/etc/network/接口中设置静态IP地址,则还负责设置DNS名称服务器。我建议你试试:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.171.132
netmask 255.255.255.0
gateway 192.168.171.1
dns-nameservers 8.8.8.8 192.168.171.1然后让系统重新读取文件并使用更改:
sudo ifdown eth0 && sudo ifup eth0检查:
ping -c3 www.google.com发布于 2014-12-19 06:52:20
不要使用192.168.171.1,而是使用192.168.171.2。在VM 10中,如果单击“编辑、虚拟网络编辑器”,选择“VM8”,在“VMnet信息”下选择“NAT”,单击“NAT设置”,然后在那里找到您的GW地址设置。当您找到它时,将您的"eth0“网关IP调整到该IP地址。
https://askubuntu.com/questions/445326
复制相似问题