One of the key features of next-generation mobile networks is the ability to satisfy the requirements coming from different verticals. For satisfying these requirements, 5G networks will need to dynamically reconfigure the deployment of the network functions. However, the current deployments of mobile networks are experiencing difficulties in exhibiting the required flexibility. At the same time, the research on connectivity provisioning in use cases such as after-disaster scenarios or battlefields has converged towards the idea of Network-In-a-Box. This idea revolves around fitting all software and hardware modules needed by a mobile network in a single or a handful of physical devices. A Network-In-a-Box inherently offers a high level of flexibility that makes it capable of providing connectivity services in a wide range of scenarios. Therefore, the Network-In-a-Box concept represents an alternative approach for satisfying the requirements of next-generation mobile networks. In this survey, we analyze the state-of-the-art of Network-In-a-Box solutions proposed by academia and industry in the time frame starting from 1998 up to early 2017. First, we present the main use cases around which the concept has been conceived. Then, we abstract the common features of the Network-In-a-Box implementations, and discuss how different proposals offer these features. We then draw our conclusions and discuss possible future research directions, including steps required to reach an even higher level of flexibility. The aim of our analysis is twofold. On one hand, we provide a comprehensive view of the idea of Network-In-a-Box. On the other hand, through the analysis we present the features that future mobile networks should exhibit to achieve their design goals. In particular, we show how the Network-In-a-Box fosters the transition towards the next-generation mobile networks.