0

I have 2 virtual machines configured and running on VMWare (Ubuntu and Kali). Both these machines are attached have a single network interface configured on VMWare which is the NAT interface.

From my findings on the NAT interface, the host IP and the internet should be visible to the virtual machines which is the case. The problem I have is that the host IP can also ping the IPs of these virtual machines and also access applications deployed on these machines directly via the virtual machines' IP addresses.

This should not be the case with the NAT interface. The host should only be able to access these virtual machines via port forwarding. That is to say, with port forwarding configured. To access one of the VMs, I would rather use the host's IP coupled with a port for which a port forwarding rule has been applied and so the traffic on this route would be forwarded to the specified virtual machine on the required port.

I need some clarification on why this is happening or some more insight into how VMWare takes care of Virtual Machines on the NAT interface if I'm am mistaken in my understanding.

One more thing to note is that these machines all have their IPs in the 192.168.x.x range instead of the 10.0.x.x range used by default for machines on the NAT interface (to the best of my knowledge).

I was able to ping the private IP of the virtual machines directly from the host command line. I was not expecting the ping to work as the Virtual machines are all on the NAT interface.

Also, the virtual machines also communicate with each other i.e I can ping one virtual machine's IP from the other successfully, which should not be the case with NAT.

3
  • "This should not be the case with the NAT interface. The host should only be able to access these virtual machines via port forwarding." I don't think so. That's like saying that a router should not be able to ping the local machines it's providing NAT for. In the VM scenario, your host is the router.
    – jamesdlin
    Commented Mar 27, 2022 at 11:56
  • "Also, the virtual machines also communicate with each other i.e I can ping one virtual machine's IP from the other successfully, which should not be the case with NAT." That's also an incorrect understanding. The virtual machines are all connected to the same virtual network, which is like having physical machines connected to the same LAN. Also see superuser.com/a/1180970.
    – jamesdlin
    Commented Mar 27, 2022 at 11:59
  • Thanks for the comment @jamesdlin . I guess there are many articles on these networking interfaces all of which do not contain consistent information but I've done some more research and also gone through the link you attached. Thanks a lot, I have a better understanding on this topic now.
    – dullbenz
    Commented Apr 7, 2022 at 8:40

0

You must log in to answer this question.