The transition towards fully renewable energy-based power systems will require to increase the number of reserves at the System Operators' (SOs) disposal to provide flexibility on the energy management process. The microgrid's ability of integrating distributed energy resources, loads and energy storage systems (ESS) appears as a powerful flexibility tool. Nevertheless, the associated control problem of microgrids increases with the number of connected devices. A structuration of the distribution grids in networks of microgrids is proposed, focusing on their ability to provide flexibility services. The complexity of the associated optimization algorithm is faced using Distributed Model Predictive Control (MPC). The algorithm is divided in two steps. The first one is applied to the cooperative participation of microgrids in the day-ahead market. The second step covers the interaction with the SO offering flexibility services in exchange for a financial benefit. The financial benefit is optimally shared between the networked microgrids to satisfy the power profile requested by the SO at the lowest cost. As the proposed control algorithm presents both continuous and binary variables, its associated optimization problem is formulated using the Mixed Logic Dynamic (MLD) framework, which results in a Mixed Integer Quadratic Programming problem (MIQP).