The embodiment of the invention provides a two-layer
data transmission method and device, relates to the technical field of communication networks, and is suitable for various networking scenes such as an enterprise network, a
data center network and an FTTR network. The method comprises the following steps: a first PE device in an L2VPN network receives a two-layer data message through an AC; matching the target message feature of the two-layer data message with a preset ACL table item; if the target message feature is successfully matched with the preset ACL table item, encrypting the two-layer data message, and adding a control word to the two-layer data message to obtain an encrypted message, the control word indicating that the message to which the control word belongs is the encrypted message; and sending the encrypted message to the second PE device in the L2VPN network through the PW. And based on the control word carried by the two-layer data message, the second PE device decrypts the two-layer data message to obtain a decrypted message and sends the decrypted message. According to the scheme, the networking cost of the L2VPN such as the FTTR can be reduced while the
data transmission security in the networking of the L2VPN such as the FTTR is improved.