Disclosure of Invention
In order to solve the technical problems, the present disclosure provides a method, an apparatus, and a device for outputting a remote mirror image of a local area network traffic.
The disclosure provides a local area network traffic remote mirror image output method, comprising:
determining a source switch, an intermediate switch and a destination switch in switches interconnected in a local area network; configuring a remote switch image for the source switch and a Trunk port connected with the intermediate switch or the destination switch; configuring a Trunk port connected with the source switch and the destination switch for the intermediate switch; configuring a destination mirror output port for the destination switch, and configuring a Trunk port connected with the intermediate switch or the source switch; and based on mirror image configuration performed on the source switch, the intermediate switch and the destination switch, transmitting the data passing through the source port of the source switch in the local area network to the destination switch through a designated virtual local area network VLAN, and outputting the data at a destination mirror image output port of the destination switch.
Optionally, the configuring a remote switch mirror for the source switch and configuring a Trunk port connected to the intermediate switch or the destination switch includes: configuring a remote switch image for the source switch by selecting a source port, a reflection port and an image VLAN on the source switch; and configuring a Trunk port for the source switch by selecting a port connected to the intermediate switch or the destination switch and configuring a VLAN to a Trunk mode for the selected port.
Optionally, the method includes: for the reflective port on the source switch, turning off a multiple access channel mac address learning function, and turning off a specified plurality of configuration items.
Optionally, the reflective port is an electrical port.
Optionally, the configuring the Trunk port connected to the source switch and the destination switch for the intermediate switch includes: configuring a Trunk port for the intermediate switch by selecting ports connected to the source switch and the destination switch and configuring a mirror VLAN for the selected ports as a Trunk mode on the intermediate switch; the method further comprises the steps of: and closing the mac address learning function of the mirror VLAN on the intermediate switch.
Optionally, the configuring a destination mirror output port for the destination switch includes: and configuring a destination mirror image output port for the source switch by selecting the output port and the mirror image VLAN on the destination switch.
Optionally, the method further comprises: closing a target protocol of the target port on the target switch; and closing a mac address learning function of the destination mirror image output port on the destination switch.
Optionally, the switch is a switch with an embedded flow output module.
The present disclosure also provides a local area network traffic remote mirror output device, including:
the determining module is used for determining a source switch, an intermediate switch and a destination switch in switches interconnected in the local area network;
a first configuration module, configured to configure a remote switch image for the source switch, and configure a Trunk port connected to the intermediate switch or the destination switch;
a second configuration module, configured to configure, for the intermediate switch, a Trunk port connected to the source switch and the destination switch;
a third configuration module, configured to configure a destination mirror output port for the destination switch, and configure a Trunk port connected to the intermediate switch or the source switch;
and the output module is used for enabling the data passing through the source port of the source switch in the local area network to be sent to the destination switch through a designated virtual local area network VLAN based on the mirror configuration carried out on the source switch, the intermediate switch and the destination switch, and outputting the data at the destination mirror output port of the destination switch.
The present disclosure also provides an electronic device including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the embodiment of the disclosure provides a method, a device and equipment for outputting local area network traffic remote mirror images, wherein the method comprises the following steps: determining a source switch, an intermediate switch and a destination switch in switches interconnected in a local area network; mirror configuration is performed on the source switch, the intermediate switch and the destination switch respectively, so that data of a source port of the source switch of the local area network is sent to the destination switch through a designated VLAN, and output is performed on a destination mirror output port of the destination switch, thereby solving the problems that the data of the source switch needs to be acquired, but the source switch port is insufficient, or flow acquisition equipment is connected to other switches.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In the existing industrial control local area network, data of a source switch are acquired in the data acquisition process of a certain switch of the local area network, but the port of the source switch is insufficient, or the flow acquisition equipment is connected to other switches. Based on the above, the embodiment of the disclosure provides a method, a device and equipment for remote mirroring output of local area network traffic, which can perform remote mirroring output of data of a local area network source switch in a more concise and economical manner.
Fig. 1 is a schematic diagram of a method for outputting a remote mirror image of a local area network traffic, which includes the following steps:
step S102, a source switch, an intermediate switch and a destination switch are determined among switches interconnected in a local area network.
In this embodiment, the switch in the local area network is a switch embedded with the flow output module, or the switch embedded with the flow output module forms the local area network; remote output of data of a port related to a certain exchanger of the local area network can be realized through the embedded flow output module. Referring to fig. 2, a plurality of switches in a local area network are interconnected to form a topology. A source switch, at least one intermediate switch, and a destination switch are defined among switches interconnected in a local area network.
Step S104, configuring a remote switch mirror for the source switch, and configuring a Trunk port connected to the intermediate switch or the destination switch.
In this embodiment, referring to fig. 3, a remote switch image is configured for a source switch by selecting a source port, a reflection port, and an image VLAN (Virtual Local Area Network ) at the source switch; wherein the reflection port is an electric port.
The method comprises the steps of configuring a Trunk port for a source switch by selecting a port connected with an intermediate switch or a destination switch and configuring a VLAN as the Trunk mode for the selected port, and allowing mirror VLAN data and normal service data to pass through.
Turning off the mac (Multiple Access Channel ) address learning function for the reflection port on the source switch, and the reflection port turning off a specified plurality of configuration items including: ARP (Address Resolution Protocol ) detection, ACL (Access Control Lists, access control list), DHCP Relay, MSTP (Multi-Service Transport Platform, multi-service delivery platform), DHCP Snooping (DHCP security feature), IP Source Guard (IP Source address protection), and the like.
Step S106, configuring Trunk ports connected to the source switch and the destination switch for the intermediate switch.
In the implementation, referring to fig. 3, at the intermediate switch, by selecting ports connected to the source switch and the destination switch, and configuring the mirror VLAN to the Trunk mode for the selected ports, the Trunk port is configured for the intermediate switch, and the mirror VLAN data and the normal service data are allowed to pass through.
The configuration method of the intermediate switch further comprises the following steps: the mac address learning function of the mirror VLAN on the intermediate switch is turned off.
Step S108, configuring a destination mirror output port for the destination switch, and configuring a Trunk port connected to the intermediate switch or the source switch.
Referring to fig. 3, at a destination switch, a destination mirror output port is configured for a source switch based on a selection of an output port and a mirror VLAN configured as a VLAN for mirror data. The mac address learning function of the destination mirror output port on the destination switch is closed, and the target protocol of the destination mirror output port on the destination switch is closed, where the target protocol is as follows: ACL, IP source guard, etc.
The manner of configuring the Trunk port for the destination switch is: selecting a port connected with a source switch or an intermediate switch, configuring a VLAN to a Trunk mode for the selected port, and configuring the Trunk port for a destination switch based on the port to allow a mirror data VLAN and a normal service data VLAN to pass through.
Step S110, based on the mirror image configuration performed on the source switch, the intermediate switch and the destination switch, the data passing through the source port of the source switch in the local area network is sent to the destination switch through the appointed VLAN, and output is performed at the destination mirror image output port of the destination switch.
In this embodiment, mirror configuration is performed on the source switch, the intermediate switch and the destination switch in steps S104 to S108, so as to form a topology structure as shown in fig. 3, so that the traffic of the source port designated by the source switch is all sent to the destination switch through the VLAN in the topology structure, and is output at the destination mirror output port of the destination switch, thereby realizing the effect of remote mirror output of the traffic of the source switch.
In the technical scheme, a local area network flow remote mirror image output technology is adopted to carry out remote mirror image output of the specified port flow of the industrial control local area network switch, specifically, a source switch, an intermediate switch and a destination switch are determined in switches interconnected in the local area network, mirror image configuration is carried out on three types of switches respectively, so that the flow of the specified port of the source switch is output through the output port of the destination switch, the effect of remote output of the specified port flow of the local area network switch is realized, and the problem of insufficient ports of the local area network switch or data acquisition of data acquisition equipment connected to other switches is effectively solved.
As shown in fig. 4, the embodiment of the disclosure further provides a remote mirror output device for local area network traffic, where the device includes the following modules:
a determining module 402, configured to determine a source switch, an intermediate switch, and a destination switch among switches interconnected in a local area network;
a first configuration module 404, configured to configure a remote switch image for a source switch, and configure a Trunk port connected to an intermediate switch or a destination switch;
a second configuration module 406, configured to configure a Trunk port connected to the source switch and the destination switch for the intermediate switch;
a third configuration module 408, configured to configure a destination mirror output port for a destination switch, and configure a Trunk port connected to an intermediate switch or a source switch;
and the output module 410 is configured to enable the data passing through the source port of the source switch in the local area network to be sent to the destination switch through the designated virtual local area network VLAN based on the mirror configuration performed on the source switch, the intermediate switch and the destination switch, and output the data at the destination mirror output port of the destination switch.
The device provided in this embodiment has the same implementation principle and technical effects as those of the foregoing method embodiment, and for brevity, reference may be made to the corresponding content of the foregoing method embodiment where the device embodiment is not mentioned.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, electronic device 500 includes one or more processors 501 and memory 502.
The processor 501 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities and may control other components in the electronic device 500 to perform desired functions.
Memory 502 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that can be executed by the processor 501 to implement the local area network traffic remote mirroring output method of the embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, and the like may also be stored in the computer-readable storage medium.
In one example, the electronic device 500 may further include: an input device 503 and an output device 504, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
In addition, the input device 503 may also include, for example, a keyboard, a mouse, and the like.
The output device 504 may output various information to the outside, including the determined distance information, direction information, and the like. The output device 504 may include, for example, a display, speakers, a printer, and a communication network and remote output apparatus connected thereto, etc.
Of course, only some of the components of the electronic device 500 that are relevant to the present disclosure are shown in fig. 5 for simplicity, components such as buses, input/output interfaces, etc. are omitted. In addition, the electronic device 500 may include any other suitable components depending on the particular application.
Further, the present embodiment also provides a computer readable storage medium, where the storage medium stores a computer program, where the computer program is configured to execute the above-mentioned local area network traffic remote mirror output method.
The embodiment of the disclosure provides a method, an apparatus, an electronic device, and a computer program product of a medium for remote mirroring of local area network traffic, which includes a computer readable storage medium storing program codes, where the program codes include instructions for executing the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment and will not be described herein.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.