LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-22-2015, 03:56 AM   #1
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Bonding problem on Slackware


Hi all!

this is my first post on this forum even if I'm a quite old slackware user... as all we known, Slackware is great and usually it does not cause too much problems

I have a server on which it is installed slackware 13.37 64bit. The server is equipped with 4 ethernet nics (eth0, eth1, eth2, eth3).
My problems started when I decided to set up two different bondings (bond0, bond1) using different bonding mode for each of them. In particular, bond0 (eth0 and eth1) requires mode=1 (active-backup) while bond1 (eth2 and eth3) requires mode=4 (dynamic link aggregation).

My configuration:

I have created the following file (/etc/modprobe.d/bonding.conf):

Code:
alias bond0 bonding
options bond0 -o bond0 mode=1 miimon=100
alias bond1 bonding
options bond1 -o bond1 mode=4 miimon=100
Now if I run "modprobe bond0" (or "modprobe bond1") I got the following error:

Code:
FATAL: Error inserting bonding (/lib/modules/2.6.37.6/kernel/drivers/net/bonding/bonding.ko): Unknown symbol in module, or unknown parameter (see dmesg)
The dmesg reports:

Code:
bonding: Unknown parameter '-o'
So I suppose the bonding module does not like the option -o bond0/1.

As reported in the documentation I have also tried to change the bonding.conf file as:

Code:
alias bond0 bonding
install bond0 /sbin/modprobe --ignore-install bonding -o bond0 mode=1 miimon=100
alias bond1 bonding
install bond1 /sbin/modprobe --ignore-install bonding -o bond1 mode=4 miimon=100
This time both the commands "modprobe bond0" and "modprobe bond1" do not return any error but only the interface bond0 is created under /proc/net/bonding/. No trace of bond1 interface....

I'm quite sure the bonding module itself is working because if I issue the following command:

Code:
modprobe bonding mode=1 miimon=100 max_bounds=2
both bond0 and bond1 interfaces are created under /proc/net/bonding but of course both with the same bonding mode which is not what I would like to have...

Finally I'm also quite sure the problem is not related to the old slackware version. I have made similar tests on slackware 14.1 64bit with similar results...

Thanks in advantage for you help!
 
Old 10-22-2015, 06:55 AM   #2
MDKDIO
Member
 
Registered: Mar 2004
Location: Sweden
Distribution: Slackware 15
Posts: 521

Rep: Reputation: 187Reputation: 187
Hi gda!
And welcome to LQ!!

First I have to admit I've never used bonding, but found some interesting "reports" from a various number of Linux distributions via google.

If you have ipv6 disabled, you might find this in your
/etc/modprobe.d/bonding.conf
file

install ipv6 /bin/true

change to

options ipv6 disable=1

Edit:
If no bonding.conf file found there, check if you have a *blacklist*.conf file there instead, and check if it contains
the above line(s)

Or if it is located in /lib/modprobe.d/*blacklist*.conf

See if that helps...

Last edited by MDKDIO; 10-22-2015 at 07:01 AM. Reason: Edit part...
 
Old 10-22-2015, 12:17 PM   #3
gda
Member
 
Registered: Oct 2015
Posts: 130

Original Poster
Rep: Reputation: 27
Hi!

thanks for the fast reply!

I tried to include the line you suggested in my bonding.conf file but the problem is still there.

I have the feeling the problem is that, for some reason, the bonding module does not accept the option '-o' as it should be (at least according to the official bonding module documentation). As a consequence I have no chance to select the name of the bonding interface to set up with a specific bonding options set.

So according to my understanding either the documentation is wrong or the bonding module I'm using (which is the original slackware one) is somehow broken...
 
Old 10-22-2015, 01:29 PM   #4
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146

Rep: Reputation: 103Reputation: 103
Have You tried this:

Code:
alias bond1 bonding
options bond1 mode=4 miimon=100
Enjoy
 
Old 10-23-2015, 04:30 AM   #5
gda
Member
 
Registered: Oct 2015
Posts: 130

Original Poster
Rep: Reputation: 27
Yes! I tried to remove the '-o' from the module options. In this case if I run the commands:

Code:
modprobe bond0
modprobe bond1
no errors are reported on the screen or in the log files but, on the other side, only the interface "bond0" is brought up under /proc/net/bonding.

Code:
root@galileo:~# ls -l /proc/net/bonding
total 0
r--r--r-- 1 root root 0 Oct 23 09:17 bond0

Code:
root@galileo:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.0 (June 2, 2010)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: None
MII status: down
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
As you can see, everything sounds like the command "modprobe bond1" hasn't been issued!

Really thanks for all your feedback!
 
Old 10-23-2015, 06:00 AM   #6
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146

Rep: Reputation: 103Reputation: 103
Now I have tried with this setup (slackware 14.1, kernel 3.10.32):

Code:
options bonding max_bonds=2
alias bond0 bonding
options bond0 mode=1 miimon=100
alias bond1 bonding
options bond1 mode=4 miimon=100
Now You get two bond devices, but modprobe seems only to use default values?
So the only thing actually needed in modprobe.conf is

Code:
options bonding max_bonds=2 miimon=100
Code:
modprobe bonding

ls  /proc/net/bonding
bond0  bond1
So You need to use the sysfs filesystem to change the configuration.

Code:
echo 1 > /sys/class/net/bond0/bonding/mode
echo 4 > /sys/class/net/bond1/bonding/mode
Code:
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: None
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Code:
cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
bond bond1 has no active aggregator
I have no free interfaces to attach to the bond device
to really test it, but it seems possible to do what You want to do.

Enjoy

Last edited by ml4711; 10-23-2015 at 06:49 AM. Reason: corrected modprobe.conf
 
Old 10-23-2015, 09:29 AM   #7
gda
Member
 
Registered: Oct 2015
Posts: 130

Original Poster
Rep: Reputation: 27
Actually it was not clear to me the bonding parameters could be changed in that way after the bonding interface has been brought up...

Apparently your solution should work but I'm not sure...

To be sure *all* the parameters in both bonding modes are set correctly I have made the following procedure:

1st step:

Code:
modprobe bonding mode=4 lacp_rate=1 downdelay=200 updelay=200 miimon=100
This command brings up the bonding interface bond0 with all the parameters I need for the link aggregation bonding mode.

2nd step:

Now all the settings of the current bond0 interface need be dumped to allow the manual re-set to be preformed later on (4th step). I did that using the following bash command:

Code:
for setting in /sys/class/net/bond0/bonding/*; do echo "echo \"$(/usr/bin/cat $setting)\" > $setting"; done > bond0_settings
This command produced the following "bond0_settings" file:

Code:
echo "" > /sys/class/net/bond0/bonding/active_slave
echo "0" > /sys/class/net/bond0/bonding/ad_actor_key
echo "0" > /sys/class/net/bond0/bonding/ad_aggregator
echo "0" > /sys/class/net/bond0/bonding/ad_num_ports
echo "0" > /sys/class/net/bond0/bonding/ad_partner_key
echo "" > /sys/class/net/bond0/bonding/ad_partner_mac
echo "stable 0" > /sys/class/net/bond0/bonding/ad_select
echo "0" > /sys/class/net/bond0/bonding/all_slaves_active
echo "0" > /sys/class/net/bond0/bonding/arp_interval
echo "" > /sys/class/net/bond0/bonding/arp_ip_target
echo "none 0" > /sys/class/net/bond0/bonding/arp_validate
echo "200" > /sys/class/net/bond0/bonding/downdelay
echo "none 0" > /sys/class/net/bond0/bonding/fail_over_mac
echo "fast 1" > /sys/class/net/bond0/bonding/lacp_rate
echo "down" > /sys/class/net/bond0/bonding/mii_status
echo "100" > /sys/class/net/bond0/bonding/miimon
echo "802.3ad 4" > /sys/class/net/bond0/bonding/mode
echo "1" > /sys/class/net/bond0/bonding/num_grat_arp
echo "1" > /sys/class/net/bond0/bonding/num_unsol_na
echo "" > /sys/class/net/bond0/bonding/primary
echo "always 0" > /sys/class/net/bond0/bonding/primary_reselect
echo "" > /sys/class/net/bond0/bonding/queue_id
echo "1" > /sys/class/net/bond0/bonding/resend_igmp
echo "" > /sys/class/net/bond0/bonding/slaves
echo "200" > /sys/class/net/bond0/bonding/updelay
echo "1" > /sys/class/net/bond0/bonding/use_carrier
echo "layer2 0" > /sys/class/net/bond0/bonding/xmit_hash_policy
3th step:

Code:
rmmod bonding
modprobe bonding mode=1 miimon=100 max_bonds=2
The first command removes the bonding module previously loaded while the second loads it again generating two bonding interfaces with exactly the same bonding parameters (this time active-backup bonding mode).


4th step:

At this point I have two bonding interfaces "bond0" and "bond1" under /proc/net/bonding.
The last step would be to load the previously dumped bond0 settings to the actual bond0 interface to switch from active-backup bonding mode (the actual state in which the interface is) to the link aggregation bonding mode (the state in which I would like to have the interface).
I was expected the command lines in the file "bond0_settings" should make that job nicely. Actually they did it but only partially as some of the command lines above returned "Permission denied" or "Operation not permitted" error.

To my understanding when the bonding module is loaded also all the corresponding bonding parameters are set according to the provided options. It seems also the permissions of some files generated under /sys/class/net/bondX/bonding depend on the bonding mode (the cause of "Permission denied" errors). Moreover, on some other files it is not possible to write (the cause of "Operation not permitted" error) even if they are flagged as writable.

This triggers me to the question: is it enough to change only the "changeable" options to switch from one bonding mode to another?

I have to say that, apparently this procedure seems to work as the two bonding interfaces seem to be set up correctly (I mean just looking at contents of /proc/net/bonding/). Anyway I will make more real and careful connection tests to check if everything is working as expected.

Thanks for the precious help!

P.S.
Just for completeness I would like to add here that the problem with the option '-o' was not related to the bonding module but to the modprobe script. It seems this option is not supported anymore by modprobe (at least the version shipped with slackware distribution).

Last edited by gda; 10-23-2015 at 10:03 AM.
 
Old 10-23-2015, 10:30 AM   #8
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146

Rep: Reputation: 103Reputation: 103
Quote:
I was expected the command lines in the file "bond0_settings" should make that job nicely. Actually they did it but only partially as some of the command lines above returned "Permission denied" or "Operation not permitted" error.
You probably need to remove "mode" from bond0/1_settings, and set the mode before You apply
the script, as You say different options is allowed in different modes, also I would remove
the echo commands with empty values.

I thing it is normal to get "Permission denied" when You try to write to some of these
variables in kernel space, f.ex. if You try write "not allowed" values. And some does
just not accept any writing.

Code:
modinfo bonding
Shows all the parameters You can use when modprobing bonding (21 parameters), so there should
only be first setting the mode, and then no more than 20 echo commands as the most

Quote:
This triggers me to the question: is it enough to change only the "changeable" options to switch from one bonding mode to another?
In /usr/src/linux/Documentation/networking/bonding.txt You find:

"3.4 Configuring Bonding Manually via Sysfs"

So Yes, I think it is enough

Enjoy
 
Old 10-23-2015, 11:34 AM   #9
gda
Member
 
Registered: Oct 2015
Posts: 130

Original Poster
Rep: Reputation: 27
You are absolutely right!

The order of the commands in the above bond0_settings file is important!

The first command of the file has to be the one selecting the bonding mode in a way all other (not editable!) parameters are set accordingly and automatically.

I report below the working bond0_settings file which allowed me to switching from bonding mode=1 to 4 (the 4th step of the procedure above):

Code:
echo "802.3ad 4" > /sys/class/net/bond0/bonding/mode
echo "stable 0" > /sys/class/net/bond0/bonding/ad_select
echo "0" > /sys/class/net/bond0/bonding/all_slaves_active
echo "0" > /sys/class/net/bond0/bonding/arp_interval
echo "none 0" > /sys/class/net/bond0/bonding/arp_validate
echo "none 0" > /sys/class/net/bond0/bonding/fail_over_mac
echo "fast 1" > /sys/class/net/bond0/bonding/lacp_rate
echo "100" > /sys/class/net/bond0/bonding/miimon
echo "1" > /sys/class/net/bond0/bonding/num_grat_arp
echo "1" > /sys/class/net/bond0/bonding/num_unsol_na
echo "always 0" > /sys/class/net/bond0/bonding/primary_reselect
echo "1" > /sys/class/net/bond0/bonding/resend_igmp
echo "200" > /sys/class/net/bond0/bonding/updelay
echo "200" > /sys/class/net/bond0/bonding/downdelay
echo "1" > /sys/class/net/bond0/bonding/use_carrier
echo "layer2 0" > /sys/class/net/bond0/bonding/xmit_hash_policy
Basically I have removed all the empty echo value lines, I have put at the beginning the bonding mode setting and I have shifted the downdelay after the updelay entry.

This probably solved my problem!

Thanks a lot ml4711 to have supported me by so efficiently!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bonding bonding-xor and bonding-alb Chrysalis Linux - Networking 1 10-24-2009 02:14 PM
bonding two interfaces slackware 12.1 pauledwards03 Linux - Networking 3 11-04-2008 11:46 AM
bonding in Slackware and firewall zamri Linux - Networking 2 05-05-2006 04:40 AM
Help with ethernet bonding on Slackware shubb Linux - Networking 0 12-02-2005 03:03 PM
Bonding Interfaces in Slackware 9.1 tim0707 Linux - Networking 2 07-26-2004 03:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration