This paper develops a network model of interbank lending, in which banks decide to extend credit to their potential borrowers. Borrowers are subject to shocks that may force them to default on their loans. In contrast to much of the previous literature on financial networks, we focus on how anticipation of future defaults may result in ex ante "credit freezes," whereby banks refuse to extend credit to one another. We first characterize the terms of the interbank contracts and the patterns of interbank lending that emerge in equilibrium. We then study how shifts in the distribution of shocks can result in complex credit freezes that travel throughout the network. We use this framework to analyze the effects of various policy interventions on systemic credit freezes. * We are also grateful to Celso Brunetti, Sebastian Infante, Borghan Narajabad, and Carlos Ramirez for helpful suggestions.