A network mirroring implementation method and system based on Proxmox VE

By creating OVS bridges and port mirrors in Proxmox VE environment, bridging specific network cards, and allowing specific network cards to capture traffic when issuing traffic tables, the problem of capturing all virtual machine network traffic on one network card is solved, and traffic capture is achieved simplify.

CN114640689BActive Publication Date: 2024-11-01SHANDONG CHAOYUE DATA CONTROL ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210329486.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-11-01
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

In the Proxmox VE environment, it is difficult for the prior art to capture network traffic of all virtual machines on a specific network card, such as icmp packets, tcp packets, udp packets, etc.

Method used

By creating an OVS bridge, bridging a specific network card, creating an OVS port mirror, and allowing specific network segments of a specific network card to capture the switch's traffic when issuing a flow table, capturing all virtual machine network card traffic.

Benefits of technology

It realizes capturing network traffic of all virtual machines on a specific network card, simplifying the user's packet capture process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114640689B_ABST
    Figure CN114640689B_ABST
Patent Text Reader

Abstract

The present invention discloses a network mirroring implementation method based on Proxmox VE, the method comprising: creating a first application of an OVS bridge of a physical node; bridging a specific network card on the first application, the specific network card being used to connect a switch; creating an OVS port mirror, the OVS port mirroring being applied to the first application; and allowing a specific network segment of a specific network card to capture the traffic of the switch when sending down a flow table. The present invention also discloses a network mirroring implementation system based on Proxmox VE, a computer and a computer-readable storage medium. Through the scheme of the present invention, it is possible to capture the traffic of all network cards of all virtual machines on a specific network card, that is, to make a mirror image of the network traffic of all virtual machines and then send it down to a specific network card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a network mirroring implementation method, system, computer and readable medium based on Proxmox VE. Background Art

[0002] Proxmox VE (Proxmox Virtual Environment) is an environment that integrates OPENVZ to support KVM applications. Proxmox VE has the function of creating KVM (Kernel-based Virtual Machine) virtual machines, and can add one or more network cards to KVM virtual machines (referred to as virtual machines). These network cards can be bridged to specific bridges of the physical machine node to achieve intercommunication between the virtual machine and the external network. How to capture the traffic (such as icmp packets, tcp packets, udp packets, etc.) of all network cards of all virtual machines on a specific network card of the current physical node is a technical problem to be solved by those skilled in the art. Summary of the invention

[0003] The present invention proposes a network mirroring implementation method, system, computer and computer-readable storage medium based on Proxmox VE, which can capture the traffic of all network cards of all virtual machines on a specific network card.

[0004] Based on the above purpose, one aspect of an embodiment of the present invention provides a network mirroring implementation method based on Proxmox VE, which specifically includes the following steps:

[0005] The first application to create the OVS bridge of the physical node;

[0006] bridge a specific network card on the first application, where the specific network card is used to connect to the switch;

[0007] Create an OVS port mirror, and apply the OVS port mirror to the first application;

[0008] When sending down the flow table, the specific network segment of the specific network card is allowed to capture the traffic of the switch.

[0009] In some embodiments, creating an OVS port mirror includes:

[0010] Create an OVS port mirror and specify the mirror data source and mirror destination in the OVS port mirror;

[0011] Apply OVS port mirroring to the first application.

[0012] In some embodiments, creating an OVS port mirror includes:

[0013] traversing a plurality of bridges on a physical node, the plurality of bridges including a first bridge;

[0014] Creating a first device, wherein one end of the first device is bridged to a first bridge among multiple bridges, and the other end of the first device is bridged to a first application;

[0015] Mirror the network traffic of the switch on the first bridge.

[0016] In some embodiments, before allowing a specific network segment of a specific network card to capture traffic from a switch, the method further includes:

[0017] Add the rules for issuing flow tables;

[0018] The flow table is issued according to the rules for issuing flow tables.

[0019] In some embodiments, sending down the flow table rule includes: all bridges send down the flow table.

[0020] In some embodiments, the first application comprises a netmirror application.

[0021] In another aspect of the embodiment of the present invention, a network mirroring implementation system based on Proxmox VE is provided, the system comprising: a switch, a specific network card and a physical node;

[0022] The physical node includes multiple bridges and a first application; a specific network card is bridged on the first application, and the specific network card is used to connect to a switch; an OVS port mirror is created in the first application; when a flow table is sent down, a specific network segment of the specific network card can capture traffic from the switch.

[0023] In some embodiments, the plurality of bridges include a first bridge and a second bridge, and the system further includes: a first device and a second device;

[0024] One end of the first device is bridged to a first bridge among the multiple bridges, and the other end of the first device is bridged to a first application;

[0025] One end of the second device is bridged to a second bridge among the multiple bridges, and the other end of the second device is bridged to the first application;

[0026] The second device mirrors the network traffic of the switch on the first bridge.

[0027] In another aspect of the embodiment of the present invention, a computer is provided, comprising: a first creating unit, a bridging unit, a second creating unit and a determining unit;

[0028] The first creation unit is configured to create a first application of the OVS bridge of the physical node;

[0029] The bridging unit is configured to bridge a specific network card on the first application, where the specific network card is used to connect to the switch;

[0030] The second creation unit is configured to create an OVS port mirror, and the OVS port mirror is applied to the first application;

[0031] The determination unit configuration is used to allow a specific network segment of a specific network card to capture traffic from the switch when sending a flow table.

[0032] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.

[0033] In the embodiment of the present application, the user can capture the network traffic of all virtual machines on only one specific network card, which simplifies the user's packet capture process. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of a method for implementing network mirroring based on Proxmox VE provided in an embodiment of the present invention;

[0036] Figure 2 A schematic diagram of the structure of a network mirroring implementation system based on Proxmox VE provided by an embodiment of the present invention;

[0037] Figure 3 A schematic diagram of the structure of a computer provided by an embodiment of the present invention;

[0038] Figure 4 Schematic diagram of a computer-readable storage medium provided for embodiments of the present invention. DETAILED DESCRIPTION

[0039] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0040] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0041] The first aspect of the embodiment of the present invention provides an embodiment of a network mirroring implementation method based on Proxmox VE. Figure 1 As shown, it includes:

[0042] S100: Create a first application of the OVS bridge of a physical node.

[0043] The first application may include a netmirror application.

[0044] S101. Bridge a specific network card on a first application, where the specific network card is used to connect to a switch.

[0045] S102: Create an OVS port mirror, and apply the OVS port mirror to the first application.

[0046] In a specific implementation, creating an OVS port mirror may include:

[0047] First, create an OVS port mirror, and specify the mirror data source and mirror destination in the OVS port mirror. Exemplarily, the mirror data source may include traffic from all network cards of all switches, such as icmp packets, tcp packets, udp packets, etc.

[0048] Second, apply OVS port mirroring to the first application.

[0049] In another specific implementation, the OVS port mirror is created, which may be:

[0050] First, traverse multiple bridges on the physical node, where the multiple bridges include a first bridge.

[0051] Second, a first device is created, one end of the first device is bridged to a first bridge among multiple bridges, and the other end of the first device is bridged to a first application.

[0052] That is, there is a second device, which is a mirror image of the first device. One end of the second device is bridged to a second bridge among the multiple bridges, and the other end of the second device is bridged to the first application.

[0053] Third, the network traffic of the switch on the first bridge is mirrored.

[0054] In practical applications, such as Figure 2 As shown, traverse the bridge vmbr on the physical node<n>. Create a pair of veth devices (tap <n>and tapnm <n>), tap one end <n>Bridged on a specific bridge vmbr <n>On the other end, tapnm <n>Bridge to netmirror. Bridge to the vmbr <n>Mirrors the network traffic of the virtual machine network cards on the .

[0055] S103: Add a flow table rule for sending flow tables.

[0056] The rule for sending the flow table may include: all the bridges send the flow table.

[0057] S104. Send the flow table according to the rules for sending the flow table.

[0058] That is to say, the flow table is issued according to the rule that all bridges issue the flow table.

[0059] S105. When sending the flow table, a specific network segment of a specific network card is allowed to capture the traffic of the switch.

[0060] This allows users to capture the network traffic of all virtual machines on only one specific network card, simplifying the user's packet capture process.

[0061] Based on the same inventive concept, according to another aspect of the present invention, Figure 2 As shown, an embodiment of the present invention further provides a network mirroring implementation system based on Proxmox VE, the system 200 may include: a switch 201, a specific network card 202 and a physical node 203;

[0062] The physical node 203 includes multiple bridges 2031 and a first application (netmirror) 2032; a specific network card 202 is bridged on the first application 2032, and the specific network card 202 is used to connect to the switch 201; an OVS port mirror is created in the first application 2032; when the flow table is sent down, the specific network segment of the specific network card 202 can capture the traffic of the switch 201.

[0063] Among them, the traffic of all network cards of all switches (or virtual machines), such as icmp packets, tcp packets, udp packets, etc.

[0064] In some embodiments, the plurality of bridges include a first bridge and a second bridge, and the system further includes: a first device and a second device;

[0065] One end of the first device is bridged to the first bridge among the multiple bridges 2031, and the other end of the first device is bridged to the first application;

[0066] One end of the second device is bridged to the second bridge among the multiple bridges 2031, and the other end of the second device is bridged to the first application;

[0067] The second device mirrors the network traffic of the switch 201 on the first bridge.

[0068] Based on the same inventive concept, according to another aspect of the present invention, Figure 3 As shown, an embodiment of the present invention further provides a computer 300, the computer 300 comprising: a first creating unit 301, a bridging unit 302, a second creating unit 303 and a determining unit 304;

[0069] The first creation unit 301 is configured to create a first application of an OVS bridge of a physical node;

[0070] The bridging unit 302 is configured to bridge a specific network card on the first application, where the specific network card is used to connect to the switch;

[0071] The second creation unit 303 is configured to create an OVS port mirror, and the OVS port mirror is applied to the first application;

[0072] The determination unit configuration 304 is used to allow a specific network segment of a specific network card to capture the traffic of the switch when sending down the flow table.

[0073] Based on the same inventive concept, according to another aspect of the present invention, Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium 30, which stores a computer program 310 for executing the above method when executed by a processor.

[0074] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.

[0075] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0076] It should be understood that, as used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more associated listed items.

[0077] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0078] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a hard disk, or a CD, etc.

[0079] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.< / n> < / n> < / n> < / n> < / n> < / n> < / n>

Claims

1. A network mirroring implementation method based on Proxmox VE, characterized in that: include: The first application to create the OVS bridge of the physical node; Bridging a specific network card on the first application, where the specific network card is used to connect to a switch; Creating an OVS port mirror, wherein the OVS port mirror is applied to the first application; When sending down the flow table, the specific network segment of the specific network card is allowed to capture the traffic of the switch; The step of creating an OVS port mirror includes: traversing a plurality of network bridges on the physical node, the plurality of network bridges including a first network bridge; Creating a first device, wherein one end of the first device is bridged to a first bridge among the multiple bridges, and the other end of the first device is bridged to the first application; There is a second device that is a mirror image of the first device, one end of the second device is bridged to a second bridge among the multiple bridges, and the other end of the second device is bridged to the first application; The network traffic of the switch on the first bridge is mirrored.

2. The method according to claim 1, characterized in that The step of creating an OVS port mirror includes: Create an OVS port mirror, specifying a mirror data source and a mirror destination in the OVS port mirror; Apply the OVS port mirroring to the first application.

3. The method according to claim 1, characterized in that Before allowing the specific network segment of the specific network card to capture traffic from the switch, the method further includes: Add rules for issuing flow tables; The flow table is issued according to the flow table issuing rule.

4. The method according to claim 3, characterized in that The rule for sending down the flow table includes: all the bridges send down the flow table.

5. The method according to claim 1, characterized in that The first application includes a netmirror application.

6. A network mirroring implementation system based on Proxmox VE, characterized in that: include: switches, specific network cards, and physical nodes; The physical node includes a plurality of bridges and a first application; Bridging the specific network card on the first application, where the specific network card is used to connect to the switch; Creating an OVS port mirror in the first application; When sending down the flow table, the specific network segment of the specific network card can capture the traffic of the switch; The plurality of bridges include a first bridge and a second bridge, and the system further includes: a first device and a second device; One end of the first device is bridged to a first bridge among the multiple bridges, and the other end of the first device is bridged to the first application; One end of the second device is bridged to a second bridge among the multiple bridges, and the other end of the second device is bridged to the first application; The second device mirrors the network traffic of the switch on the first bridge.

7. A computer, characterized in that: include: a first creation unit, a bridging unit, a second creation unit, and a determination unit; The first creation unit is configured to create a first application of an OVS bridge of a physical node; The bridging unit is configured to bridge a specific network card on the first application, and the specific network card is used to connect to a switch; The second creation unit is configured to create an OVS port mirror, and the OVS port mirror is applied to the first application; The determining unit is configured to allow the specific network segment of the specific network card to capture the traffic of the switch when issuing the flow table; The step of creating an OVS port mirror includes: traversing a plurality of network bridges on the physical node, the plurality of network bridges including a first network bridge; Creating a first device, wherein one end of the first device is bridged to a first bridge among the multiple bridges, and the other end of the first device is bridged to the first application; There is a second device that is a mirror image of the first device, one end of the second device is bridged to a second bridge among the multiple bridges, and the other end of the second device is bridged to the first application; The network traffic of the switch on the first bridge is mirrored.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps included in the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Virtual network adapter message capturing method and system

    CN107294869A

  • Open vSwitch-based OpenStack cloud platform virtual probe mirroring method

    CN108494657A

  • Method and device for realizing virtual machine traffic mirroring based on tunnel technology

    CN111913782A

  • Virtual Switch Data Control In A Distributed Overlay Network

    US20130034094A1