VMware Communities
grob115
Enthusiast
Enthusiast
Jump to solution

How to properly simulate a VM with public IP address

Hi I need to simulate a VM that is connected to the public Internet with public IP addresses in VMware Workstation but not sure if I'm using the appropriate steps.  What I did was something like this:

  1. Start Virtual Network Editor, click Add Network.
  2. When the new network is created (ie VMnet2), I select "Host-only (connect VMs internally in a private network)"
  3. Tick the check box "Connect a host virtual adapter to this network".
  4. Assign the corresponding public Internet IP subnet to the Subnet IP and Subnet mask fields.
    Note for some reasons I'm not able to use anything that doesn't begin with x.x.x.0.  For example I'm able to use 109.122.105.0 and 255.255.255.0 but not 109.122.105.90 and 255.255.255.248.  If anyone knows why please shed some light on this as well.
  5. On the VM, I'll then edit the hardware settings and assign the network device to VMnet2.

Questions:

  1. Is this the correct way of say simulating the VM running in my PC with public IP addresses?  The goal is to keep the VM settings intact without changing anything.
  2. Is traffic originating from my PC targeting this public IP address will only be routed to this VM and not out to the Internet?  It does appear this is indeed the case even when I'm connected to the Internet but just want to check whether this is the way it's designed to work.
  3. Why would Virtual Network Editor only allows us to set 109.122.105.0/24 (ie with 255.255.255.0) rather than 109.122.105.90/29 (ie with 255.255.255.248)?
  4. Is there a way to visualize the vSwitches and VMnets that are running on my PC?  With vSphere client connected to ESXi, I'm able to see how they are connected visually when I click on Configuration for the host, and then Network.
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

1.) Unless you need to access the VM from the host's virtual network adapter, you don't even need to create a separate vmnet.

2.) Traffic on a Host-Only network will not be stay internally. However, creating such a vmnet with a host virtual adapter may prevent the host from accessing this specific subnet on the Internet, because traffic is routed internally.

3.) The proper Subnet ID in this case is 109.122.105.88/29 (see e.g. http://www.subnet-calculator.com/)

4.) No, nothing that I would know of.

André

View solution in original post

0 Kudos
4 Replies
a_p_
Leadership
Leadership
Jump to solution

1.) Unless you need to access the VM from the host's virtual network adapter, you don't even need to create a separate vmnet.

2.) Traffic on a Host-Only network will not be stay internally. However, creating such a vmnet with a host virtual adapter may prevent the host from accessing this specific subnet on the Internet, because traffic is routed internally.

3.) The proper Subnet ID in this case is 109.122.105.88/29 (see e.g. http://www.subnet-calculator.com/)

4.) No, nothing that I would know of.

André

0 Kudos
WhiteKnight
Hot Shot
Hot Shot
Jump to solution

I don't know if I'm understanding your title question correctly, but the most simple way of connecting a VM directly to the public internet is just by setting the Network Adapter connection setting to Bridged:

Bridged.png

This will have your VM behave as if it were physically connected to your router/switch.



[VMware]: Workstation 17 Pro; --
[host]: Windows 10x64 host; --
[guests]: Windows 10x64, Windows 8x64.
0 Kudos
grob115
Enthusiast
Enthusiast
Jump to solution

Hi, a.p. thanks for answering.  I actually just completed a very throughout test and yes my observations matches what you are saying.

1.) Unless you need to access the VM from the host's virtual network adapter, you don't even need to create a separate vmnet.

I do need to access the VM from the host that is running VMware Workstation.  My understanding is that if I don't create a separate VMnet with the correct subnet IP and mask assigned, the VM will not be able to bind the IPs it need and I won't be able to reach it from the host.  So for example, if the VM needs to use both 192.168.10.101 and 109.122.105.90, I need to create 2 VMnets, one for 192.168.10.0/24 and one for 109.122.105.88/29.

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

You want to create a vmnet for each subnet that you need to access form the host. The "Virtual Network Adapter" for the vmnet that's created on the host receives the x.x.x.1 IP address (in a /24 subnet), which actually allows the network communication.

André

0 Kudos