VMware Communities
RPMiller
Contributor
Contributor
Jump to solution

Static Guest IP, Dynamic Internet access, must also connect to host

Here's what I'm trying to achieve, you tell me how:

  • Virtual Guest Server with a static IP that must stay as it is.
    • It only has one NIC, and an additional NIC can not be added.
  • Host is laptop set for DHCP, and works just fine everywhere.
  • The host must connect to the VM.
  • The VM must be able to connect to the Internet.
  • The laptop travels all over and connects to all manner of networks, so the solution must be able to handle a host and network that are constantly changing IPs.

I'm thinking a NAT connection, but I don't think that will work since the VM is statically assigned an IP. But Bridged won't work since the laptop is changing all the time, but the server is static.

What do you smarter people than I think will work?

Reply
0 Kudos
1 Solution

Accepted Solutions
bluefirestorm
Champion
Champion
Jump to solution

I am not sure if a VM router appliance is needed.

Have you tried assigning a static IP inside the VM that belongs to the same NAT subnet? The address ranges 3 through 127 should be assignable as static IP address for the NAT subnet (by default rules unless you changed them).

So for example if the VM NAT subnet is 192.168.109.x/24

The static IP you assign the VM is 192.168.109.100 with a default gateway of 192.168.109.2. I think the host should be accessible from the VM with 192.168.109.1 and likewise the host can access the VM with 192.168.109.100. You may have to be mindful of the firewall rules of both the host and guest machines though.

View solution in original post

Reply
0 Kudos
10 Replies
RDPetruska
Leadership
Leadership
Jump to solution

Sounds like the best bet would be a second virtual machine that is a router - so that the IP address for the guest can remain the same, and on the subnet of the "local" virtual nic of the router; while the "external" virtual nic of the router can be set to bridged mode, DHCP connection.

Reply
0 Kudos
RPMiller
Contributor
Contributor
Jump to solution

Could you provide a little more information on that strategy? I wasn't using one in the past, but maybe it will be easier than trying to figure out what I was doing.

Reply
0 Kudos
RDPetruska
Leadership
Leadership
Jump to solution

There are several pre-built VMs out there with routing software installed.  Use one of those - it should be configured with 2 virtual NICs (one external, probably set to bridged mode, so that it will reach the outside world on whatever host PC it is running on; the other an internal one, using one of the unused VMnets).  You would configure the internal NIC/VMnet to be a specific subnet/IP address range.  Then this particular VM will be configured to use that same VMnet, and keep its dedicated static IP which is on that subnet.

Obviously, you would need to install/distribute both VMs together for it to work - but this sounds like a relatively simple approach to solve your problem.

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

I am not sure if a VM router appliance is needed.

Have you tried assigning a static IP inside the VM that belongs to the same NAT subnet? The address ranges 3 through 127 should be assignable as static IP address for the NAT subnet (by default rules unless you changed them).

So for example if the VM NAT subnet is 192.168.109.x/24

The static IP you assign the VM is 192.168.109.100 with a default gateway of 192.168.109.2. I think the host should be accessible from the VM with 192.168.109.1 and likewise the host can access the VM with 192.168.109.100. You may have to be mindful of the firewall rules of both the host and guest machines though.

Reply
0 Kudos
RDPetruska
Leadership
Leadership
Jump to solution

You may be right - I thought in the OP I read that this VM would run on different hosts, in different locations (which would default to different subnets for the NAT virtual switch on each host).  However, after re-reading, I see that it mentions just the one laptop being used in various locations.

Reply
0 Kudos
RPMiller
Contributor
Contributor
Jump to solution

Yes, this is not going to run on multiple hosts at all. This is just for one laptop. And I already tried the NAT approach, and couldn't get it to work. I didn't mention what I've tried thus far because I didn't want to influence anyone's input regarding the solution. I'll provide some more details now, as I think it is required.

The server I mentioned will provide configuration information to the laptop host OS. It is configured with a static IP of 192.168.50.50

The laptop needs to be able to reach the 192.168.50.50 address to retrieve configuration information.

The laptop must also be able to get to the Internet wherever it goes.

The server IP (192.168.50.50) must also be able to reach the Internet when needed.

The server will not always be running, but when needed, it will need to make that Internet connection.

Based on what I'm reading, it sounds like my NAT solution should be able to work. I have not made any customization or configuration changes to the VMware Workstation install, so nothing to worry about there.

So, why isn't my NAT working, if that is indeed the best approach to take here?

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

The IP addresses 192.168.10.10 and 192.168.50.50 do not belong to the same subnet; so it is not clear where you get these addresses from. If you had assigned 192.168.10.10 to the VM because VMnet8 is currently 192.168.10.x; where did the value 192.168.50.50 come from? Is this some hardcoded value inside an application within the VM?

Anyway, the addresses have to belong to the same 255.255.255.0 class/subnet. So either change VMnet8 (through the Virtual Network Editor) or change the static IP assigned to the VM to conform to the VMnet8 subnet.

For the VMnet8 network, default is 1 is the host, 2 is the gateway/DNS, 128 through 255 is in the DHCP lease scope and as mentioned earlier 3 through 127 is available for static IP use.

Reply
0 Kudos
RPMiller
Contributor
Contributor
Jump to solution

The 10.10 was a typo. Fixed now.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I agree with you, and the others that NAT will be the right solution.

Can you confirm that the virtual NAT network (in the Virtal Network Editor) is configured properly (i.e. 192.168.50.0/24) and that your host virtual adapter (vmnet8 by default) has the 192.168.50.1/24 address (see e.g. output of ipconfig /all on the host)?

If the settings seem to be correct, and it still doesn't work, then please post the output of ipconfig /all for the host as well as for the guest. Note that in case you don't want to disclose all of the host's settings, you may only post the settings for the NAT virtual adapter (vmnet8).

André

Reply
0 Kudos
RPMiller
Contributor
Contributor
Jump to solution

Thanks everyone!  Bluefirestorm had the correct information. It was the default gateway that wasn't configured properly. I had it set to 1 and it needed to be 2. Everything is functioning as it was prior to the laptop rebuild. Thanks again everyone for the insights and second pair of eyes.

Reply
0 Kudos