Zentyal/zentyal — pull request #706 by sevoku (2013-10-20 10:47:33+00:00)
Title: Bonding support in the network module

Hi,

I've added bonding support to the network module (http://trac.zentyal.org/wiki/Document/Development/Wishlist/Module/Network#Bondingchannel).

The implementation is a combination of the bridge and vlan modes. Creating a bond device is like creating a bridge, but the bundled physical interfaces are ignored by other modules and firewall (like trunks).

I'm running a configuration with two bundled devices in LACP mode connected to a Netgear Smart Switch and it works like a charm. During the next weeks we will switch our networks completely to vlans, so I'll be able to test this in trunk mode.

Features:
- Connect interfaces to one link
- Configure the new bonding device like every other real interface
- Bonding mode selection (static, LACP, backup,...)
- Add bond device to a bridge (not tested)
- Use bond device in vlan trunk mode (tested with xmit_hash_policy=layer2+3, maybe should be added to interfaces template)
- includes minor changes in firewall, ips and trafficshaping modules

Nice To Have:
- set fixed MAC address (this should be implemented for bridges too), for now the MAC of the first device added is used
- autodetection of the interface capabilities using ethtool
- maybe add more configuration options (perhaps to the config file in etc)

I'm not sure about the ifaceAddresses, ifaceAddress and ifaceNetmask functions in Network.pm. Since the physical devices are ignored, these functions should never be called for them. I've added some elseifs for 'bundled'' mode but they are commented out.

Would you review my code and maybe merge it into upstream?

Thanks for the great project!

Vsevolod Kukol