VirtualBox NAT设置和端口转发
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 16:27 点击:次
临川十中 胡长生
这是我对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 )是最简单的方法从一个虚拟机访问外部网。通常,它并不要求在主机网络和客户机上做任何配置。基于这个原因,www.2cto.com 它是默认的网络模式 。
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 host.As 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.
客户机(即虚拟机)送出的网络帧被VirtualBox 的NAT 引擎收到,抽取TCP/IP 数据,再通过主机的操作系统(即安装VirtualBox 的操作系统)重新发送出去。送到在主机上的一个应用程序,或者到位于主机同一网络的另一台计算机上,它看起来好象是安装在主机上的程序VirtualBox,通过一个属于主机的IP 地址,把数据发送出去。VirtualBox 倾听到数据包裹的回复,通过客户机的私人网络重新包装和发送往客户机上。
You can set up a guest service which you wish to proxy using the command line tool VBoxManage. You will need to know which ports on the guest the service uses and to decide which ports to use on the host (often but not always you will want to se the same ports on the guest and on the host). You can use any ports on the host which are not already in use by a service. An example of how to set up incoming NAT connections to a ssh server on the guest requires the following three commands:
你可以设置一个虚拟机的服务(比如WEB 服务),通过使用命令行工具VboxManage 代理。你需要知道虚拟机的服务使用哪个端口,然后决定在主机上使用哪个端口(通常但不总是想要使虚拟机和主机使用同一个
这是我对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 )是最简单的方法从一个虚拟机访问外部网。通常,它并不要求在主机网络和客户机上做任何配置。基于这个原因,www.2cto.com 它是默认的网络模式 。
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 host.As 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.
客户机(即虚拟机)送出的网络帧被VirtualBox 的NAT 引擎收到,抽取TCP/IP 数据,再通过主机的操作系统(即安装VirtualBox 的操作系统)重新发送出去。送到在主机上的一个应用程序,或者到位于主机同一网络的另一台计算机上,它看起来好象是安装在主机上的程序VirtualBox,通过一个属于主机的IP 地址,把数据发送出去。VirtualBox 倾听到数据包裹的回复,通过客户机的私人网络重新包装和发送往客户机上。
You can set up a guest service which you wish to proxy using the command line tool VBoxManage. You will need to know which ports on the guest the service uses and to decide which ports to use on the host (often but not always you will want to se the same ports on the guest and on the host). You can use any ports on the host which are not already in use by a service. An example of how to set up incoming NAT connections to a ssh server on the guest requires the following three commands:
你可以设置一个虚拟机的服务(比如WEB 服务),通过使用命令行工具VboxManage 代理。你需要知道虚拟机的服务使用哪个端口,然后决定在主机上使用哪个端口(通常但不总是想要使虚拟机和主机使用同一个
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>