Virtualbox:从客户机到主机的端口转发不起作用

Virtualbox:从客户机到主机的端口转发不起作用

在下面VBOX我有一个基于 Ubuntu 的虚拟机,运行于NAT

我习惯于像下面这样配置 vbox 端口转发

Name     Protocol  IP host  Port host  IP Guest  Port Guest
myrule   TCP                3000                 3000

但是,当在端口 3000 上运行我的 Web 应用程序时,我无法在主机上的浏览器中打开它。(并且它在我的客户虚拟机中运行不正常)

ifconfig在我的客户虚拟机中显示以下内容:

ifconfig
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.3.15  netmask 255.255.255.0  broadcast 10.0.3.255
        inet6 fe80::b612:8769:ba28:6e2e  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:42:89:7b  txqueuelen 1000  (Ethernet)
        RX packets 3354  bytes 2134154 (2.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2669  bytes 373394 (373.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Boucle locale)
        RX packets 229607  bytes 231076789 (231.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 229607  bytes 231076789 (231.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

和我的/etc/网络/接口文件如下所示:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

有建議嗎??

相关内容