Quantum key distribution (QKD) enables secure key exchanges between two remote users. The ultimate goal of secure communication is to establish a global quantum network. The existing field tests suggest that quantum networks are feasible. To achieve a practical quantum network, we need to overcome several challenges, including realising versatile topologies for large scales, simple network maintenance, extendable configuration, and robustness to node failures. To this end, we present a field operation of a quantum metropolitan-area network with 46 nodes and show that all these challenges can be overcome with cutting-edge quantum technologies. In particular, we realise different topological structures and continuously run the network for 31 months, by employing standard equipment for network maintenance with an extendable configuration. We realise QKD pairing and key management with a sophisticated key control center. In this implementation, the final keys have been used for secure communication such as real-time voice telephone, text messaging, and file transmission with one-time pad encryption, which can support 11 pairs of users to make audio calls simultaneously. Combined with inter-city quantum backbone and ground-satellite links, our metropolitan implementation paves the way toward a global quantum network.