VMware Workstation provides two ways to access virtual machines, one bridge, one Nat,bridge to get a public address, and NAT to be an intranet address.
NAT is equivalent to using a host as a NAT translator, and we can add port mappings so that the extranet can access virtual machines that use NAT to surf the web.
Here are two examples of
The host environment used is
Host: Win7 + VMware workstation 8 public network ip:118.229.240.94
Virtual machine:: Fedora 8 Intranet ip:192.168.126.141
Example 1: Building an HTTP server inside a virtual machine, using a public address to access
1. Configure httpd
Virtual machine Internal installation httpd, not Ann words yum install httpd
Start/etc/init.d/httpd Start
Turn off the firewall/etc/init.d/iptables stop
In the virtual machine with 127.0.0.1 test, in the host with 192.168.126.141 test, can access the normal
2. Add a port mapping rule
Enter http://118.229.240.94 in the host browser, inaccessible because the host does not have an HTTP server.
Open the VMware Network Editor and find the network card used by this virtual machine, my vmnet8\
Turn on NAT setting
Add a port mapping, we map the host 10000 port to the virtual machine 80 port
OK, Access http://118.229.240.94:10000 within the host, can be successful.
But it can't be successful on a remote host, why? Because the virtual machine has a firewall, the host opened a firewall, manually open the host port 10000, the method refer to the following link:
Http://windows.microsoft.com/zh-CN/windows7/Open-a-port-in-Windows-Firewall
Example 2:SSH port mapping
By mapping the host's 10001 port to the 22 port of the virtual machine as described above (SSH uses 22 ports), you can access the virtual machine by specifying the port number 10001 putty
Original: http://www.server110.com/vmware/201309/1703.html
Set port mappings in VMware Virtual machines (reprint)