Before revision: We derive a closed form solution for an optimal control of interbank lending subject to terminal probability constraints on the failure of  a bank.
After revision: We derive a closed form solution for an optimal control of interbank lending subject to terminal probability constraints on the failure of banks which are interconnected through a financial network. The derived solution applies to a real banks network by obtaining a bank.