Bonding in combination with host-only network

Discussions related to using VirtualBox on Linux hosts.
Post Reply
RoyV
Posts: 1
Joined: 20. Aug 2021, 16:16

Bonding in combination with host-only network

Post by RoyV »

I have physical systems that are connected through 2 separate networks for fault tolerance. On both systems I use the broadcast bonding mode (mode 3). See the following diagram:

Code: Select all

                    +------------------+                    
                    |                  |                    
        +-----------|     System A     |----------+         
        |           |                  |          |         
        |           +------------------+          |         
        |                                         |         
        |                                         |         
+------------------+                    +------------------+
|                  |                    |                  |
|     Switch A     |                    |     Switch B     |
|                  |                    |                  |
+------------------+                    +------------------+
         |                                        |         
         |                                        |         
         |          +------------------+          |         
         |          |                  |          |         
         +----------|     System B     -----------+         
                    |                  |                    
                    +------------------+                    
This works well in physical setups. I am trying to emulate this setup in Virtualbox using host-only networks. I created two host-only networks, vboxnet0 and vboxnet1. I added these to the interfaces of my virtual machines. Separately these networks work well (i.e. setting up static IP addresses allows communication over both vboxnets). Unfortunately, as soon I introduce bonding on the Ubuntu guests I run into problems. My interfaces file is the following:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet manual

auto bond0
iface bond0 inet static
  address 10.0.1.22/24
  broadcast 10.0.1.255
  bond-slaves none
  bond-mode 3
  bond-miimon 100

auto enp0s9
iface enp0s9 inet manual
bond-master bond0

auto enp0s8
iface enp0s8 inet manual
bond-master bond0
The guests can ping each other, but only over one of the networks (i.e. ping shows no DUPs). No matter what I change in the interfaces file, I cannot get it to work over both networks. Interestingly bonding does work when both network interfaces of the guest are connected to the same host-only network (e.g. vboxnet0), but this is undesirable as then the traffic is duplicated 3x, instead of only 1x.

Is what I want supported by Virtualbox host-only networks? If not, are there any alternatives ways?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Bonding in combination with host-only network

Post by scottgus1 »

I don't know, unfortunately, if Host-Only supports binding. It may not have been programmed in.

Host-Only includes the host OS in the network as a third computer, which doesn't appear to be an exact duplicate of your physical setup, which is only two computers.

Since you have two VMs, you could try it with two Internal networks. Though it may also not work, depending on if binding was programmed into Internal.

See Virtualbox Networks: In Pictures
Post Reply