Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to know if there are any way (under Linux, of course) to declare an interface as down if I got more than X % of packets errors or more than X % of collisions.

Any idea ?

Regards,

share|improve this question
    
Forgot to mention : all those interface are working with the BNX2 driver. –  Henry-Nicolas Tourneur Oct 19 '09 at 9:53

2 Answers 2

No, there is nothing "out of the box" I am aware of. However, you could probably do this with a little custom script run from crontab.

You could e.g. parse the output of ifconfig (or grab values from /proc or /sys), and if threshholds are exceeded, do ifconfig eth0 down or similar.

However, I don't really see this as a good idea. For one thing, pulling the interface out under processes that might be using it will most likely cause problems.

Could you explain why you feel this is necessary? What problem are you trying to solve? A different solution might be more approriate.

share|improve this answer
    
I got some redudancy on those servers (bonding is already used) and redundant firewalling. I just want to disable my NICs in realistic cases and not just if someone cut the cable. The usual test case for starting using a fallback device is to unplug a cable. In the reality, I may have an interface with 70% of errors and I would like to disable it even if it's status is NOT down. I hope my explanation is clear enough :) –  Henry-Nicolas Tourneur Oct 19 '09 at 12:01
    
Please add clarifications to the question (by editing it), that way everyone will see them :-). –  sleske Oct 19 '09 at 14:41

You almost certainly want to use bonding or something; this sorts out high-availability networking for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.