Network device and configuration method thereof

The invention discloses a network device and a configuration method thereof. The configuration method includes that the network device receives a unique device identifier of an upper-layer network device, an interface connection relation between the upper-layer network device and the network device and a configuration file sent from the upper-layer network device, to be specific, the configuration file comprises node identifiers of nodes of a network topology, interface connection relations between each node and others, configuration information corresponding to the nodes and a corresponding relation of the unique device identifier of the upper-layer network device and a first node identifier; according to the unique device identifier of the upper-layer network device, the interface connection relation between the upper-layer network device and the network device and the configuration file, the network device determines a second node identifier and corresponding configuration information, to be specific, a second node corresponds to the network device; the network device configures according to the determined configuration information. According to the embodiment, the problem that the network device is much limited during automatic configuration is solved.