We study the formation of bilateral agreements among rivals. All else equal, the payoff of an agent increases in his own number of partners and decreases in the number of partners of his rivals. We assume that agents are farsighted: they anticipate that their choice of partners may trigger reactions from their rivals. When more cooperation among equals is pro table, and when the payoff of agents in a small clique increases in the size of the clique, a von-Neumann-Morgenstern farsighted stable set exists. The set contains either two-clique networks, or dominant group networks in which only connected agents are active competitors. Network formation may thus endogenously create a barrier to entry. If the sum of payoffs increases when the connections are more unequally distributed among rivals, the efficient networks are either nested split graphs, or have a core-periphery structure. The networks formed by farsighted rivals are not efficient. We show that standard economic models of network formation among rivals satisfy the above properties.