We have two links for a site , both the links are running OSPF , if one of the link keeps flapping the network at site becomes unstable. How do it make the flapping link down automatically
If the link flaps OSPF will run the SPF algorithm afresh to re-calculate the shortest path to all available destinations.
you can change the throttle numbers to make the network more stable
The default timers are below
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
SPF calculations occur at the interval set by the timers throttle spf command. The wait interval indicates the amount of time to wait until the next SPF calculation occurs. just tune those timers to force OSPF recalculate
Tuning OSPF timers is a good idea, but there are methods for shutting down a flapping interface on lower levels. For example, Cisco switches have a feature which puts a port into err-disabled state thus effectively stopping transmission over this interface is it flaps more that 5 times in 10 seconds (http://www.cisco.com/c/en/us/support/docs/lan-switching/spanning-tree-protocol/69980-errdisable-recovery.html)
Moreover you can you can tune the defaults of this feature using info from this post https://supportforums.cisco.com/document/25101/how-configure-errdisable-flap-setting-values-cisco-catalyst-switches-running-cisco
You may use IP Event Dampening to solve your issue. For each flap a so-called penalty is incremented and when the penalty reaches the suppress threshold the interface is being dampened to ensure network stability.
IP Event Dampening is an automatic process that uses timers to make sure an interface is stable before enabling it again.
To get more information on IP Event Dumpening click here