Hi, I've using linux bonding in active-backup mode to combine two pairs of GigE NICs (eth0/eth1, eth2/eth3) into two logical bonds (bond0/bond1). All is working fine. However, I would like to specify a primary interface for each bond. This means I need to specify different options to the bonding module for each bond. I have tried every conceivable incantation of options and cannot get the kernel to recognize the second set of options. Initially, my modprobe.conf looked like this: alias bond0 bonding alias bond1 bonding options bonding mode=active-backup miimon=100 max_bonds=2 What I am trying to achieve should be possible by changing modprobe.conf to this: alias bond0 bonding options bond0 -o bond0 miimon=100 mode=active-backup primary=eth0 alias bond1 bonding options bond1 -o bond1 miimon=100 mode=active-backup primary=eth2 But this results in fatal errors while bringing up the bonding interfaces. Changing to this eliminates the errors, but bond1 ignores the different options: alias bond0 bonding options bond0 -o bond0 miimon=100 mode=active-backup primary=eth0 max_bonds=1 alias bond1 bonding options bond1 -o bond1 miimon=100 mode=active-backup primary=eth2 max_bonds=1 I have tried many other combinations as well: install bond1 /sbin/modprobe --ignore-install bonding -o bond1 mode=active-backup primary=eth2 Nothing works. I also came across this note in the bonding docs: "NOTE: It has been observed that some Red Hat supplied kernels are apparently unable to rename modules at load time (the "-o bond1" part). Attempts to pass that option to modprobe will produce an "Operation not permitted" error. This has been reported on some Fedora Core kernels, and has been seen on RHEL 4 as well. On kernels exhibiting this problem, it will be impossible to configure multiple bonds with differing parameters." I have seen that error as well with certain combinations of options in my modprobe.conf. Am I simply out of luck here? Does anyone know of a solution? Thanks.
Hi, could you describe in more detail? --On 4. Juli 2008 13:11:45 -0700 Art Age Software <artagesw at gmail.com> wrote: - snip -> Changing to this eliminates the errors, but bond1 ignores the different > options:What exactly is ignored? The options do not look much different.> > alias bond0 bonding > options bond0 -o bond0 miimon=100 mode=active-backup primary=eth0 > max_bonds=1 alias bond1 bonding > options bond1 -o bond1 miimon=100 mode=active-backup primary=eth2 > max_bonds=1> "NOTE: It has been observed that some Red Hat supplied kernels are > apparently unable to rename modules at load time (the "-o bond1" > part).Did you try without renaming? I do not use it, but it works nonetheless: alias bond0 bonding options bond0 mode=2 alias bond1 bonding options bond1 mode=2 Dirk
>>Hi, >> >>could you describe in more detail? >>What exactly is ignored? The options do not look much different.As I said, I am trying to set a different primary interface for each bond: eth0 for bond0, and eth2 for bond1.>>Did you try without renaming? I do not use it, but it works nonetheless: >>alias bond0 bonding >>options bond0 mode=2 >>alias bond1 bonding >>options bond1 mode=2You are setting identical options for both bonds. This masks the fact that your second options line is ignored and essentially does nothing. Try changing an option on bond1 (eg. set a different mode or a different miimon value), and I think you will see that it is ignored. On Fri, Jul 4, 2008 at 1:11 PM, Art Age Software <artagesw at gmail.com> wrote:> Hi, > > I've using linux bonding in active-backup mode to combine two pairs of > GigE NICs (eth0/eth1, eth2/eth3) into two logical bonds (bond0/bond1). > All is working fine. However, I would like to specify a primary > interface for each bond. This means I need to specify different > options to the bonding module for each bond. I have tried every > conceivable incantation of options and cannot get the kernel to > recognize the second set of options. > > Initially, my modprobe.conf looked like this: > > alias bond0 bonding > alias bond1 bonding > options bonding mode=active-backup miimon=100 max_bonds=2 > > What I am trying to achieve should be possible by changing > modprobe.conf to this: > > alias bond0 bonding > options bond0 -o bond0 miimon=100 mode=active-backup primary=eth0 > alias bond1 bonding > options bond1 -o bond1 miimon=100 mode=active-backup primary=eth2 > > But this results in fatal errors while bringing up the bonding interfaces. > > Changing to this eliminates the errors, but bond1 ignores the different options: > > alias bond0 bonding > options bond0 -o bond0 miimon=100 mode=active-backup primary=eth0 max_bonds=1 > alias bond1 bonding > options bond1 -o bond1 miimon=100 mode=active-backup primary=eth2 max_bonds=1 > > I have tried many other combinations as well: > > install bond1 /sbin/modprobe --ignore-install bonding -o bond1 > mode=active-backup primary=eth2 > > Nothing works. > > I also came across this note in the bonding docs: > > "NOTE: It has been observed that some Red Hat supplied kernels are > apparently unable to rename modules at load time (the "-o bond1" > part). Attempts to pass that option to modprobe will produce an > "Operation not permitted" error. This has been reported on some Fedora > Core kernels, and has been seen on RHEL 4 as well. On kernels > exhibiting this problem, it will be impossible to configure multiple > bonds with differing parameters." > > I have seen that error as well with certain combinations of options in > my modprobe.conf. > > Am I simply out of luck here? Does anyone know of a solution? > > Thanks. >
Hi, I configure bonding interfaces a bit differently. I put only this line into /etc/modprobe.conf : alias bond0 bonding And use this in /etc/sysconfig/network-scripts/ifcfg-bondX : DEVICE=bond0 BOOTPROTO=none IPADDR=192.168.100.1 NETMASK=255.255.0.0 ONBOOT=yes BONDING_OPTS="miimon=100 mode=1 primary=eth0" I've got setup running like this in mode 1 (failover) and in mode 4 (LACP). Unfortunately I don't have any systems with more then 1 bond and I don't have anything spare to set this up. But you can try your setup using this way to configure it, maybe that helps. Regards, Tim -- Tim Verhoeven - tim.verhoeven.be at gmail.com - 0479 / 88 11 83 Hoping the problem magically goes away by ignoring it is the "microsoft approach to programming" and should never be allowed. (Linus Torvalds)
>Very interesting. > >Looking under the hood, it's actually handled by the >/etc/sysconfig/network-scripts/ifup-eth script, which writes the >values to the pseudo-files under /sys/class/net/bondX/bonding/, so >there you go, another way to change that dinamically without having to >restart the interface. Would you be kind to see if you can change the >primary "on-the-fly" using this method? > >Thanks, >FilipeYes, indeed. I have successfully changed both the primary interface and the miimon value **while the interface is up** by directly writing to the /sys/class/net/bondX/bonding/{Key} files. Changing the bonding mode is not allowed while the interface is up (probably a good thing). This is a great improvement over previous incarnations of Red Hat bonding support. I have even successfully configured two bonds on the same machine using different bonding modes for each. VERY useful! Sam