Ping two virtual machines through a router machine (different networks)

Cat -  
avion-f16 Posted messages 19182 Registration date   Status Contributor Last intervention   -
Hello,

I have connected four virtual machines under VMware Workstation Pro 2019 with another machine functioning as a router.
Two machines (1 and 2) are on the same network;
Two other machines (3 and 4) are on the same network;
The two networks are not the same.
The 5th machine is connected to all four other machines.
From machines 1 and 2, I can ping each other and the 5th machine, they are on VMnet2 host-only.
From machines 3 and 4, I can also ping each other and the 5th machine, they are on VMnet3 host-only.
(The host-only DHCP is disabled)

This is what has already been done.
Now, I need to connect machines 1 and 4, then machines 2 and 3 (which are on different networks) via the router machine.
To connect the machines, I created a .yaml file and wrote in it (respecting the spaces):


network:
version: 2
renderer:networkd
ethernets:
ens33:
addresses: [192.168.88.1/29]
gateway: 192.168.88.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
dhcp4: false
dhcp6: false
routes:
- to: 192.168.30.2
via: 192.168.88.3


The IP of my first machine is 192.168.88.1/29
The IP of my second machine is 192.168.88.2/29
The third one is 192.168.30.1/29
The fourth is 192.168.30.2/29
And the 5th one has two IPs:
- 192.168.30.3/29
- 192.168.30.1/29

My machines 1, 4, and 5 are powered on but the ping is not going through.
They tried to explain it to me, but I couldn't reproduce it.
Does anyone have a solution, please?
Thank you very much.

Have a good day.

1 answer

avion-f16 Posted messages 19182 Registration date   Status Contributor Last intervention   4 511
 
Hello,

This is more of a "Network" issue rather than a "Virtualization" one; the "virtualization" aspect matters little as long as you have:
- 2 VMs connected to the same bridge
- 2 VMs connected to another bridge
- 1 VM connected simultaneously to both bridges

> The 5th machine is connected to the other four machines.

Can you elaborate on that? How did you establish this connection?
The "router" VM should not be connected to the 4 other VMs; it should only be connected to the two bridges and will therefore have two network interfaces.

> And the 5th has two IPs:
> - 192.168.30.3/29
> - 192.168.30.1/29


This is a second issue: you have assigned 2 IPs to VM number 5 in the same subnet. It should rather have one IP in each of the two other subnets.

For better coherence, I advise you this addressing:

On bridge 1:
VM1: 192.168.88.1/24 gateway 192.168.88.254
VM2: 192.168.88.2/24 gateway 192.168.88.254

On bridge 2:
VM3: 192.168.30.1/24 gateway 192.168.30.254
VM4: 192.168.30.2/24 gateway 192.168.30.254

VM5 connected to both bridges:
- 192.168.88.254/24 on the interface linked to bridge 1 (no gateway)
- 192.168.30.254/24 on the interface linked to bridge 2 (no gateway)

It is not necessary to specify the routes on each VM since they will use VM5 as the default gateway, and VM5 will automatically determine the routes for the two subnets to which it is connected.

For Internet access, it will be necessary to create a 3rd interface on VM5, for example in "NAT" mode.

For practical implementation, not being a user of this software, I can only direct you to the documentation:
https://docs.vmware.com/en/VMware-Workstation-Pro/16.0/com.vmware.ws.using.doc/GUID-0CE1AE01-7E79-41BB-9EA8-4F839BE40E1A.html

And more specifically:
https://docs.vmware.com/en/VMware-Workstation-Pro/16.0/com.vmware.ws.using.doc/GUID-BAFA66C3-81F0-4FCA-84C4-D9F7D258A60A.html
0