摘要 |
Disclosed are a method and apparatus for allocating a label to a VPN route, which relate to the technology of network communications. The method comprises: a superstratum provider edge (SPE) device detecting a VPN route from an underlayer provider edge (UPE) device; when detecting the VPN route from the UPE device, the SPE device judging whether there is a routing & forwarding instance (VRF) of a virtual private network that can be imported into the VPN route; and if it is judged that there is a VRF that can be imported into the VPN route, importing the VPN route into the corresponding VRF and using a label of the VRF as an inner-layer label of the VPN route. The present invention can save a large amount of label resources. DRAWING: FIG. 7: S101 An SPE device detecting a VPN route from a UPE device S102 When detecting the VPN route from the UPE device, the SPE device judging whether there is a VRF that can be imported into the VPN route S103 If it is judged that there is a VRF, importing the VPN route to the corresponding VRF and using a label of the VRF as an inner-layer label of the VPN route |