Network isolation method and device for sharing public IP in edge scenarios

By assigning a unique port range and virtual network card to each isolation environment in the edge computing scenario, and configuring forwarders and forwarding tables, the difficulty of network isolation caused by multiple business programs sharing public network IP is solved, and each isolation environment is realized. Effective differentiation and direct external service capabilities.

CN115361204BActive Publication Date: 2024-09-24PIO CLOUD COMPUTING (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210990817.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2024-09-24
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

In edge computing scenarios, multiple business programs share the public IP address of the same server, making network isolation difficult. Existing technology cannot configure the same public IP address for each isolation environment, resulting in the need to use NAT when accessing services externally. , which limits the ability of business programs to run.

Method used

By creating multiple isolation environments on the physical host, allocating non-overlapping port ranges, creating a virtual network card with the IP address and MAC address of the corresponding physical network card for each isolation environment, and configuring the forwarder and forwarding table, each Effective differentiation of isolated environments and public IP sharing.

Benefits of technology

It enables each isolation environment to directly provide external services, effectively distinguishes different isolation environments, improves network isolation capabilities in edge scenarios, and avoids address inconsistency problems caused by NAT.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115361204B
    Figure CN115361204B
Patent Text Reader

Abstract

The invention discloses a network isolation method for sharing a public network IP in an edge scenario: multiple isolation environments are created on a physical host, port data of the host is obtained, and a non-overlapping port range is allocated to each isolation environment; multiple virtual lines are established between the physical host and each created isolation environment and each physical network card of the physical host, and each virtual line connects a physical network card and a physical host / an isolation environment; a repeater and a forwarding table are created on each physical network card of the physical host, and the forwarding table records the port range and the forwarding rules of each isolation environment; a virtual network card with an IP address and a MAC address of its corresponding physical network card is created for each isolation environment, an isolation repeater and an isolation forwarding table are created on the virtual network card, and the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card; a program is started to start a data transmission service. The local computer and the isolation environment share the public network IP address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network communication technology, and in particular, relates to a network isolation method, device, equipment and storage medium for sharing a public IP in an edge scenario. Background Art

[0002] Edge computing refers to a new computing model that performs computing at the edge of the network. Its data processing mainly includes two parts: one is the downstream cloud service, and the other is the upstream Internet of Everything service. Among them, the "edge" in edge computing is a relative concept, mainly referring to any computing, storage and network-related resources between the data source and the cloud computing center. In edge scenarios, in order to improve resource utilization, multiple business programs are usually run on a server, and these business programs share external communication lines and public network IPs. However, most programs are not designed with this scenario in mind, and are run on the assumption that they occupy the entire server resources. The most typical case is, for example: the business program collects the network card traffic of the machine as its own business traffic, but in fact it collects the traffic of all businesses.

[0003] In the prior art, methods such as using containers and virtual machines to isolate environments use a virtual network card in each isolated environment to effectively isolate the network. However, this method cannot configure the same public IP address for each isolated environment, because traditional routing forwarding can only be based on IP addresses. When multiple identical IP addresses are configured, routing cannot decide to whom the message should be forwarded, and business programs in multiple isolated environments may use the same port for external communication. When the IP and port are the same, it is impossible to distinguish which isolation environment their messages belong to, and only private IP can be configured. That is, the business service runs in an internal network environment. When accessing the business service externally, the Network Address Translation (NAT) method must be used, resulting in different internal and external network addresses. This method has limited methods for providing services to the outside world, and many business programs cannot even run in this environment. Summary of the invention

[0004] To solve the above problems, the purpose of the present invention is to provide a network isolation method, device, equipment and storage medium for sharing public IP in edge scenarios, which can enable each container, virtual machine and other isolated environments under a server host to be configured with the same public IP as the local computer. The local computer and the isolated environment can share the public IP address and directly provide services to the outside world.

[0005] To achieve the above-mentioned purpose, the technical solution of the present invention is: a network isolation method for sharing a public network IP in an edge scenario, comprising: creating multiple isolation environments on a physical host, obtaining the port data of the host, and allocating non-overlapping port ranges to each isolation environment; establishing multiple virtual lines between the physical host and each created isolation environment and each physical network card of the physical host, each virtual line connecting a physical network card and a physical host / an isolation environment; creating a repeater and a forwarding table on each physical network card of the physical host, the forwarding table recording the port range and the forwarding rules of each isolation environment; creating a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolation environment, creating an isolation repeater and an isolation forwarding table on the virtual network card, the isolation forwarding table recording the correspondence between each virtual line and each physical network card; starting a program to start data transmission service.

[0006] In one embodiment of the present invention, after creating the isolation forwarder and the isolation forwarding table on the virtual network card, it also includes: when receiving a port binding request for the isolation environment, determining whether there is already a program using this port; if there is already a program using this port, returning that the port is occupied; if there is no program using this port, determining whether the port is within the port range corresponding to the isolation environment; if the determination result is yes, executing the port binding command.

[0007] In one embodiment of the present invention, after determining whether the port is within the port range corresponding to the isolated environment when no program uses the port, it also includes: if the judgment result is no, determining whether to allow adding a new port forwarding based on preset conditions; if the judgment result is yes, executing a port binding command; if the judgment result is no, returning that the port is occupied.

[0008] In one embodiment of the present invention, the method also includes: obtaining message information and parsing it to obtain proximal port information, proximal IP address, remote port information, and remote IP address; querying the forwarding table based on the remote port information and remote IP address to obtain a forwarding object; forwarding to a corresponding forwarding object based on the remote port information and remote IP address, wherein the forwarding object is an isolated environment corresponding to the remote port information and remote IP address, and then sending it to a program that monitors the target port in the isolated environment.

[0009] In one embodiment of the present invention, after querying the forwarding table based on the remote port information and the remote IP address to obtain the forwarding object, it also includes: determining whether the forwarding object is a physical host, and if the judgment result is yes, not forwarding, and continuing to be processed by the upper layer protocol stack; if the judgment result is no, forwarding to the obtained forwarding object, and then sending it to the program listening to the target port in the isolated environment.

[0010] In one embodiment of the present invention, the method further includes: generating a message in an isolated environment, and sending the message data to a corresponding virtual line based on the proximal port information, proximal IP address, remote port information, remote IP address and virtual forwarding table of the message; and the physical network card corresponding to the virtual line obtains and sends the message.

[0011] In one embodiment of the present invention, the method further includes: the message sent by the program on the physical host environment is not forwarded, but is directly sent out from the physical network card.

[0012] Based on the same concept, the present invention also provides a network isolation device that shares a public network IP in an edge scenario, including: an isolation environment creation module, which is used to create multiple isolation environments on a physical host, obtain the port data of the host, and assign non-overlapping port ranges to each isolation environment; a virtual line creation module, which is used to establish multiple virtual lines between the physical host and each created isolation environment and each physical network card of the physical host, and each virtual line connects a physical network card and a physical host / an isolation environment; a forwarding rule creation module, which is used to create a forwarder and a forwarding table on each physical network card of the physical host, and the forwarding table records the port range and the forwarding rules of each isolation environment; and for creating a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolation environment, creating an isolation forwarder and an isolation forwarding table on the virtual network card, and the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card; an initialization module, which is used to start the program to start the data transmission service.

[0013] Based on the same concept, the present invention also provides a computer device, including: a memory, the memory is used to store a processing program; a processor, when the processor executes the processing program, it implements any one of the network isolation methods for sharing a public IP in an edge scenario.

[0014] Based on the same concept, the present invention also provides a readable storage medium, on which a processing program is stored. When the processing program is executed by a processor, the network isolation method for sharing a public IP in any edge scenario described in any one of the above is implemented.

[0015] After adopting the above technical solution, compared with the prior art, the present invention has the following advantages:

[0016] 1. The present invention divides different port ranges for the local host and different isolated environments, creates a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolated environment, and then configures a repeater and a forwarding table on the physical network card, and configures a virtual repeater and a virtual forwarding table in the isolated environment, thereby achieving the technical effect of sharing the same public IP and being able to effectively distinguish different isolated environments.

[0017] 2. When the present invention determines that the port is not within the port range corresponding to the isolated environment, it further determines whether to allow adding a new port forwarding, and if allowed, performs port binding. This is to achieve the purpose of pre-setting a special port in the isolated environment, adding a whitelist, and checking whether the program transmits message data according to the predetermined port to achieve the purpose of verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings, wherein:

[0019] Figure 1 This is a schematic diagram of the network topology structure of the network isolation method for sharing public network IP in the edge scenario of the present invention;

[0020] Figure 2 This is a flow chart of a network isolation method for sharing a public IP in an edge scenario of the present invention;

[0021] Figure 3 Initialize the system process of the network isolation method for sharing public network IP in the edge scenario of the present invention;

[0022] Figure 4 This is a schematic diagram of the port binding process of the network isolation method for sharing a public network IP in an edge scenario of the present invention;

[0023] Figure 5 A schematic diagram of forwarding inbound messages of a network isolation method for sharing a public IP in an edge scenario of the present invention;

[0024] Figure 6 Schematic diagram of outbound message forwarding in the network isolation method of sharing public network IP in edge scenario of the present invention;

[0025] Figure 7 This is the physical network card forwarding process of the network isolation method for sharing public network IP in the edge scenario of the present invention;

[0026] Figure 8 It is a virtual line forwarding process of a network isolation method for sharing a public network IP in an edge scenario of the present invention;

[0027] Fig. 9 This is a schematic diagram of a network isolation device that shares a public IP in an edge scenario of the present invention;

[0028] Fig.10 Schematic diagram of an embodiment of a computer device of the present invention. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise ratios, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0030] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0031] Embodiment 1

[0032] See also Figure 1 , shows a schematic diagram of the network topology of the network isolation method for sharing public network IP in edge scenarios of the present invention. Figure 2 As shown, it is a flow chart of a network isolation method for sharing a public IP in an edge scenario of the present invention. Specifically: a network isolation method for sharing a public IP in an edge scenario includes:

[0033] S100: creating multiple isolated environments on a physical host, obtaining port data of the host, and allocating non-overlapping port ranges to each isolated environment;

[0034] S200: Establish multiple virtual lines between the physical host and each of the created isolation environments and each physical network card of the physical host, where each virtual line connects a physical network card and a physical host / an isolation environment;

[0035] S300: creating a forwarder and a forwarding table on each physical network card of the physical host, wherein the forwarding table records the port range and the forwarding rules of each isolated environment;

[0036] S400: creating a virtual network card with an IP address and a MAC address of a corresponding physical network card for each isolation environment, creating an isolation forwarder and an isolation forwarding table on the virtual network card, wherein the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card;

[0037] S500: Start the program to start the data transmission service.

[0038] The present invention divides different port ranges for the local host and different isolated environments, creates a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolated environment, configures a repeater and a forwarding table on the physical network card, and configures a virtual repeater and a virtual forwarding table in the isolated environment, thereby achieving the technical effect of sharing the same public IP and being able to effectively distinguish different isolated environments.

[0039] like Figure 3 , shows a flow chart of the initialization system of the network isolation method for sharing public network IP in the edge scenario of the present invention. First, an isolation environment is built on the server host, such as Figure 1 In the process, two isolated environments are constructed, and the server host has ports from 1 to 65535. Ports or port ranges are allocated to isolated environment 1, isolated environment 2, and local programs on the host. Virtual lines are established in isolated environment 1, isolated environment 2, local programs on the host, and physical network card 1 and physical network card 2, respectively, that is, 6 virtual lines are established. A forwarder and a forwarding table are established on physical network card 1 and physical network card 2, and the forwarding table records the matching relationship between the above ports / port ranges and isolated environment 1, isolated environment 2, and local programs on the host. Two virtual network cards are created in isolated environment 1 and isolated environment 2, respectively, that is, isolated environment 1 and isolated environment 2 have virtual network card 1 and virtual network card 2, respectively, the IP address and MAC address of virtual network card 1 are consistent with physical network card 1, and the IP address and MAC address of virtual network card 2 are consistent with physical network card 2. An isolation forwarder and an isolation forwarding table are created on each virtual network card 1 and virtual network card 2, and the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card. After the above steps are completed, the program can be started to start the data transmission service.

[0040] See also Figure 4 , after creating the isolation forwarder and the isolation forwarding table on the virtual network card, the method further includes:

[0041] When receiving a port binding request from an isolated environment, determine whether there is already a program using this port;

[0042] If there is already a program using this port, the returned port is already occupied;

[0043] If no program uses the port, determine whether the port is within the port range corresponding to the isolated environment; if the determination result is yes, execute the port binding command.

[0044] In order to prevent different isolated environments from reusing ports, the system needs to intercept the binding of ports that have been occupied by local programs on the host and isolated environments. If a local host program or an upper-layer application such as an isolated environment makes a request to bind a port, it first determines whether the port requested to be bound is in use. If it is in use, it returns a reminder that the port is occupied. If it is not in use, it continues to determine whether the port belongs to the port range of the upper-layer application. If so, it executes the port binding request.

[0045] Continue to see Figure 4 , after determining whether the port is within the port range corresponding to the isolated environment when no program uses the port, the method further includes:

[0046] If the result of the judgment is no, determine whether to allow adding a new port forwarding;

[0047] If the judgment result is yes, execute the port binding command;

[0048] If the judgment result is negative, the return port is already occupied.

[0049] The reason why here, when it is determined that the port does not belong to the port range of the isolated environment, whether to allow the addition of a new port forwarding is still determined based on the preset conditions is to pre-set special ports in the isolated environment, add whitelists, and check whether the program transmits message data according to the predetermined port to achieve the purpose of verification.

[0050] See also Figure 5 , showing a schematic diagram of forwarding inbound messages of the network isolation method for sharing a public IP in an edge scenario of the present invention. Figure 7 This is the physical network card forwarding process of the network isolation method for sharing public network IP in the edge scenario of the present invention. Specifically:

[0051] Obtain the message information and parse it to obtain the near-end port information, near-end IP address, far-end port information, and far-end IP address;

[0052] Query the forwarding table based on the remote port information and the remote IP address to obtain the forwarding object;

[0053] Based on the remote port information and the remote IP address, it is forwarded to the corresponding forwarding object, wherein the forwarding object is the isolated environment corresponding to the remote port information and the remote IP address, and then sent to the program listening to the target port in the isolated environment.

[0054] Further, it is determined whether the forwarding object is a physical host. If the judgment result is yes, no forwarding is performed and the upper layer protocol stack continues to process; if the judgment result is no, it is forwarded to the obtained forwarding object and then sent to the program listening to the target port in the isolated environment.

[0055] See also Figure 6 , showing a schematic diagram of forwarding outbound messages of the network isolation method for sharing a public IP in an edge scenario of the present invention. Figure 8 This is the virtual line forwarding process of the network isolation method for sharing public network IP in the edge scenario of the present invention. Specifically:

[0056] The isolated environment generates a message, and based on the proximal port information, proximal IP address, remote port information, remote IP address and virtual forwarding table of the message, the message data is sent to the corresponding virtual line;

[0057] The physical network card corresponding to the virtual line obtains and sends the message.

[0058] Furthermore, the messages sent by the programs on the physical host environment are not forwarded but are directly sent out from the physical network card.

[0059] Embodiment 2

[0060] like Fig. 9 As shown, based on the same concept, the present invention also provides a network isolation device 600 for sharing a public network IP in an edge scenario, and the virtual machine service network bandwidth management device 600 under a hyper-converged architecture includes: an isolation environment creation module 610, which is used to create multiple isolation environments on a physical host, obtain the port data of the host, and allocate non-overlapping port ranges to each isolation environment; a virtual line creation module 620, which is used to establish multiple virtual lines between the physical host and each created isolation environment and each physical network card of the physical host, and each virtual line connects a physical network card and a physical host / an isolation environment; a forwarding rule creation module 630, which is used to create a forwarder and a forwarding table on each physical network card of the physical host, and the forwarding table records the port range and the forwarding rules of each isolation environment; and for creating a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolation environment, creating an isolation forwarder and an isolation forwarding table on the virtual network card, and the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card; an initialization module 640, which is used to start the program to start the data transmission service.

[0061] The present invention divides different port ranges for the local host and different isolated environments, creates a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolated environment, configures a repeater and a forwarding table on the physical network card, and configures a virtual repeater and a virtual forwarding table in the isolated environment, thereby achieving the technical effect of sharing the same public IP and being able to effectively distinguish different isolated environments.

[0062] Embodiment 3

[0063] like Fig.10 As shown, based on the same concept, the present invention also provides a computer device 700, which may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 710 (for example, one or more processors) and a memory 720, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 733 or data 732. Among them, the memory 720 and the storage medium 730 can be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 700. Furthermore, the processor 710 can be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the computer device 700.

[0064] The computer device 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input and output interfaces 760, and / or one or more operating systems 731, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.

[0065] Those skilled in the art will understand that Figure 3 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or less components than illustrated, or combine certain components, or arrange components differently.

[0066] When the computer readable instructions are executed by the processor, the processor implements the following steps when executing the computer readable instructions:

[0067] Create multiple isolated environments on the physical host, obtain the port data of the host, and assign non-overlapping port ranges to each isolated environment; establish multiple virtual lines between the physical host and each created isolated environment and each physical network card of the physical host, each virtual line connects a physical network card and the physical host / an isolated environment; create a repeater and a forwarding table on each physical network card of the physical host, the forwarding table records the port range and the forwarding rules of each isolated environment; create a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolated environment, create an isolation repeater and an isolation forwarding table on the virtual network card, the isolation forwarding table records the correspondence between each virtual line and each physical network card; start the program to start the data transmission service.

[0068] In one embodiment of the present invention, after creating the isolation forwarder and the isolation forwarding table on the virtual network card, it also includes: when receiving a port binding request for the isolation environment, determining whether there is already a program using this port; if there is already a program using this port, returning that the port is occupied; if there is no program using this port, determining whether the port is within the port range corresponding to the isolation environment; if the determination result is yes, executing the port binding command.

[0069] In one embodiment of the present invention, after determining whether the port is within the port range corresponding to the isolated environment when no program uses the port, it also includes: if the judgment result is no, determining whether to allow adding a new port forwarding based on preset conditions; if the judgment result is yes, executing a port binding command; if the judgment result is no, returning that the port is occupied.

[0070] In one embodiment of the present invention, the method also includes: obtaining message information and parsing it to obtain proximal port information, proximal IP address, remote port information, and remote IP address; querying the forwarding table based on the remote port information and remote IP address to obtain a forwarding object; forwarding to a corresponding forwarding object based on the remote port information and remote IP address, wherein the forwarding object is an isolated environment corresponding to the remote port information and remote IP address, and then sending it to a program that monitors the target port in the isolated environment.

[0071] In one embodiment of the present invention, after querying the forwarding table based on the remote port information and the remote IP address to obtain the forwarding object, it also includes: determining whether the forwarding object is a physical host, and if the judgment result is yes, not forwarding, and continuing to be processed by the upper layer protocol stack; if the judgment result is no, forwarding to the obtained forwarding object, and then sending it to the program listening to the target port in the isolated environment.

[0072] In one embodiment of the present invention, the method further includes: generating a message in an isolated environment, and sending the message data to a corresponding virtual line based on the proximal port information, proximal IP address, remote port information, remote IP address and virtual forwarding table of the message; and the physical network card corresponding to the virtual line obtains and sends the message.

[0073] In one embodiment of the present invention, the method further includes: the message sent by the program on the physical host environment is not forwarded, but is directly sent out from the physical network card.

[0074] In one embodiment, a computer-readable storage medium is provided, and when the computer-readable instructions are executed by one or more processors, the one or more processors perform the above-mentioned steps, and the specific steps are not repeated here.

[0075] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0076] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0077] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A network isolation method for sharing a public IP in an edge scenario, characterized in that: include: Create multiple isolated environments on the physical host, obtain the port data of the host, and assign non-overlapping port ranges to each isolated environment; Establish multiple virtual lines between the physical host and each of the created isolation environments and each physical network card of the physical host, wherein each virtual line connects a physical network card and a physical host / an isolation environment; Creating a forwarder and a forwarding table on each physical network card of the physical host, wherein the forwarding table records the port range and the forwarding rules of each isolated environment; For each isolated environment, a virtual network card having the IP address and MAC address of the corresponding physical network card is created, and an isolation forwarder and an isolation forwarding table are created on the virtual network card, wherein the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card; The startup program begins the data transfer service.

2. The network isolation method for sharing a public IP in an edge scenario as described in claim 1 is characterized in that: After creating the isolation forwarder and the isolation forwarding table on the virtual network card, the method further includes: When receiving a port binding request from an isolated environment, determine whether there is already a program using this port; If there is already a program using this port, the returned port is already occupied; If no program uses the port, determine whether the port is within the port range corresponding to the isolated environment; if the determination result is yes, execute the port binding command.

3. The network isolation method for sharing a public IP in an edge scenario as described in claim 2 is characterized in that: In the case where no program uses the port, after determining whether the port is within the port range corresponding to the isolated environment, the method further includes: If the result of the judgment is no, judging whether to allow adding a new port forwarding based on the preset conditions; If the judgment result is yes, execute the port binding command; If the judgment result is negative, the return port is already occupied.

4. The network isolation method for sharing a public IP in an edge scenario as described in claim 1 is characterized in that: The method further comprises: Obtain the message information and parse it to obtain the near-end port information, near-end IP address, far-end port information, and far-end IP address; Query the forwarding table based on the remote port information and the remote IP address to obtain the forwarding object; Based on the remote port information and the remote IP address, it is forwarded to the corresponding forwarding object, wherein the forwarding object is the isolated environment corresponding to the remote port information and the remote IP address, and then sent to the program listening to the target port in the isolated environment.

5. The network isolation method for sharing a public IP in an edge scenario as described in claim 4 is characterized in that: After querying the forwarding table based on the remote port information and the remote IP address to obtain the forwarding object, the method further includes: Determine whether the forwarding object is a physical host. If the judgment result is yes, no forwarding is performed and the upper layer protocol stack continues to process; if the judgment result is no, forward it to the obtained forwarding object and then send it to the program listening to the target port in the isolated environment.

6. The network isolation method for sharing a public IP in an edge scenario as claimed in claim 1, characterized in that: The method further comprises: The isolated environment generates a message, and based on the proximal port information, proximal IP address, remote port information, remote IP address and virtual forwarding table of the message, the message data is sent to the corresponding virtual line; The physical network card corresponding to the virtual line obtains and sends the message.

7. The network isolation method for sharing a public IP in an edge scenario as described in claim 6 is characterized in that: The method further includes: the message sent by the program on the physical host environment is not forwarded but directly sent out from the physical network card.

8. A network isolation device for sharing a public IP in an edge scenario, characterized in that: include: An isolation environment creation module is used to create multiple isolation environments on a physical host, obtain the port data of the host, and allocate non-overlapping port ranges to each isolation environment; A virtual line creation module, used to establish multiple virtual lines between the physical host and each of the created isolation environments and each physical network card of the physical host, each virtual line connecting a physical network card and a physical host / an isolation environment; A forwarding rule creation module, used to create a forwarder and a forwarding table on each physical network card of the physical host, the forwarding table records the port range and the forwarding rules of each isolated environment; and used to create a virtual network card with the IP address and MAC address of its corresponding physical network card for each isolated environment, create an isolation forwarder and an isolation forwarding table on the virtual network card, the isolation forwarding table records the corresponding relationship between each virtual line and each physical network card; The initialization module is used to start the program and begin data transmission services.

9. A computer device, characterized in that: include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the network isolation method for sharing a public IP in an edge scenario as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a processing program, and when the processing program is executed by the processor, the network isolation method for sharing a public IP in an edge scenario as described in any one of claims 1 to 7 is implemented.