Route leakage method and device, and storage medium

By using the three-layer master device mechanism between VRF domains to create kernel interfaces and routing tables, and adding new table entries at the application layer, the problems of cumbersome routing configuration and high resource consumption in the existing technology are solved, and the effect of simplifying configuration and clear rules is achieved.

CN119652819AActive Publication Date: 2025-03-18INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411852196.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-18
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

When the prior art realizes routing leakage between VRF domains, the configuration steps are cumbersome and error-prone, and the use of namespace methods leads to complex routing information consistency management and consumes a large amount of hardware resources.

Method used

The three-layer master device mechanism is adopted to create kernel interfaces and kernel routing tables, and create corresponding interfaces and routing tables at the application layer. After receiving routing leak commands, new table entries are configured in the receiving application layer routing table and update the kernel routing table.

Benefits of technology

It simplifies the configuration steps of routing leakage, reduces the probability of errors, clearly reflects the routing leakage rules, and reduces hardware resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652819A_ABST
    Figure CN119652819A_ABST
Patent Text Reader

Abstract

The invention discloses a route leakage method and device and a storage medium, belongs to the technical field of communication, and is used for solving the technical problems that route leakage configuration steps are tedious and error-prone, route leakage consumes many resources, and leakage rules are not clear. The method comprises the following steps: creating a kernel interface and a kernel routing table based on a three-layer main equipment mechanism; creating an application layer interface corresponding to each kernel interface and an application layer routing table corresponding to each kernel routing table in an application layer; receiving a route leakage command, and determining a leakage target network segment and a leakage party application layer interface according to the route leakage command; a newly-added table item is configured in a receiver application layer routing table; and updating the kernel routing table of the receiver according to the newly added table item. By means of the scheme, on the basis that it is guaranteed that consumed resources are few and leakage rules are clear, the difficulty of routing leakage configuration is greatly reduced, and then the possibility of configuration errors is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a route leakage method, device and storage medium. Background Art

[0002] Virtual routing and forwarding, referred to as VRF, is a network technology used to create multiple logically isolated VRF domains on a single physical device, thereby isolating and managing network traffic. There are currently two main ways to implement VRF, one is to configure policy routing, and the other is to use namespaces (net namespaces). In some cases, the routing information in one VRF domain needs to be shared with another VRF domain. This process is called route leakage.

[0003] There are two main methods of route leakage, corresponding to the two VRF implementations mentioned above. Both methods of route leakage have certain problems, as follows:

[0004] (1) For the method of implementing VRF using policy routing, a physical device has only one routing table, and each VRF domain configures its own policy routing based on the routing table. When routing leakage is required between these VRF domains, the corresponding policy routing rules must be modified. The problem is that as the number of VRF domains increases, the policy routing rules will become more complex, making it cumbersome and error-prone to modify these rules.

[0005] (2) For the method of implementing VRF using namespaces, multiple virtual namespaces are divided inside a physical device, and each namespace corresponds to a VRF domain. In order to achieve route leakage between these VRF domains, the entry data in the routing table of one VRF domain needs to be copied to the routing table of another VRF domain. In this case, there is no obvious difference between the table entries for route leakage and ordinary table entries, and it is difficult to clearly reflect the rules of route leakage from the routing table. At the same time, in order to ensure the consistency of routing information, when the entries in the original routing table are changed or deleted, the VRF domain that receives these route entries also needs to dynamically modify or synchronously delete these entries accordingly, resulting in this implementation method consuming a large amount of hardware resources. Summary of the invention

[0006] The present invention provides a route leakage method, device and storage medium, which are used to solve at least one of the above technical problems.

[0007] The present invention adopts the following technical solutions:

[0008] In a first aspect, the present invention provides a route leakage method, the method comprising: creating a kernel interface and a kernel routing table based on a three-layer master device mechanism; creating an application layer interface corresponding to each kernel interface and an application layer routing table corresponding to each kernel routing table at the application layer; receiving a route leakage command, and determining the leakage destination network segment and the leakage party application layer interface according to the route leakage command; configuring a new table entry in the receiving party's application layer routing table; and updating the receiving party's kernel routing table according to the new table entry.

[0009] In a feasible implementation, updating the receiving kernel routing table according to the newly added table item includes: after the configuration of the newly added table item is completed, retrieving the data of the newly added table item; creating a socket message according to the data of the newly added table item, and sending the socket message to the kernel to update the receiving kernel routing table.

[0010] In a feasible implementation, a socket message is created based on the data of the newly added table item, including: extracting the destination network segment corresponding to the routing information to be leaked and the name of the application layer interface of the leaking party from the data of the newly added table item; determining the name of the kernel interface of the leaking party based on the name of the application layer interface of the leaking party; creating a routing socket message, and setting the destination network segment corresponding to the routing socket message to the destination network segment corresponding to the routing information to be leaked, and the name of the next hop interface corresponding to the routing socket message to the name of the kernel interface of the leaking party.

[0011] In a feasible implementation, a new entry is configured in the receiving application layer routing table, including: detecting whether the network protocol corresponding to the receiving application layer routing table includes a dynamic routing protocol; if so, obtaining the default priority of the route leakage entry, and configuring the priority of the new entry according to the default priority.

[0012] In a feasible implementation, if the network protocol corresponding to the receiving application layer routing table includes a dynamic routing protocol, the receiving kernel routing table is updated according to the newly added table item, specifically including: after the configuration of the newly added table item is completed, taking out the data of the newly added table item; extracting all table items with the same destination network segment as the newly added table item from the receiving application layer routing table, and updating the receiving kernel routing table according to the table item with the highest priority among all the table items.

[0013] In a feasible implementation, creating a kernel interface and a kernel routing table includes: determining the name of the kernel interface and the identifier of the kernel routing table; creating the kernel interface and the kernel routing table using kernel commands according to the name of the kernel interface and the identifier of the kernel routing table, and binding the kernel interface and the kernel routing table; setting the kernel routing table to the highest priority.

[0014] In a feasible implementation, the kernel routing table is set to the highest priority, including: obtaining multiple routing tables corresponding to the kernel interface, and the priorities corresponding to the multiple routing tables; extracting a high-priority routing table with a higher priority than the kernel routing table from the multiple routing tables; and setting the priority of the high-priority routing table to be lower than the priority of the kernel routing table.

[0015] In a feasible implementation, determining the leakage destination network segment and the leakage party application layer interface according to the route leakage command includes: judging whether there is a leakage party application layer interface in the route leakage command; if so, extracting the leakage destination network segment and the leakage party application layer interface from the route leakage command; otherwise, traversing the application layer routing table, finding the leakage party application layer routing table containing the leakage destination network segment, and determining the leakage party application layer interface according to the leakage party application layer routing table.

[0016] In a second aspect, the present invention also provides a route leakage device, which specifically includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute a route leakage method as described in any of the above embodiments.

[0017] In a third aspect, the present invention further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to be able to execute a routing leakage method as in any of the above-mentioned embodiments.

[0018] The present invention provides a method, device and storage medium for route leakage, which have the following beneficial effects:

[0019] 1. Based on the three-layer master device mechanism, create a kernel interface and a kernel routing table. The above kernel interface can be used as the next hop interface in the routing table configuration to provide an interface basis for the subsequent route leakage steps. First modify the application layer routing table, and then update the kernel routing table according to the content of the application layer routing table. This is convenient for users to operate at the application layer, and more flexible and diverse configurations can be made in the application layer routing table. Configure a new table entry in the receiving party's application layer routing table, and set the next hop interface to the leaking party's application layer interface. Compared with modifying the policy routing, this greatly simplifies the configuration steps of route leakage and reduces the possibility of errors made by users when configuring route leakage. Compared with using namespaces, the content in the new table entry used for route leakage is significantly different from that in ordinary table entries. The content in the routing table can clearly reflect the rules of route configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0021] Figure 1 A flowchart of a route leakage method provided by the present invention;

[0022] Figure 2 A schematic diagram of the structure of a route leakage device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0024] The present invention provides a route leakage method, which solves the technical problems that the configuration steps of route leakage are cumbersome and error-prone, and that route leakage consumes a lot of resources and has unclear leakage rules by configuring a new table entry in the application layer routing table of the receiving party and taking the application layer interface of the leaking party as the next hop interface.

[0025] The method of the present invention is described in detail below with reference to the accompanying drawings.

[0026] Figure 1 A flowchart of a route leakage method provided by the present invention, such as Figure 1 As shown, the route leakage method in the present invention at least includes the following execution steps:

[0027] Step 101: Based on the three-layer master device mechanism, create a kernel interface and a kernel routing table.

[0028] Layer 3 master device, also known as Layer 3master device, or L3Mdev for short, is a feature introduced by the Linux kernel to support virtual routing and forwarding (VRF). The L3Mdev mechanism allows for three-layer network isolation in the Linux system, that is, network layer isolation between different VRF domains. The three-layer master device mechanism can be seen as creating a virtual network card, but it only works at the third layer (network layer) and has an independent routing table. The above-mentioned kernel interface refers to the virtual network interface created by calling the kernel, which can also be called a virtual network card. The kernel routing table refers to the routing table created by calling the kernel and is bound to the above-mentioned kernel interface.

[0029] Specifically, first determine the name of the kernel interface and the identifier of the kernel routing table, which are the parameters required to be input when calling the kernel to create the kernel interface and the kernel routing table. After calling the kernel function to create the above kernel interface and the kernel routing table, the kernel will automatically bind the above kernel interface and the kernel routing table.

[0030] Then you need to modify the priority of the kernel routing table and set it to the highest priority. Only by setting it in this way can you ensure that the kernel interface will first query the kernel routing table when it queries the table. The specific steps to modify the priority are: first obtain the multiple routing tables corresponding to the kernel interface and the priority information of the above multiple routing tables, then extract the high-priority routing table with a higher priority than the kernel routing table from the multiple routing tables, and finally set the priority of the above high-priority routing table to be lower than the priority of the kernel routing table. The above steps can ensure that the kernel routing table containing the route leakage table entry is queried first, and then ensure that when the kernel routing table conflicts with other routing tables, the content in the kernel routing table shall prevail.

[0031] In an example, first determine that the name of the kernel interface is vrf_red, and the identifier of the kernel routing table is table_10, then call the kernel function: ip link add vrf_red type vrf table_10; by calling the above kernel function, a kernel interface named vrf_red and a kernel routing table with the identifier table_10 are created in the kernel. After the kernel routing table is created, the kernel automatically assigns a priority to it. After the creation is completed, the routing table corresponding to the above kernel interface is specifically as follows:

[0032] 0:from all lookup local

[0033] 1000:from all lookup[l3mdev-table]

[0034] 32766:from all lookup main

[0035] 32767:from all lookup default

[0036] The leftmost number represents the priority of the routing table. The smaller the number, the higher the priority.

[0037] [l3mdev-table] indicates the above kernel routing table. It can be seen that there is a routing table named local with a higher priority than the above kernel routing table, so the priority of the local routing table needs to be lowered. Here, its priority can be set to 3000. After modification, the routing table corresponding to the kernel interface is as follows:

[0038] 1000:from all lookup[l3mdev-table]

[0039] 3000:from all lookup local

[0040] 32766:from all lookup main

[0041] 32767:from all lookup default

[0042] Step 102: Create application layer interfaces corresponding to each kernel interface and application layer routing tables corresponding to each kernel routing table at the application layer.

[0043] The kernel interface and kernel routing table require root privileges to modify, and can only be modified using the command line or socket, which is not convenient for users. Therefore, it is necessary to create corresponding application layer interfaces and application layer routing tables at the application layer to facilitate users to leak routes. The application layer interface and application layer routing table here can be created in a variety of ways, for example, creating a data structure at the application layer to synchronize the information of the kernel interface. Create a linked list at the application layer to synchronize the information of the kernel routing table, and selectively synchronize the information in the application layer routing table to the kernel routing table.

[0044] Step 103: Receive a route leakage command, and determine the leakage destination network segment and the leakage party application layer interface according to the route leakage command.

[0045] The route leakage command here is a command issued by the user. The command contains the destination network segment that needs to be leaked, which is called the leakage destination network segment. The command may also contain the leakage party application layer interface. The leakage party application layer interface refers to the application layer interface corresponding to the application layer routing table containing the leaked routing information. Specifically, the essence of route leakage is to share the table item data in a routing table with another routing table. Therefore, at the application layer, the routing table that provides the table item data is called the leakage party application layer routing table, and the application layer interface bound to the leakage party application layer routing table is called the leakage party application layer interface. Correspondingly, the routing table that receives the above table item data is called the receiving party application layer routing table, and the interface bound to the receiving party application layer routing table is called the receiving party application layer interface.

[0046] Specifically, first determine whether the above-mentioned route leakage command contains the application layer interface of the leaking party. The route leakage command may contain the name of the leakage target network segment and the application layer interface of the leaking party. In this case, the relevant information can be directly extracted from the route leakage command for subsequent route leakage configuration; the route leakage command may not contain the name of the application layer interface of the leaking party, but contain the name of the physical network interface. In this case, it is necessary to traverse the application layer routing table according to the leakage target network segment and physical network interface information, find the application layer routing table storing the above information and the name of the application layer interface of the leaking party corresponding to the above application layer routing table.

[0047] In one example, a user uses a command line to leak routes. The specific command is: add 20.1.0.0 / 24devvrf_2table 1001. 20.1.0.0 / 24 is the destination network segment of the route leak, vrf_2 is the name of the application layer interface of the leaking party, and table 1001 is the identifier of the application layer routing table of the receiving party. The above command contains the name of the application layer interface of the leaking party, and the relevant data can be directly extracted from the command for subsequent configuration operations of route leakage.

[0048] Step 104: Configure a new entry in the receiving party's application layer routing table.

[0049] Specifically, based on the L3Mdev mechanism, each virtual routing forwarding domain contains a virtual network interface, namely the kernel interface mentioned above. In this case, if you want to leak the routing table items in the application layer routing table of the leaking party to the application layer routing table of the receiving party, you can simply add a new table item in the routing table of the receiving table item, where the network segment is set to the leaked destination network segment, and the next hop interface is set to the leaking party's application layer interface corresponding to the leaking party's application layer routing table.

[0050] After completing the above configuration, when a data packet with the destination network segment being the above-mentioned leaked destination network segment arrives at the kernel interface of the receiver, the kernel routing table of the receiver is queried to find the next-hop interface. Because the application layer routing table of the receiver has added the table entry corresponding to the route leakage and synchronized it to the kernel routing table of the receiver, the name of the next-hop interface is the name of the application layer interface of the leaking party. Because the name of the application layer interface is the same as the name of the kernel interface, it can be determined that the next-hop interface is the kernel interface of the leaking party, and the above-mentioned data packet enters the kernel interface of the leaking party. Afterwards, the kernel routing table of the leaking party is queried to determine the physical network interface of the next hop and complete the data forwarding. Through the above steps, although the table entry containing all the leaked routing information is not directly added to the application layer routing table of the receiver, the data packet with the destination network segment being the above-mentioned leaked destination network segment is successfully forwarded to the kernel interface of the leaking party, and forwarded according to the leaked routing information, in fact completing the route leakage. Through the above-mentioned route leakage method, the receiving party's routing table can clearly reflect the rules of route leakage, and the configuration of route leakage only needs to provide the destination network segment and the name of the corresponding application layer interface of the leakage party, which is very easy to operate, greatly simplifies the steps of route configuration, and reduces the probability of errors in route configuration.

[0051] In one possible implementation, the receiver's application layer routing table may correspond to a dynamic routing protocol, that is, the routing table may automatically learn the next-hop interface of the leaked destination network segment. In this case, different priorities need to be set for the same network segment in order to determine the data source for updating the kernel routing table. Specifically: first, check whether the network protocol corresponding to the receiver's application layer routing table includes a dynamic routing protocol. If so, obtain the default priority of the route leakage table item, and configure the priority of the newly added table item according to the default priority.

[0052] In one example, the network protocol corresponding to the application layer routing table includes a dynamic routing protocol, the default priority of the route leakage table item is 100, and the route leakage table item for 20.1.0.0 / 24 is set to 20.1.0.0 / 24->vrf_2pro=100, where vrf_2 is the name of the application layer interface of the leaking party, and pro=100 indicates that the priority is set to 100. The route table item automatically learned about 20.1.0.0 / 24 in the routing table is 20.1.0.0 / 24->eth_0_1pro=200, where eth_0_1 is the name of the physical network interface, and pro=200 indicates that the priority is set to 200, where a larger priority number indicates a higher priority.

[0053] Step 105: Update the receiving party's kernel routing table according to the newly added entry.

[0054] Specifically, after the configuration of the newly added table entry is completed, the data of the newly added table entry is retrieved, a socket message is created according to the data of the newly added table entry, and the socket message is sent to the kernel to update the receiving kernel routing table.

[0055] Furthermore, the specific steps of creating a socket message according to the data of the newly added table item are as follows: first, extract the destination network segment corresponding to the routing information to be leaked and the name of the application layer interface of the leaking party from the data of the newly added table item. Then, determine the name of the kernel interface of the leaking party according to the name of the application layer interface of the leaking party. Generally speaking, the name of the application layer interface of the leaking party is the same as the name of the kernel interface of the leaking party. If the two are different, the name of the kernel interface of the leaking party can be determined according to the name correspondence table. Create a routing socket message, and set the destination network segment corresponding to the socket message to the destination network segment corresponding to the routing information to be leaked, and the name of the next hop interface corresponding to the routing socket message is the name of the kernel interface of the leaking party.

[0056] In a possible implementation, if the network protocol corresponding to the receiving party's application layer routing table includes a dynamic routing protocol, after the configuration of the newly added table item is completed, the data of the newly added table item is retrieved. Then, all table items with the same destination network segment as the newly added table item are extracted from the receiving party's application layer routing table, and the receiving party's kernel routing table is updated according to the table item with the highest priority among all the table items.

[0057] In an example, the route leakage entry for 20.1.0.0 / 24 is set to 20.1.0.0 / 24->vrf_2pro=100, and the route entry automatically learned about 20.1.0.0 / 24 in the routing table is 20.1.0.0 / 24->eth_0_1pro=200. Therefore, the kernel routing table is updated according to 20.1.0.0 / 24->eth_0_1pro=200. After the update, the corresponding entry in the kernel routing table is: 20.1.0.0 / 24->eth_0_1.

[0058] Based on the same inventive concept, the present invention also provides a route leakage device, whose structure is as follows: Figure 2 shown.

[0059] Figure 2 This is a schematic diagram of the structure of a route leakage device provided by the present invention. Figure 2 As shown, the route leakage device 200 in the present invention specifically includes: at least one processor 201; and a memory 203 that is communicatively connected to the at least one processor (connected via a bus 202); wherein the memory 203 stores instructions that can be executed by the at least one processor 201, so that the at least one processor 201 can execute a route leakage method as described in the above embodiment.

[0060] In one or more possible implementations of the present invention, the aforementioned processor is used to execute, based on the three-layer master device mechanism, to create a kernel interface and a kernel routing table; to create an application layer interface corresponding to each kernel interface and an application layer routing table corresponding to each kernel routing table at the application layer; to receive a routing leakage command, and to determine the leakage destination network segment and the leakage party application layer interface according to the routing leakage command; to configure a new table entry in the receiving party's application layer routing table; and to update the receiving party's kernel routing table according to the new table entry.

[0061] In addition, the present invention also provides a non-volatile computer storage medium storing computer executable instructions, where the computer executable instructions are configured to be able to execute a route leakage method as described in any one of the above embodiments.

[0062] In one or more possible implementations of the present invention, the aforementioned computer executable instructions are configured to execute, based on a three-layer master device mechanism, to create a kernel interface and a kernel routing table; to create an application layer interface corresponding to each kernel interface and an application layer routing table corresponding to each kernel routing table at the application layer; to receive a route leakage command, and to determine the leakage destination network segment and the leakage party application layer interface according to the route leakage command; to configure a new table entry in the receiving party's application layer routing table; and to update the receiving party's kernel routing table according to the new table entry.

[0063] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0064] The system and medium provided by the present invention correspond one-to-one to the method, and therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.

[0065] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0066] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0067] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0068] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0069] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A route leakage method, characterized in that: The method comprises: Based on the three-layer master device mechanism, a kernel interface and a kernel routing table are created, wherein the kernel interface and the kernel routing table correspond one to one; At the application layer, create application layer interfaces corresponding to each kernel interface, and application layer routing tables corresponding to each kernel routing table; Receive a route leakage command, and determine a leakage destination network segment and a leakage party application layer interface according to the route leakage command; Configure a new entry in the application layer routing table of the receiving party, the destination network segment corresponding to the new entry is the leaked destination network segment, and the next hop interface corresponding to the new entry is the application layer interface of the leaking party; The receiving party's kernel routing table is updated according to the newly added table entry.

2. A route leakage method according to claim 1, characterized in that: Updating the receiving party's kernel routing table according to the newly added table entry includes: After the configuration of the newly added table item is completed, retrieving the data of the newly added table item; A socket message is created according to the data of the newly added table entry, and the socket message is sent to the kernel to update the receiving kernel routing table.

3. A route leakage method according to claim 2, characterized in that: Creating a socket message according to the data of the newly added table entry, including: Extracting the destination network segment corresponding to the to-be-leaked routing information and the name of the application layer interface of the leaking party from the data of the newly added table entry; Determine the name of the leaking party's kernel interface according to the name of the leaking party's application layer interface; A routing socket message is created, and the destination network segment corresponding to the routing socket message is set as the destination network segment corresponding to the routing information to be leaked, and the name of the next hop interface corresponding to the routing socket message is the name of the kernel interface of the leaking party.

4. A route leakage method according to claim 1, characterized in that: Configure a new entry in the receiving application layer routing table, including: Detecting whether the network protocol corresponding to the application layer routing table of the receiving party includes a dynamic routing protocol; If so, the default priority of the route leakage entry is obtained, and the priority of the newly added entry is configured according to the default priority.

5. A route leakage method according to claim 4, characterized in that: If the network protocol corresponding to the application layer routing table of the receiving party includes a dynamic routing protocol, updating the kernel routing table of the receiving party according to the newly added table entry specifically includes: After the configuration of the newly added table item is completed, retrieving the data of the newly added table item; All entries having the same destination network segment as the newly added entry are extracted from the receiving party's application layer routing table, and the receiving party's kernel routing table is updated according to the entry with the highest priority among all the entries.

6. A route leakage method according to claim 1, characterized in that: Create kernel interfaces and kernel routing tables, including: determining a name of the kernel interface and an identifier of the kernel routing table; According to the name of the kernel interface and the identifier of the kernel routing table, using a kernel command to create the kernel interface and the kernel routing table, and bind the kernel interface and the kernel routing table; The kernel routing table is set to the highest priority.

7. A route leakage method according to claim 6, characterized in that: Setting the kernel routing table to the highest priority includes: Obtaining multiple routing tables corresponding to the kernel interface and priorities corresponding to the multiple routing tables; Extracting a high-priority routing table from the multiple routing tables, whose priority is higher than that of the kernel routing table; The priority of the high priority routing table is set to be lower than the priority of the kernel routing table.

8. A route leakage method according to claim 1, characterized in that: Determining the leaked destination network segment and the leaked party application layer interface according to the route leak command includes: Determining whether the route leakage command includes an application layer interface of the leakage party; If yes, extracting the leaked destination network segment and the leaking party application layer interface from the route leak command; Otherwise, the application layer routing table is traversed to find out the application layer routing table of the leaking party that includes the leaked destination network segment, and the application layer interface of the leaking party is determined according to the application layer routing table of the leaking party.

9. A route leakage device, characterized in that: The device specifically includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a route leakage method according to any one of claims 1-8.

10. A non-volatile computer storage medium having computer executable instructions stored thereon, characterized in that: The computer executable instructions are configured to execute a route leakage method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Route synchronization method and device, electronic equipment and readable storage medium

    CN113364688A

  • Route leakage real-time monitoring method

    CN114124811A

  • Route leakage optimization method, equipment and medium

    CN116506344A

  • Flow transmission method and device and related equipment

    CN118740714A

  • System and method for transferring packets between kernel modules in different network stacks

    EP3611882A1