Direct network connect between 2 VM

cbitconquer

New Member
Feb 24, 2020
5
0
1
44
Hello,

I need to connect 2 virtual machines directly through a "virtual network cable" without using a switch. Is this possible in Proxmox?

Thanks in advance,

C.
 
Yes this should work:
* create a new bridge on the PVE node (without attaching a physical interface) (e.g. vmbr1)
* add one network interface to each guest, which is connected to this bridge
* configure your IPs inside the guest

I hope this helps!
 
  • Like
Reactions: +DS_DV+
Thank you for replying: I forgot to mention that my two guests are in 2 different pve nodes mounted on a cluster
 
"how do you want to do that without any switch ?" - do you mean "physical switch", attaching a physical network card to a virtual bridge?

"do you have an example with another hypervisor ? " - this is my doubt, if it is possible (I'm a rookie in Proxmox)



Perhaps creating a bond and assigning different VLANS?
 
>> "how do you want to do that without any switch ?" - do you mean "physical switch", attaching a physical network card to a virtual bridge?

I just comment your first question ;)
"I need to connect 2 virtual machines directly through a "virtual network cable" without using a switch"


>> Perhaps creating a bond and assigning different VLANS?

what is your problem exactly ? do you want to isolate traffic of theses 2 vms from the others vms ?
 
Thank you for reply:

I have 2 NAS-s into 2 pve nodes(in cluster) and inside those Nas-s with own software want to create a cluster. One of the requisites is to direclty connect those Nas-s between the secondary network adpaters(heartbeat connection)
 
ok, so it's really depend if you have free physical nic port.

if you have physical nic port, you could use a cross-cable between your 2 nodes,

-then create a vmbrX on each node, and add the vm interface hearbeat on it.

or could also passthrough the physical nic in the vm,instead using the vmbrX, but maybe it's a little bit overkill


if you don't have free physical nic port, you need a vlan indeed. (but generally, the hearbeat link should be on another network)
 
ok, so it's really depend if you have free physical nic port.

if you have physical nic port, you could use a cross-cable between your 2 nodes,

-then create a vmbrX on each node, and add the vm interface hearbeat on it.

or could also passthrough the physical nic in the vm,instead using the vmbrX, but maybe it's a little bit overkill


if you don't have free physical nic port, you need a vlan indeed. (but generally, the hearbeat link should be on another network)

I'll have a look: thank you very much
 
If your PVE nodes have fault-tolerant network interconnection (a real fault-tolerant cluster always should), you will not need any special setup for VMs. If the software (technically) requires two different NICs, just add two there.
 
Yes this should work:
* create a new bridge on the PVE node (without attaching a physical interface) (e.g. vmbr1)
* add one network interface to each guest, which is connected to this bridge
* configure your IPs inside the guest

I hope this helps!
sorry for necro :)
found this thread via google so i wanted to add that if you want the host to also be able to interconnect with the lxc / vm you have to set an IP to the interface.

So for example if you have :
pve vmbr1 10.0.0.1/24
lxc1 vmbr1 10.0.0.2/24
vm1 vmbr1 10.0.0.3/24

if you configure it like Stoiko Ivanov said you only have guest to guest communication
if you give the host an address you also can have host to gues / guest to host communication as well ( :
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!