Set port mappings in VMware Virtual machines (reprint)

Source: Internet
Author: User
Tags ssh port

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.