VMware NAT port ing

Source: Internet
Author: User
Tags ssh port

 

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 virtual machine has a firewall and the host has a Firewall Enabled, You can manually open port 10000 of the host. The method is as follows:

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.

The next blog post discusses the port of the Xen virtual machine. The port ing of Xen is not as user-friendly as VMware.

This article is from the blog of "Niu GE's blog ".

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.