2024年5月28日发(作者:)
VirtualBox NAT设置和端口转发
这是我对 VirtualBox 自带帮助关于 NAT 设置部分的翻译,翻的不当处,请批评指
正,我不是英语专业。未完,待续。转载我的文章,请注明出处,非常感谢。
1、 Network Address Translation (NAT)
Network Address Translation (NAT) is the simplest way of accessing an
external network from a virtual machine. Usually, it does not require any
configuration on the host network and guest system. For this reason, it is the
default networking mode in VirtualBox.
网络地址转换( NAT )是最简单的方法从一个虚拟机访问外部网。通常,它并不要
求在主机网络和客户机上做任何配置。基于这个原因,它是默认的网络模式 。
A virtual machine with NAT enabled acts much like a real computer that
connects to the Internet through a router. The “router”, in this case, is the
VirtualBox networking engine, which maps traffic from and to the virtual machine
transparently. The disadvantage of NAT mode is that, much like a private network
behind a router, the virtual machine is invisible and unreachable from the outside
internet; you cannot run a server this way unless you set up port forwarding
(described below).
设置为通过 NAT 方式连接的一台虚拟机能像一台真正的计算机一样访问互联网,主
机就是一只路由器。 在这种方式下,通过 VirtualBox 网络引擎,虚拟机透明地映射到外
部网络。 NAT 方式不方便是,很像是在路由器之后的一个专用网络,从外部互联网看来,
虚拟机是无形和不能到达的; 您不可能在虚拟机上运行一个服务器,因为外部网络无法访
问通过 NAT 方式连接的内部机,除非您设定了端口转发(下述)。
The virtual machine receives its network address and configuration on the
private network from a DHCP server that is integrated into VirtualBox. The address
which the virtual machine receives is usually on a completely different network to
the more than one card of a virtual machine can be set up to use NAT, the
first card is connected to the private network 10.0.2.0, the second card to the
network 10.0.3.0 and so on.
虚拟机从一个 VirtualBox 整合的 DHCP 服务器得到私有的网址。 这个网址对主机
来说是一个完全不同的网络。一台虚拟机的多个网卡可以被设定使用 NAT, 第一个网卡
连接了到专用网 10.0.2.0,第二个网卡连接到专用网络 10.0.3.0,等等。默认得到的客户
端ip(IP Address)是10.0.2.15,网关(Gateway)是10.0.2.2,域名服务器(DNS)
是10.0.2.3,可以手动参考这个进行修改。
The network frames sent out by the guest operating system are received by
VirtualBox’s NAT engine, which extracts the TCP/IP data, and resends it using the
host operating system. To an application on the host, or to another computer on
the same network as the host, it looks like the data was sent by the VirtualBox
application on the host, using an IP address belonging to the host. VirtualBox
listens for replies to the packages sent, and repacks and resends them to the guest
machine on its private network.
发布评论