-1

i'm working on an academic project (nothing professional) and wonder if i can set a rule that will permit me to redirect my local ip address to my virtual machine address, the virtual machine is an HTTP server, so i need to check my website from other computers on the same network, in other computers i will write the IP of my server computer(containing a vm) and then that IP will be translated to my vm IP.

Reda
  • 287
  • 2
  • 8
  • 21

2 Answers2

2

From the host machine you could use the following Netsh command under cmd with administrator privileges:

netsh interface portproxy add v4tov4 listenport=80 connectaddress=192.168.0.10

providing that the vm IP address is 192.168.1.10 (replace with the actual one and make it static), the HTTP server is on port 80, and IPv4 is used.

After successful entry you may confirm the rule by using the following command:

netsh interface portproxy show all

For more information you may consult the following link:

http://technet.microsoft.com/en-us/library/cc731068(v=ws.10).aspx#BKMK_1

gmag
  • 43
  • 4
  • what's the v4tov4 for ? – Reda Jan 27 '14 at 12:49
  • It's the Internet Protocol version used which most probably is version 4. _IPv4-configured computer and application messages sent to other IPv4-configured computers and applications._ – gmag Jan 27 '14 at 13:46
  • this isnt working is there a simple method like using bridged interface – Reda Jan 27 '14 at 20:42
  • Sure, you may use bridged network mode for VMWare VM. Then the VM will take a new IP address at the same subnet as the host. For more information please use the following: [link](http://pubs.vmware.com/workstation-10/index.jsp#com.vmware.ws.using.doc/GUID-826323AD-D014-475D-8909-DFA73B5A3A57.html) – gmag Jan 28 '14 at 14:33
  • Worked perfectly for me. And this method is super-easy compared to others – Gennady Dogaev Apr 30 '17 at 11:55
1

Two options:

1) Use a bridged NIC. The VM will have an IP address in the same subnet as the host machine, assuming DHCP is active. That's the simplest.

2) If VMware Workstation, attach the VM to the NAT switch. In Network Configuration you can then port forward so when your host IP receives traffic on port X it can forward that traffic to NAT client IP port X (or Y). I can't remember if VMware Player has NAT port forwarding.

sallie
  • 349
  • 1
  • 5
  • VMWare Player does have NAT port forwarding. See [this answer](https://stackoverflow.com/questions/52386841/how-to-do-port-forwarding-on-vmware-player-14-1-2-ubuntu-18-04-guest-windows-1) for example. – David Balažic Jun 03 '20 at 15:23