Search code examples
linuxnetwork-programmingvmwarevmware-workstation

Point 2 Point connection between 2 virtual machine in VMWare


I have a virtual network for testing built with VMWare Workstation 15. Everything works fine with the virtual network but I have an issue I can't fix.

From what I've understood the Virtual Network in VMWare (the one called VMnetx where x is a number) works as virtual switches. You create a virtual network with a subnet in the virtual network manager. Once you want to connect a machine into the virtual network, you select that network on your interface and everything works great.

The problem is if I want a P2P connection (basically a virtual cable connected as a bridge between two machines in the same subnet).

schema

I tried to create another virtual network with the same subnet so I can attach the two network adapter only to this newly created virtual network (which should have the same subnet) but VMWare won't let me create another virtual network with the same subnet.

Is there a way to connect two machines point2point on the same subnet of a virtual network already created without having to use the virtual switch?

PS all my machines run Linux server 20.04.2 LTS


Solution

  • Unfortunately, there's no way to do that. A solution would be to create a USB virtual dongle to connect both machines.

    The best solution remains to use a network interface connected to the virtual network and set Machine 2 to use Machine 1 as Default Gateway (you will no more need the 10.1.0.5 interface)