Configure port forwarding with NAT

From: http://scriptogr.am/kevinshen/post/configure-port-forwarding-with-nat

terminology:

  • guest: virtual machine like Ubantu

  • host: physical machine where virtual machine is running on, e.g. Windows 7

  • virtual machine app: VMware, Virtual Box etc.

with NAT configuration:

guest lives in a private network virtual machine app created. host and other guest can't access the service it exposes. use port forwarding will let virtual machine app listens to the certain ports on the host and forward to guest. we will utilize it to expose same port on both host and guest

Steps:

  1. create a rule in the virtual machine application, set Host IP: 127.0.0.1, set HostPort: 3000, set Guest Port: 3000
  2. in guest, listen to port 3000.
  3. in host, open a web browser, type: localhost:3000. it will send get request to guest
原文地址:https://www.cnblogs.com/puncha/p/3876862.html