Systems and methods are described for restoring IP traffic flows routed in an IP network in less than 100 ms after the IP network sustains a network failure. The systems and methods are a two-phase fast reroute that uses distributed optimized traffic engineering during backup tunnel restoration and end-to-end tunnel restoration that maximizes sharing among all independent failure scenarios and minimizes the total capacity, total cost, or a linear combination of the two. For defined failure condition scenarios, restoration traffic is routed using pre-computed backup tunnels using a constrained shortest path first method where link weights along the path are chosen dynamically and depend on available and total capacity of the link, latency, and other cost measures such as IP port costs. During the capacity allocation phase, the method reuses capacity already allocated for other independent failure scenarios as much as possible but also adds capacity, if necessary. When an actual IP network failure occurs, the backup tunnels are used to immediately restore service to affected IP network traffic flows. In parallel, end-to-end tunnels corresponding to each affected traffic flow are rerouted and once the rerouting process is complete, traffic is switched over from the old end-to-end tunnel routes (using backup tunnels) to new end-to-end tunnel routes without using backup tunnels.