VMware Nat port ing

Source: Internet
Author: User

This article draws from http://nxlhero.blog.51cto.com/962631/742140

VMware Workstation provides two virtual machine access methods: one is Bridge and the other is Nat. The other is the public network address, and the NAT can only be an intranet address.

Nat serves as a NAT converter. We can add Port ing so that the Internet can access the virtual machine that uses Nat to access the Internet.

The following are two examples:

The host environment used is

HOST: win7 + vmware workstation 8 Public IP Address: 118.229.240.94

Virtual Machine: fedora 8 Intranet IP Address: 192.168.126.141

Example 1: Build an HTTP server in a virtual machine and access the server using a public IP Address

1. Configure httpd

Httpd is installed in the VM. If not, yum install httpd

Start/etc/init. d/httpd start

Disable Firewall/etc/init. d/iptables stop

Run the 127.0.0.1 test on the VM and run the 192.168.126.141 test on the host.

2. Add port ing rules

Enter http: // 118.229.240.94 in the host browser, which is inaccessible because the host does not have an HTTP server.

Open VMware network editor and find the NIC used by the VM. My network is vmnet8.

Enable Nat setting

Add a port ing. We map the host port 10000 to port 80 of the VM.

OK. You can access http: // 118.229.240.94: 10000 on the host.

But it cannot be successful on a remote host. Why? Because the firewall is built on the virtual machine,Host (master machine, not remote access host)Open the firewall and manually open port 10000 of the host. For more information, see the following link:

Http://windows.microsoft.com/zh-CN/windows7/Open-a-port-in-Windows-Firewall

Example 2: SSH port ing

In the preceding method, port 10001 of the host is mapped to port 22 of the VM (port 22 is used for SSH), and you can use Putty to specify port 10001 to access the VM.

 

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.