Uh. Well. Not really ;) But in case you’re using bonded network interfaces with Linux you may have noticed that they’ll always report a network speed of 10Mbps – no matter what NICs you used to create the bond. Technically this isn’t a real problem for the bond will always work at the full speed supported by the hardware. But it can pose a management problem when you’re using SNMP to monitor your devices.That’s because a common monitoring technique is to set limits after reaching which the system will send off an alert. And it’s easy to imagine that an assumed 10Mbps link will reach a saturation point of, say, 75 percent a lot earlier than, say, the 1Gbps interfaces you’re actually using to create to bond.
Now for the bad news: There’s nothing you can do locally to change the speed reported by the bond (or, to be fair, by the various tools used to determine the link speed of any given interface). The good news is that you can do something to have at least your SNMP daemon report the correct link speed. As long as you’re using net-snmp, that is.The first step is to determine the index number of your bond interface(s). This can be easily done using
snmpwalk -v 2c -c <community> -Os 192.168.0.1 interfaces | more
Just replace <community> with the name of your SNMP community (in general, “public” is a good guess) and the 192.168.0.1 with the IP address of the system you’re monitoring. You should get something like this:
ifDescr.1 = STRING: lo
ifDescr.2 = STRING: eth0
ifDescr.3 = STRING: eth1
ifDescr.4 = STRING: eth2
ifDescr.5 = STRING: eth3
ifDescr.6 = STRING: eth4
ifDescr.7 = STRING: eth5
ifDescr.8 = STRING: bond0
ifDescr.9 = STRING: sit0
As you can see, in this example our bond interface is located at ifDescr.8. Write down the number or try to remember it for a few seconds. Now, on the machine where the bond is running, open the file /etc/snmp/snmpd.conf. Somewhere in that file, insert
override ifSpeed.X uinteger 1000000000
Don’t forget to replace the X with the actual number from the snmpwalk output. And make sure not to type ifDescr but ifSpeed instead. This is telling your SNMP daemon to overwrite the netlink speed as reported by the operating system for interface X with 1.000.000.000 – which translates to 1Gbps.
Now all that’s left to do is to restart your SNMP daemon – and possibly to rebuild the device data for this server in your management application. Ah, and there’s one drawback: In case you ever change the bond or add or remove a NIC to/from that server, the order of the interfaces and thus their numbering will change. So you’ll then have to repeat the steps outlined above.
And one final note: In theory, you should be able to achieve the same result using the line “interface bond* 6 1000000000″ in your snmpd.conf. This would have the benefit of always changing the value for all interfaces named bond… — however, I couldn’t make this work on any machine I’ve been experimenting with. Ymmv.