Issues with Bonding Interface on Ubuntu 24.04.3 LTS in Hyper-V

0
0
Asked By CloudyNinja92 On

Hey everyone! I'm working on setting up a bonded network interface on a freshly installed Ubuntu Server 24.04.3 LTS VM running in Hyper-V. The host machine has 4 NICs, and I've tried various configurations: a single switch with all four NICs, two switches each with two NICs, a basic teaming setup, and also individual ports connected to two Hyper-V switches. In the VM, I created two NICs and connected them to the Hyper-V network switches.

Individually, each NIC shows up as ethX and functions well; I can ping external sites and resolve addresses without issues. However, as soon as I turn on bonding—by renaming my Netplan configuration file and creating a bonding configuration—network traffic ceases to work. Restarting the VM doesn't help either. Once I revert to the individual NIC setup, everything works perfectly.

According to the documentation I've been reading, using active-backup mode shouldn't require any special switch configurations. Here's a snippet of my Netplan config:

network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
bonds:
bond-lan:
interfaces: [eth0, eth1]
addresses: [10.64.100.118/24]
nameservers:
search: [local]
addresses: [8.8.8.8, 1.1.1.1]
parameters:
mode: active-backup
mii-monitor-interval: 1
primary: eth0
gratuitous-arp: 5
routes:
- to: default
via: 10.64.100.1

I feel like I might be missing something fundamental about bonding or have a configuration error. Any tips from Linux enthusiasts would be greatly appreciated! Thanks!

4 Answers

Answered By ConfigMaster On

Just sharing a helpful resource here that might clarify how to set up a bonding interface in a Hyper-V environment: [Configuring an Interface Bond in Ubuntu Hyper-V Guest](https://blog.workinghardinit.work/2022/04/04/configuring-an-interface-bond-in-a-ubuntu-hyper-v-guest/). It explains that MAC address spoofing is crucial for Linux VMs with bonding in Hyper-V, which could solve your issue!

Answered By NetworkGuru99 On

Could you run a route print when your Netplan bonding is active? It’d help verify if the configurations are being parsed right.

CloudyNinja92 -

Thanks for the suggestion! I ended up trying things on my home PC with a live Ubuntu server and found that it correctly got an IP for the bond I configured. This indicated that my Hyper-V setup was the problem. Turns out, MAC address spoofing needs to be enabled for bonded interfaces to work properly on Hyper-V!

Answered By TechWizard42 On

Did you remember to enable NIC Teaming on Hyper-V for each adapter? You can find that in the network adapter properties under Advanced features. That's usually a common issue with bonding problems in VMs.

CloudyNinja92 -

Good catch! I hadn’t turned it on since this is my first time experimenting with bonding and teaming. However, after enabling it and rebooting, I still had the same issue. No changes.

Answered By HyperV_Explorer On

Just curious, is this whole setup just for learning purposes? Typically, bonding is handled at the hypervisor level, rather than inside the VM itself. The Linux bonding setup just needs to know when links are up or down, but I'm not sure if Hyper-V provides that info correctly.

CloudyNinja92 -

Yes, it's purely for lab work. I want to get a grasp of how bonding functions in Linux so I can apply it to physical servers down the line. I plan to use real Linux boxes eventually, and this is just a simulation for practice.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.