LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Finding out Bonding mode of Interface (https://www.linuxquestions.org/questions/linux-networking-3/finding-out-bonding-mode-of-interface-381049/)

ajeet528 11-08-2005 06:05 AM

Finding out Bonding mode of Interface
 
Hi guys need some help.

Here is short description of the problem:

I have have 8 pysical interfaces in my system which i have configured using netdevice_register fuctions.

I have to bond interfaces 1,2 and 3 to bond0 in round robin mode(ie mode=0). And bond interfaces 4 and 5 to bond1 in active backup mode (ie mode=1).

To do this mode i am supplying the bond mode at the time of bond creation throungh insmod(bonding.c) and creating slaves through enslave module.

However a different module of the project needs to know 1. whether a given interface is bonded or not.
2. if yes then what is the bonding mode.

By checking IFF_SLAVE flag of that net_device structure in interface device driver we can know whether interface is bonded or not.

But i do no know how to find out the bonding mode of the interface ie whether it is in the round-robin mode or active standby mode. I couldnt find out where is the kernel storing bonding mode information.

CAN ANYBODY HELP ME ON THIS.

Early reply would be really appreciated. Thanx in advance

bucketheadmjs 09-11-2008 01:58 PM

These should give you all the information you need (if I understand correctly):
less /proc/net/bond0/info
less /proc/net/bond1/info

bucketheadmjs 09-11-2008 02:01 PM

Sorry didn't see how old this was until after the fact...

mundu 06-08-2015 01:28 PM

It still helps though.

less /proc/net/bonding/bond0

Vernicronz 07-09-2015 02:19 AM

an example from a real server

[root@m132 network-scripts]# cat /sys/class/net/bond0/bonding/mode
802.3ad 4


All times are GMT -5. The time now is 07:53 PM.