We present the design and implementation of a working system that enables self-configuration and self-optimization in mobile ad hoc networks (MANETs) by exploiting context awareness and cross-layer design principles, combined with simple network management policies and network programmability. We propose the collaborative management of the MANET through a proactively constructed body of nodes in order to overcome the inherently dynamic nature of MANETs.