2

Is it possible to bond virtual network interfaces? If yes, how?

Bonding of physical interfaces is explained here for example: https://wiki.linuxfoundation.org/networking/bonding

My situation is this: I have a host with 10 physical ethernet interfaces (NICs). Each of those is a trunk for multiple VLANs. I plan to make a virtual ethernet interface on each physical interface for each VLAN. Example: eth0 carries 3 VLANs (3,11,15) -> I create eth0.0 (VLAN3), eth0.1(VLAN11) and eth0.2(VLAN15).

I further want to include some redundancy. I think of the bonding mode "active backup". The idea was to bond multiple virtual interfaces, which belong to different physical interfaces, e.g. eth0.5, eth2.3 and eth8.4. Since this is a bigger project I wanted to make sure this works beforehand. If this works in general, do the bonded virtual interfaces have to have the same VLAN ID, i.e. would it work if (in the example above) eth0.5 had VLAN 22, eth2.3 VLAN 42 and eth8.4 VLAN 52?

  • 1
    Can you add what you tried from it in the question? Where did you have a problem? – A.B Apr 17 '18 at 9:18
  • I added additional information, hope this helps/ makes it more clear. – kiigass Apr 22 '18 at 11:04
  • 1
    For bonding, all the interfaces participating in the bond should have the same VLAN assignments (either single VLANs or trunks of identical composition), or else what you're setting up is going to be a trouble generator. An active-backup bond will switch from one member to another when it detects a loss of link or a specified MAC address stops responding to ARP requests. The layers "above" the bond are not supposed to need to change their configuration when the bond switches to a new member: this is only possible if all the members of a bond have the same VLAN connectivity. – telcoM Apr 22 '18 at 11:41
  • I agree with telcoM . So what is usually done is to have redundancy among physical interfaces. Perhaps grouping your 10 NICs into 2x5, meaning each NIC will have a peer configured the same, receiving the same VLANs. you'd have bond0 to bond4 for example. from those bond interfaces, you'll create sub-interfaces. For ease of naming, the sub-interface's name should have the vlan in it: bond0.22 for VLAN 22 ... also it's important to name things correctly. At first I thought the sub-interfaces were "type veth" not vlan. – A.B Apr 22 '18 at 17:06
  • Unfortunately, that's not possible. The physical interfaces are connected to defined nets and hosts. I cannot change anything regarding that. Also the VLANs are predefined. I have basically 2 hosts which are connected via three different VLANs and nets. My goal is to have a backup connection, if the primary connection fails. That's why I thought of bonding with active backup. From your comments I understand bonding of virtual interfaces is basically possible, if they have the same VLAN configuration? – kiigass Apr 22 '18 at 19:37
1

The answer is: Yes it is possible. At least with RedHat bonding of virtual interfaces works the same way as bonding of physical interfaces. It is even possible to bond (mode=broadcast) virtual interfaces which are configured for different Vlan-IDs. The result is that the packages sent to the bonding interface appear on all bonded Vlans each with the correct Vlan-ID.

Note that this is not officially supported by RedHat6. It not known to me weather it is officially supported in RedHat7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.