Patent ID: 8432916

Claim:
A method for implementing mirroring, comprising following steps: A. configuring a remote mirroring port on a source router, establishing a corresponding layer two virtual interface for said remote mirroring port, specifying a data stream requiring mirroring and a physical egress port corresponding to said layer two virtual interface for said layer two virtual interface, and the data stream requiring mirroring namely being a mirroring data stream; establishing a layer two virtual interface corresponding to the layer two virtual interface of said source router on a destination router, and specifying a corresponding physical egress port for said layer two virtual interface on said destination router; forming one Virtual Private Wire Service (VPWS) tunnel between the layer two virtual interface on said source router and the layer two virtual interface on said destination router; B. after receiving packet at the remote mirroring port of said source router, filtering out the mirroring data stream from said packet, obtaining mirroring packet according to the mirroring data stream, and sending said mirroring packet from the physical egress port corresponding to the layer two virtual interface on said source router to said destination router; C. after receiving the mirroring packet, said destination router searching the layer two virtual interface on said destination router corresponding to the layer two virtual interface on said source router, and sending the mirroring packet with a label being removed from a physical port corresponding to the layer two virtual interface on said destination router to a monitoring port; when the remote mirroring port is configured on the source router, this method further comprises: configuring a port attribute list for the remote mirroring port of said source router, the port attribute list of the remote mirroring port on said source router including a mirroring flag and an egress interface for mirroring, and said egress interface being the layer two virtual interface on said remote mirroring port of said source router; the physical egress port corresponding to the layer two virtual interface on said source router is included in the port attribute list configured for the layer two virtual interface on said source router when the corresponding layer two virtual interface is established for said remote mirroring port, and the port attribute list of the layer two virtual interface on said source router further includes an Access Control List (ACL) rule number and an ID number of said VPWS tunnel; when the layer two virtual interface corresponding to the layer two virtual interface on the source router is established on the destination router, this method further comprises: establishing a VPWS forwarding list for said VPWS tunnel on said source router, and said VPWS forwarding list including a Virtual Private Network (VPN) ID of said VPWS tunnel, a source MAC, a destination MAC and inner and outer label information of said VPWS tunnel.