Setup bonding interface (Debian case)

Linux specific questions/information are gathered here. The main thrust of topics are applied to Centos/RedHat(RH)/Debian/Ubuntu/Gentoo distributives

Setup bonding interface (Debian case)

Postby lik » Wed Jun 22, 2016 10:49 am

The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical "bonded" interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed.

https://www.kernel.org/doc/Documentatio ... onding.txt

On Debian first install the ifenslave package, necessary to enable bonding:
Code: Select all
apt-get install ifenslave

Decide which bonding mode is desired for your needs. Full list can be find in original documentation.
Set kernel module options in /etc/modprobe.d/bonding.conf:
Code: Select all
alias bond0 bonding
options bonding mode=4 miimon=100 lacp_rate=1 xmit_hash_policy=1

Example of link aggregation with Link Aggregation Control Protocol (LACP) bonding and transmit hash policy set to layer2+3 mode.
/etc/network/interfaces:
Code: Select all
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
    bond-master bond0

auto eth1
iface eth1 inet manual
    bond-master bond0

auto bond0
iface bond0 inet static
    address 10.10.10.10
    netmask 255.255.255.0
    network 10.10.10.0
    broadcast 10.10.10.255
    gateway 10.10.10.254
    dns-nameservers 8.8.8.8 8.8.4.4
    bond-mode 802.3ad
    bond-miimon 100
    bond-downdelay 100
    bond-updelay 100
    bond-lacp-rate 1
    bond-slaves none
    bond-xmit-hash-policy layer2+3

Restart network interfces to apply changes:
Code: Select all
/etc/init.d/networking restart

And check status of bond0 interface:
Code: Select all
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2+3 (2)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 100
Down Delay (ms): 100

802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
        Aggregator ID: 1
        Number of ports: 2
        Actor Key: 17
        Partner Key: 1
        Partner Mac Address: 01:23:45:67:89:ab

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 01:23:45:67:89:01
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 01:23:45:67:89:02
Aggregator ID: 1
Slave queue ID: 0
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Linux specific

 


  • Related topics
    Replies
    Views
    Last post
cron