Recent advances in communication technologies, as well as the proliferation of computing devices, are shaping our surroundings towards an ubiquitous Internet. The Internet offers a global platform for low-cost access to a wide range of communication services such as e-mail, e-commerce, tele-education, tele-health and tele-medicine. However, even in developed countries, a large number of rural areas are poorly equipped even with basic communication infrastructure. Nowadays, there are some efforts to address this lack of infrastructure, but they are still insufficient. With this aim we present in this thesis RuralNet, a community wireless network to provide Internet access on a personalised basis to subscribers in rural areas. The objectives of this study were the development of a new architecture to offer a flexible and secure Internet access in remote rural areas. RuralNet combines the paradigm of wireless mesh networks and wireless devices, using cheap off-the-shelf devices and offering a wide range of applications and Internet-based communications services. The solution developed for RuralNet can cover large areas at a low cost, and can also be easily implemented and extended in terms of both coverage and services offered. Since the implementation and testing of RuralNet was expensive and labour intensive, we considered that simulation and emulation were a viable alternative to reduce costs. For this purpose we developed Castadiva, a flexible test bed designed for testing MANETs and mesh networks. Castadiva is a test bed based on low-cost devices, used to test the protocols and applications developed. Through a user friendly interface, Castadiva offers the ability to define and test different scenarios and traffic patterns, adding the ability to export to the ns-2 format, in order to compare the results. Ns-2 is the most widely used simulator in research at an international level. Finally, we have added security features to our proposal. So we made RuralNet safe from "malicious" attacks, thus making it more robust. We therefore analysed the community network security, studying the most common attack in this type of networks, namely the black hole attack. To detect this attack, we have combined the use of the watchdog mechanism, a solution offered in the literature to detect intrusions in wireless networks, and bayesian filtering, a technique for developing robust systems in scenarios with a high noise level.