Wireless sensor networks continue to attract a lot of attention from academia and industry promoting large-scale deployments in applications related to the Internet of Things (IoT). Unfortunately, a network containing a large number of sensor nodes also leads to difficulty in the configuring process and assignment of identifiers to nodes. Various approaches have been proposed to solve problems of auto-configuration in Wireless sensor networks, however, still, there are some issues remaining related to automatic assign identifiers A cluster-based hierarchical global address allocation scheme is proposed for a wireless sensor network. The proposal uses the IEEE 802.15.4 protocol and aims to reduce the latency of the identifier assignments and reduce the network level processes to be performed at the node. The address allocation process assigns each node a unique global address, which allows the node to have end-to-end connectivity without network-level involvement. The scenario of adding new nodes to the network or nodes that leave it is contemplated. Finally, the proposed scheme is evaluated experimentally, verifying the correct operation of the algorithm proposed in the implemented prototype.