We study the interplay between two channels of interconnectedness in the banking system. The first one is a direct interconnectedness, via a network of interbank loans, banks' loans to other corporate and retail clients, and securities holdings. The second channel is an indirect interconnectedness, via exposures to common asset classes. To this end, we analyze a unique supervisory data set collected by the European Central Bank that covers 26 large banks in the euro area. To assess the impact of contagion, we apply a structural valuation model NEVA (Barucca et al., 2016a), in which common shocks to banks' external assets are reflected in a consistent way in the market value of banks' mutual liabilities through the network of obligations. We identify a strongly non-linear relationship between diversification of exposures, shock size, and losses due to interbank contagion. Moreover, the most systemically important sectors tend to be the households and the financial sectors of larger countries because of their size and position in the financial network. Finally, we provide policy insights into the potential impact of more diversified versus more domestic portfolio allocation strategies on the propagation of contagion, which are relevant to the policy discussion on the European Capital Market Union.