![Ubuntu VMWare 云虚拟机上的目标网络无法访问](https://linux22.com/image/780901/Ubuntu%20VMWare%20%E4%BA%91%E8%99%9A%E6%8B%9F%E6%9C%BA%E4%B8%8A%E7%9A%84%E7%9B%AE%E6%A0%87%E7%BD%91%E7%BB%9C%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE.png)
我正在配置虚拟机来托管应用程序的 API。我进入页面vCloud director
并按照以下步骤操作:
Generated the edges network
Created a VDC organization network (192.168.0.1/24 as a gateway and a pool of addresses from 192.168.0.2 to 192.168.0.10)
Created a vApp and added a virtual machine (connected its NIC to the VDC I created earlier).
Installed VMWare Tools on the machine and booted it up with force guest OS configurations
到目前为止,一切都很顺利。我启动了机器并 ping 了我的网关,我已连接到网关(这似乎是一个好的开始)。接下来,我尝试 ping,8.8.8.8
但得到了以下响应:
From 192.168.0.1 tcmp_seq=420 Destination Net Unreachable
我想也许我需要设置防火墙和 NAT 规则,所以我添加了以下规则:
Firewall rule for tcp on port 443 both external-internal and internal-external
Firewall rule for TCP on port 80 both external-internal and internal-external
Firewall rule for UDP on port 53 both external-internal and internal-external
SNAT rule with source address pool of 192.168.0.1-192.168.0.10 (gateway address + address pool from Organization VDC) and translated source IP obtained from my edge settings.
DNAT Rule with original IP address obtained from my edge settings and translated IP address / pool same as the source in my SNAT rule (192.168.0.1-192.168.0.10)
ip route show
输出:
default via 192.168.0.1 dev ens160 proto static
192.168.0.1/24 dev ens160 proto kernel scope link src 192.168.0.4
真的很抱歉终端图片,无法从 Web 控制台复制粘贴。如果这是个问题,LMK,我会使用 lense 从图片中复制文本并将其放在图片上。
PS:这是我第一次以这种方式使用服务器,所以如果我做了一些愚蠢的事情,请不要犹豫指出来。我更习惯于开箱即用的解决方案,例如 Digital Ocean 和 Google Cloud,这些解决方案已经配置了网络。这对我来说是全新的,尤其是虚拟化部分。我在高中时做过一些网络工作,但我们是用物理组件而不是这些虚拟组件来做的。