Access data forwarding methods and related equipment for network access systems
By deploying interconnected access gateway devices on the user-side local area network and establishing encrypted communication tunnels and bridge domain mapping relationships, the problems of high resource costs and poor access flexibility in large-scale concurrent scenarios are solved, achieving lightweight access and an efficient network access experience.
Patent Information
- Application Number
- CN202611080431.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing network access solutions are costly in terms of resources and have poor user access flexibility in large-scale concurrent scenarios. Especially in university teaching and large-scale training, the cloud jump server mode leads to huge resource consumption and the inability to use local professional tools. Fixed access methods are complex and difficult to quickly set up a network.
Deploy interconnection access gateway devices on the user-side local area network, establish encrypted communication tunnels and bridge domain mapping relationships with the main control gateway devices on the range side, and achieve lightweight, plug-and-play access by decapsulating and recapsulating the Layer 2 data frames of user terminals through the terminal encrypted communication tunnel.
It reduces server resource consumption, allows users to perform attack and defense operations directly using local terminals, improves the practical experience and efficiency, and enhances access and deployment flexibility, avoiding complex network environment deployment and routing configuration.
Smart Images

Figure CN123123050A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network range technology, and in particular to access data forwarding methods and related equipment for network access systems. Background Technology
[0002] Cyber ranges serve as crucial infrastructure for cybersecurity attack and defense drills, new technology verification, and talent development. They can simulate large-scale target network nodes and reproduce various realistic internet scenarios through hardware and software resources. In distributed cross-domain applications such as federated cyber ranges, to enable external attackers or trainees to access target resources within the range, related technologies typically employ a cloud-based basis host access mode. This involves users first remotely connecting to a cloud virtual machine, which then redirects them to access the range's internal network. Alternatively, fixed access points can be deployed on the user's network, using traditional VPNs or trunk lines to route user traffic to the range network, supporting multi-task collaboration and secure tunnel isolation.
[0003] However, when faced with concurrent access from large user groups (such as university teaching, competitions, or large-scale training), this access solution suffers from several drawbacks. Firstly, the reliance on cloud-based jump servers necessitates allocating independent virtual machine resources to each concurrent user terminal. This not only leads to enormous server resource consumption but also forces users who could otherwise use their own machines to operate in an unfamiliar cloud environment, unable to utilize familiar local tools, thus reducing the user experience and efficiency of attack and defense practice. Secondly, existing fixed access methods often require complex network environment deployment and routing configuration on the user side, failing to meet the needs for lightweight, plug-and-play rapid networking. This makes deployment extremely difficult when conducting large-scale target range teaching in non-fixed locations (such as temporary classrooms). Therefore, existing network access solutions suffer from high resource costs and poor user-end access flexibility in large-scale concurrent scenarios. Summary of the Invention
[0004] This application provides a method for forwarding access data in a network access system and related equipment, which can reduce resource costs and improve the flexibility of user access in large-scale concurrent scenarios.
[0005] To achieve the above objectives, a first aspect of this application proposes an access data forwarding method for a network access system. The network access system includes an interconnection access gateway device deployed on a user-side local area network (LAN) and a master control gateway device deployed on a test range side. The method is applied to the interconnection access gateway device and includes: In response to the network construction configuration command, a target range encrypted communication tunnel is established from the interconnection access gateway device to the main control gateway device, and the network bridge domain mapping relationship is obtained based on the bridge domain information of the network construction configuration command; In response to a connection request from a user terminal within the user-side local area network, an encrypted communication tunnel between the interconnection access gateway device and the user terminal is established. The terminal receives a first encapsulated message from the user terminal through the encrypted communication tunnel, and decapsulates the first encapsulated message to obtain the original Layer 2 data frame. Based on the bridge domain mapping relationship, the original Layer 2 data frame is encapsulated to obtain a second encapsulated message; The second encapsulated message is sent to the master control gateway device through the encrypted communication tunnel of the test range.
[0006] In some embodiments, both the terminal encrypted communication tunnel and the range encrypted communication tunnel are constructed using a Layer 2 extended protocol and an encrypted tunneling protocol. The process of receiving a first encapsulated message from the user terminal through the terminal encrypted communication tunnel and decapsulating the first encapsulated message to obtain the original Layer 2 data frame includes: The outermost layer of the first encapsulated message is decrypted and its header removed based on the private key of the interconnection access gateway device to obtain the inner layer message, wherein the outermost layer is generated based on the encrypted tunnel protocol; Based on the Layer 2 extended protocol header of the inner message, the first virtual network identifier is obtained; Based on the matching result of the mapping relationship between the first virtual network identifier and the bridge domain, the header of the Layer 2 extended protocol of the inner packet is removed to obtain the original Layer 2 data frame.
[0007] In some embodiments, the encrypted tunnel protocol is the WireGuard protocol, the Layer 2 extended protocol is the VXLAN protocol, and the encapsulation of the original Layer 2 data frame based on the bridge domain mapping relationship to obtain a second encapsulated message includes: Based on the target MAC address of the original Layer 2 data frame, the corresponding outgoing interface is determined in the bridge domain mapping relationship, and the outgoing interface is associated with the target range encrypted communication tunnel. Based on the second virtual network identifier corresponding to the encrypted communication tunnel of the target range, a VXLAN header is added to the original Layer 2 data frame to obtain the inner message to be sent. Based on the WireGuard public key and endpoint IP address of the target range-side gateway device, a WireGuard header is added to the inner message to be sent and encrypted to obtain the second encapsulated message.
[0008] In some embodiments, the network construction configuration command includes user-side configuration parameters and range-side configuration parameters. The step of obtaining the network bridge domain mapping relationship based on the bridge domain information of the network construction configuration command includes: Based on the first VXLAN network identifier indicated in the user-side configuration parameters, a first virtual interface corresponding to the encrypted communication tunnel of the terminal is created, and the first virtual interface is added to the specified bridge domain; Based on the second VXLAN network identifier indicated in the range-side configuration parameters, a second virtual interface corresponding to the encrypted communication tunnel of the range is created, and the second virtual interface is added to the designated bridge domain; Establish a Layer 2 forwarding path between the first virtual interface and the second virtual interface within the specified bridge domain, and obtain the bridge domain mapping relationship based on the Layer 2 forwarding path.
[0009] In some embodiments, receiving the first encapsulated message from the user terminal through the terminal encrypted communication tunnel includes: The Vector Packet Processing (VPP) program takes over the physical network port of the Internet access gateway device. Based on the WireGuard listening port established by the VPP program on the physical network interface, and receiving the first encapsulated message through the terminal encrypted communication tunnel; A handshake signature verification is performed on the first encapsulated message. When the handshake signature verification is successful, it is determined that the first encapsulated message comes from a legitimate user terminal.
[0010] In some embodiments, the method further includes: Receive a third encapsulated message from the target range-side gateway device through the target range encrypted communication tunnel; Based on the private key of the interconnected access gateway device and the protocol configuration of the target range encrypted communication tunnel, the third encapsulated message is decapsulated to obtain a return layer 2 data frame. Based on the destination MAC address of the returned Layer 2 data frame, the corresponding user terminal target address is matched in the bridge domain mapping relationship; Based on the encryption parameters corresponding to the target address of the user terminal, the returned Layer 2 data frame is encapsulated into a fourth encapsulated message adapted to the encrypted communication tunnel of the terminal, and sent to the user terminal through the encrypted communication tunnel of the terminal.
[0011] In some embodiments, establishing a range-encrypted communication tunnel from the interconnection access gateway device to the master control gateway device includes: Create a loopback interface and configure a loopback IP address on the interconnection access gateway device; The target range encrypted communication tunnel is established using the loopback IP address as the tunnel source address.
[0012] To achieve the above objectives, a second aspect of this application provides an access data forwarding device for a network access system. The network access system includes an interconnection access gateway device deployed on a user-side local area network (LAN) and a master control gateway device deployed on a test range side. The device is applied to the interconnection access gateway device and includes: The range tunnel establishment module is used to establish a range encrypted communication tunnel from the interconnected access gateway device to the main control gateway device in response to the network construction configuration command, and to obtain the network bridge domain mapping relationship based on the bridge domain information of the network construction configuration command. The terminal tunnel establishment module is used to establish an encrypted terminal communication tunnel between the interconnection access gateway device and the user terminal in response to a connection request from a user terminal in the user-side local area network. The message receiving module is used to receive a first encapsulated message sent from the user terminal through the terminal encrypted communication tunnel, and to decapsulate the first encapsulated message to obtain the original Layer 2 data frame. The message encapsulation module is used to encapsulate the original Layer 2 data frame based on the bridge domain mapping relationship to obtain a second encapsulated message; The message forwarding module is used to send the second encapsulated message to the main control gateway device through the target range encrypted communication tunnel.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the access data forwarding method of the network access system as described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the access data forwarding method of the network access system described in the first aspect.
[0015] The network access system access data forwarding method and related equipment proposed in this application include an interconnection access gateway device deployed on the user-side local area network and a master control gateway device deployed on the test range side. The method is applied to the interconnection access gateway device and includes: First, in response to a network construction configuration command, establishing a test range encrypted communication tunnel from the interconnection access gateway device to the master control gateway device, and obtaining a bridge domain mapping relationship based on the bridge domain information in the network construction configuration command; then, in response to a connection request from a user terminal in the user-side local area network, establishing a terminal encrypted communication tunnel between the interconnection access gateway device and the user terminal; next, receiving a first encapsulated message from the user terminal through the terminal encrypted communication tunnel, and decapsulating the first encapsulated message to obtain an original Layer 2 data frame; then, encapsulating the original Layer 2 data frame based on the bridge domain mapping relationship to obtain a second encapsulated message; finally, sending the second encapsulated message to the master control gateway device through the test range encrypted communication tunnel. This application embodiment deploys an interconnection access gateway on the user-side local area network. Responding to configuration commands, it establishes a target range encrypted communication tunnel and bridge domain mapping relationship pointing to the target range master control gateway. The original Layer 2 data frames sent by the user terminal are decapsulated via the terminal encrypted communication tunnel, recapsulated based on the mapping relationship, and then transparently transmitted to the master control gateway. This eliminates the reliance on cloud-based jump server virtual machines, eliminating the need to allocate independent computing resources for each concurrent user, significantly reducing server resource consumption. It also allows users to directly utilize local terminals and familiar professional tools for attack and defense operations, greatly improving the practical experience and efficiency. Furthermore, through the automated tunnel establishment and Layer 2 transparent transmission mechanism of the interconnection access gateway, lightweight, plug-and-play access is achieved on the user side. This avoids the complex network environment deployment and routing configuration of traditional fixed access methods, effectively reducing network access resource costs in large-scale concurrent scenarios (such as teaching and competitions) and improving access deployment flexibility.
[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of an online network security range access method provided in an embodiment of this application.
[0018] Figure 2 This is a schematic diagram of a federal network range access method provided in another embodiment of this application.
[0019] Figure 3This is a schematic diagram of a lightweight network access framework for a federal network range, provided in another embodiment of this application.
[0020] Figure 4 This is a flowchart of an access data forwarding method for a network access system provided in another embodiment of this application.
[0021] Figure 5 yes Figure 4 The flowchart for step 401.
[0022] Figure 6 yes Figure 4 Another flowchart for step 401.
[0023] Figure 7 This is a schematic diagram of the pre-deployment topology of a federal network range attacker sub-range provided in another embodiment of this application.
[0024] Figure 8 This is a schematic diagram of a system communication network design provided in another embodiment of this application.
[0025] Figure 9 This is a schematic diagram of a network communication design for a course selection process, provided in another embodiment of this application.
[0026] Figure 10 This is a schematic diagram of a network construction control flow design provided in another embodiment of this application.
[0027] Figure 11 This is a schematic diagram of a network construction data flow design provided in another embodiment of this application.
[0028] Figure 12 yes Figure 4 The flowchart for step 403.
[0029] Figure 13 yes Figure 4 Another flowchart for step 403.
[0030] Figure 14 yes Figure 4 The flowchart for step 404.
[0031] Figure 15 This is a flowchart of the reception process of a third encapsulated message in a federal network range, provided in another embodiment of this application.
[0032] Figure 16 This is a schematic diagram illustrating the configuration of a lightweight network access method for a federal network range, provided in another embodiment of this application.
[0033] Figure 17 This is a schematic diagram of network access for an educational application scenario provided in another embodiment of this application.
[0034] Figure 18 This is a schematic diagram of the structure of the access data forwarding device of the network access system provided in another embodiment of this application.
[0035] Figure 19 This is a schematic diagram of the hardware structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0037] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0039] Cyber ranges serve as crucial infrastructure for cybersecurity attack and defense drills, new technology verification, and talent development. They can simulate large-scale target network nodes and reproduce various realistic internet scenarios through hardware and software resources. In distributed cross-domain applications such as federated cyber ranges, to enable external attackers or trainees to access target resources within the range, related technologies typically employ a cloud-based basis host access mode. This involves users first remotely connecting to a cloud virtual machine, which then redirects them to access the range's internal network. Alternatively, fixed access points can be deployed on the user's network, using traditional VPNs or trunk lines to route user traffic to the range network, supporting multi-task collaboration and secure tunnel isolation.
[0040] Reference Figure 1 This is a schematic diagram illustrating an online network security test range access method provided in an embodiment of this application. For example... Figure 1 As shown, when an "attacker" (i.e., the user) located on an external network accesses resources within the target range, they first need to remotely connect to an intermediate "virtual machine (jump server)" via the "Internet." Subsequently, traffic is relayed through this jump server to access specific "target 1," "target 2," and "target 3" (e.g., ...) within the target range's internal network. Figure 1The nodes shown have IP addresses of 192.168.1.20, 192.168.1.21, and 192.168.1.22. In this case, the user must rely on a virtual machine environment allocated by the cloud to operate.
[0041] Reference Figure 2 This is a schematic diagram illustrating a federal network range access method provided in an embodiment of this application. For example... Figure 2 As shown, when an "attacker" located on the user side requests access to the network range, they do not directly access the network range in the cloud, but first connect to a locally deployed "fixed host (fixed location)" (such as...). Figure 2 The IP address shown is 192.168.1.1); this fixed host is physically connected to the "interconnection access gateway device (attacker)" on the user side via a TRUNK line. This gateway device then establishes an encrypted communication tunnel based on VXLAN over WireGuard with the remote "interconnection access gateway device (i.e., the main target range)" and "interconnection access gateway device (target provider)" via the "Internet," ultimately enabling cross-domain traffic pass-through and access to "target 1," "target 2," and "target 3" (e.g., ...) within the target range. Figure 2 The IP addresses shown are 192.168.1.20, 192.168.1.21, and 192.168.1.22, respectively.
[0042] This type of access solution faces several challenges when dealing with large-scale user groups (such as online cybersecurity test ranges in universities, competitions, or large-scale training). Firstly, the reliance on cloud-based jump servers necessitates allocating independent virtual machine resources to each concurrent user terminal. This not only consumes enormous server resources but also forces users who could otherwise use their own machines to operate in an unfamiliar cloud environment, hindering their ability to utilize familiar local tools and reducing the experience and efficiency of practical attack and defense exercises. Secondly, existing fixed access methods often require complex network environment deployment and routing configuration on the user side, failing to meet the needs for lightweight, plug-and-play rapid networking. This makes deployment extremely difficult in non-fixed locations (such as temporary classrooms) for large-scale test range teaching. Therefore, existing network access solutions suffer from high resource costs and poor user-end access flexibility in large-scale concurrent scenarios.
[0043] To improve the texture naturalness of the generated 3D model texture data, this application embodiment deploys an interconnection access gateway on the user-side local area network. Responding to configuration commands, it establishes a target range encrypted communication tunnel and bridge domain mapping relationship pointing to the target range-side master control gateway. The original Layer 2 data frames sent by the user terminal are decapsulated via the terminal encrypted communication tunnel, recapsulated based on the mapping relationship, and then transparently transmitted to the master control gateway. This eliminates the dependence on cloud-based jump server virtual machines, eliminating the need to allocate independent computing resources for each concurrent user, significantly reducing server resource consumption. It also allows users to directly utilize local terminals and familiar professional tools for attack and defense operations, greatly improving the practical experience and efficiency. Furthermore, through the automated tunnel establishment and Layer 2 transparent transmission mechanism of the interconnection access gateway, lightweight, plug-and-play access on the user side is achieved, avoiding the complex network environment deployment and routing configuration of traditional fixed access methods. This effectively reduces network access resource costs in large-scale concurrent scenarios (such as teaching and competitions) and improves access deployment flexibility.
[0044] Reference Figure 3 This is a schematic diagram of a lightweight network access framework for a federal network range provided in an embodiment of this application. Figure 3 As shown, the lightweight network access framework corresponding to the network access system includes interconnection access gateway devices deployed on the user-side local area network and master control gateway devices deployed on the target range side. The lightweight network access framework provided in this application adopts a single-level Hub-Spoke (star) network topology, logically divided into two roles: attacker (user side) and target (resource side). Among them, the "master control target range" and its "interconnection access gateway device cluster" serve as the central hub, responsible for connecting and scheduling various distributed "sub-target ranges" (such as sub-target ranges S1, S2, and S3) and dispersed "attacker groups" via the Internet.
[0045] On the attacker's access side (e.g.) Figure 2 (As shown in the lower left and lower right corners of the image, representing attacker groups), this application abandons the traditional cloud-based jump server model and adopts a two-level VXLAN over WireGuard encrypted communication tunnel access method. Specifically, interconnection access gateway devices (such as gateway devices S1 and S2) are deployed within the user's local area network (LAN) to act as access access points (APs). Attackers use "self-owned machines" (i.e., local terminals) to directly access their local LAN, obtain a dynamic access IP through automated configuration, and first establish a first-level encrypted communication with the local interconnection access gateway device. Subsequently, the local interconnection access gateway device establishes a second-level encrypted communication tunnel with the gateway device cluster at the main control range via the Internet. This mechanism enables attackers to achieve seamless access and isolated access from the local LAN to the federated network range.
[0046] On the target resource side, the framework of this application supports the flexible distribution of target resources across the main target range or sub-target ranges. If the target is located in the main target range (e.g., Figure 3 The target in the upper middle (192.168.1.30 / 31) will directly connect to the interconnection access gateway device cluster via TRUNK mode; if the target is located in a sub-range (e.g., Figure 3 The sub-range S3 in the lower middle section connects to the main control network through the interconnection access gateway device (such as gateway device S3) deployed in the sub-range, using TRUNK combined with VXLAN over WireGuard tunnel.
[0047] The above architecture constructs a large-scale Layer 2 interconnection network environment that spans physical regions. For example... Figure 3 As shown by the dashed path (e.g., "Logical Access Path of University 1"), the traffic sent by the attacker can be encapsulated by the local gateway, transparently transmitted to the main control gateway cluster via the Internet, and then routed to the target (192.168.1.20 / 21) within the target sub-field (e.g., sub-field S3). This enables large-scale attack groups to collaboratively access cross-domain target resources and conduct high-concurrency operations.
[0048] Based on the above architectural concept, the access data forwarding method and related equipment of the network access system provided in the embodiments of this application will be further described below. The access data forwarding method of the network access system provided in the embodiments of this application can be applied to interconnection access gateway devices deployed in user-side local area networks.
[0049] Reference Figure 4 This is an optional flowchart of the access data forwarding method of the network access system provided in the embodiments of this application. Figure 4 The method may include, but is not limited to, steps 401 to 405. It is also understood that this embodiment... Figure 4 The order of steps 401 to 405 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0050] Step 401: In response to the network construction configuration command, establish a range encrypted communication tunnel from the interconnection access gateway device to the master control gateway device, and obtain the network bridge domain mapping relationship based on the bridge domain information in the network construction configuration command.
[0051] Step 401 will be described in detail below.
[0052] In some embodiments, upon responding to a network construction configuration command, a range-encrypted communication tunnel is first established between the interconnected access gateway device located on the user-side LAN and the master control gateway device located on the range side. Based on the bridge domain information in the network construction configuration command, a bridge-network mapping relationship is obtained. Specifically, this step occurs during system initialization or network reorganization. The network construction configuration command is typically issued by a cloud management platform and aims to define the network topology of the current access scenario. The interconnected access gateway device, as an edge node deployed on the user side, actively initiates a connection according to the command, establishing a secure transmission channel—the range-encrypted communication tunnel—with the master control gateway device deployed on the resource side (i.e., the range side). This tunnel ensures the confidentiality of cross-public network data through encryption protocols (such as WireGuard combined with VxLAN). Simultaneously, the device parses the bridge domain information carried in the command. This information defines the correspondence rules between Virtual Network Identifiers (VNIs) and physical interfaces or logical ports, thereby generating a bridge-network mapping relationship locally to guide subsequent traffic forwarding, laying the foundation for cross-domain Layer 2 interoperability.
[0053] The following describes how to establish an encrypted communication tunnel for this test range.
[0054] Reference Figure 5 Establishing a range-encrypted communication tunnel from the interconnection access gateway device to the main control gateway device includes the following steps 501 to 502.
[0055] Step 501: Create a loopback interface and configure the loopback IP address on the interconnection access gateway device.
[0056] Step 502: Establish a target range encrypted communication tunnel using the loopback IP address as the tunnel source address.
[0057] Steps 501 to 502 are described in detail below.
[0058] In some embodiments, firstly, a loopback interface is created on the interconnect access gateway device and a loopback IP address is configured. This step involves logical-level configuration of the network device. The interconnect access gateway device creates a virtual logical interface, namely the loopback interface, through software definition. Unlike the physical interface, this interface is a purely software-based virtual interface, and its physical state does not depend on any specific hardware port, thus exhibiting extremely high stability. Typically, as long as the device itself is running, this interface remains active. Based on this, a unique network layer address, namely the loopback IP address, is assigned to this virtual interface. This address will serve as a stable identifier for the gateway device in the overlay network during subsequent network communications, remaining unchanged regardless of fluctuations in the physical topology.
[0059] Then, using the loopback IP address as the tunnel source address, a target range encrypted communication tunnel is established. In this step, when the interconnection access gateway device initiates a tunnel connection request with the main control gateway device, it explicitly specifies the configured loopback IP address as the source address for the encapsulated packets, instead of using the IP address of the device's physical egress network interface card. Based on this source address configuration, the gateway device executes a handshake process using an encryption protocol (such as WireGuard or IPsec), completes authentication and key negotiation with the peer, and thus formally establishes the target range encrypted communication tunnel carrying service traffic. This means that the logical endpoint of the tunnel is anchored to a stable virtual interface, achieving decoupling between the tunnel's logical topology and the underlying physical transmission path.
[0060] Through steps 501 and 502 above, by leveraging the "never-downtime" characteristic of the Loopback interface, the stability of the encrypted communication tunnel in the test range is ensured to be unaffected by a single physical link failure or change in the physical interface state. Even if the physical uplink of the interconnection access gateway device switches (e.g., from the primary line to the backup line), as long as the underlying network routing is reachable, the tunnel connection anchored by the loopback IP address will remain uninterrupted. This design greatly improves the robustness and reliability of the network access system, effectively avoiding test range connection drops caused by physical network fluctuations, and ensuring the continuity of attack and defense exercises.
[0061] The following section will further describe how to obtain the bridge domain mapping relationship of this network.
[0062] Reference Figure 6 The network construction configuration command includes user-side configuration parameters and range-side configuration parameters. Based on the bridge domain information of the network construction configuration command, the network bridge domain mapping relationship is obtained, including the following steps 601 to 603.
[0063] Step 601: Based on the first VXLAN network identifier indicated in the user-side configuration parameters, create a first virtual interface corresponding to the terminal encrypted communication tunnel, and add the first virtual interface to the specified bridge domain.
[0064] Step 602: Based on the second VXLAN network identifier indicated in the range-side configuration parameters, create a second virtual interface corresponding to the range encrypted communication tunnel, and add the second virtual interface to the specified bridge domain.
[0065] Step 603: Establish a Layer 2 forwarding path between the first virtual interface and the second virtual interface within the specified bridge domain, and obtain the bridge domain mapping relationship based on the Layer 2 forwarding path.
[0066] Steps 601 to 603 are described in detail below.
[0067] In some embodiments, a first virtual interface corresponding to the terminal encrypted communication tunnel is created based on the first VXLAN network identifier indicated in the user-side configuration parameters, and the first virtual interface is added to a designated bridge domain. In this step, the interconnection access gateway device first parses the received configuration instructions and extracts the user-side configuration parameters for the user access side. The first VXLAN network identifier (VNI) included in these parameters is a unique logical ID used to distinguish different user tenants or service flows. Then, a logical interface, namely the first virtual interface (typically manifested as a logical sub-interface of a VTEP endpoint), is instantiated based on this first VXLAN network identifier. This interface is specifically responsible for handling user-side tunnel traffic with a specific VNI tag. Subsequently, the first virtual interface is bound to a logical Layer 2 switching space, namely the designated bridge domain. The designated bridge domain is logically equivalent to a virtual Layer 2 switch, used internally to isolate and forward Layer 2 data frames between different interfaces, ensuring that communication can only occur between interfaces added to this domain.
[0068] Then, based on the second VXLAN network identifier indicated in the range-side configuration parameters, a second virtual interface corresponding to the range's encrypted communication tunnel is created, and the second virtual interface is added to the designated bridge domain. Similar to the previous step, this step focuses on the configuration of the range's backbone side. The second VXLAN network identifier used to identify the range-side service plane is extracted according to the range-side configuration parameters. Then, using this second VXLAN network identifier, the device creates a second virtual interface facing the backbone network. This interface is responsible for encapsulating or decapsulating traffic to the main control gateway device. This second virtual interface is then added to the same designated bridge domain as in the previous step. This operation logically "plugs" the user-facing access-side interface and the range-facing backbone-side interface onto the same virtual switch, constructing the necessary logical topology for subsequent Layer 2 pass-through of cross-domain traffic.
[0069] Finally, a Layer 2 forwarding path is established between the first and second virtual interfaces within the designated bridge domain, and the bridge domain mapping relationship is obtained based on the Layer 2 forwarding path. In this step, since the two virtual interfaces are already in the same broadcast domain, the device establishes a logical connection between them, namely the Layer 2 forwarding path. This means that raw Ethernet frames entering from the first virtual interface can be transparently forwarded to the second virtual interface according to the MAC address table or flooding mechanism, and vice versa. This interface binding and forwarding rule constitutes the bridge domain mapping relationship. This relationship essentially defines how traffic is "seamlessly spliced" from a specific tunnel on the user side to a specific tunnel on the test range side, realizing bridging between two independent VXLAN segments.
[0070] Through steps 601 to 603 above, a flexible "softswitch" logic is constructed within the interconnection access gateway device using a "dual-interface binding" mechanism based on the bridge domain. This successfully decouples and reassembles the user-side access tunnel (first VXLAN) from the target range-side backbone tunnel (second VXLAN). This design not only achieves Layer 2 interoperability between heterogeneous network identifiers (different VNIs), but also ensures strict data isolation between different tenants or attack exercise tasks through the isolation characteristics of the bridge domain, greatly improving the networking flexibility and security of the network range in large-scale multi-tenant scenarios.
[0071] Reference Figure 7 This is a schematic diagram of a pre-deployment topology for an attacker's sub-range in a federal network range, provided in an embodiment of this application. For example... Figure 7 As shown, the local area network environment uses an "interconnection access gateway device" as the access core. This device is configured with three different network interfaces to adapt to the complex field environment: its WAN port is connected to the "Internet" to maintain public network communication with the main control target range; its LAN port (configured IP address 192.168.10.3) is connected to the local area network and is directly connected to the attacker's self-owned terminal "Machine A" (configured IP address 192.168.10.2), thereby realizing three-layer interconnection between the gateway and the user terminal in the 192.168.10.x network segment, providing the basic physical link for subsequent traffic capture and tunnel encapsulation.
[0072] also, Figure 7 The invention details the dual network access modes of the "Teaching Service System." The system is configured with two independent IP addresses to simultaneously meet management and business needs: on one hand, it accesses the local area network via IP address 192.168.10.1, maintaining Layer 3 communication with the attacker's "machine A"; on the other hand, it uses IP address 192.168.30.1 in "TRUNK mode" to physically connect to the TRUNK interface of the interconnection access gateway device, achieving Layer 2 communication with the gateway device. This architecture design demonstrates that the invention only requires simple pre-deployment of the interconnection access gateway device to establish a communication link between the attacker, the teaching system, and the cloud-based test range platform without disrupting the original sub-range LAN architecture.
[0073] Reference Figure 8 This is a schematic diagram of a system communication network design provided in an embodiment of this application. Figure 8The diagram illustrates a process for establishing a cross-domain communication path between a teaching service system and a target range service platform in an educational application scenario. This network architecture aims to break down physical geographical limitations, enabling the teaching service system (IP address 192.168.30.1) deployed in the "sub-target range (attacker) LAN" and the federal target range service platform (IP address 192.168.30.2) deployed in the "main control range" to be on the same logical network segment, achieving large-scale Layer 2 interconnection across the public network. This process primarily relies on the "interconnection access gateway device S1" and "interconnection access gateway device M1" deployed on both sides, achieved by establishing a VxLAN over WireGuard encrypted communication tunnel.
[0074] The specific network construction and configuration process begins with the initialization and configuration of the interconnection access gateway device S1. First, the VPP (Vector Packet Processing) program takes over the device's physical layer WAN port (identified as vpp1) and TRUNK port (identified as vpp2). Next, basic network configuration is performed on the WAN port, including setting IP addresses, link status, MTU values, and static routes to ensure public network connectivity. Then, the core tunnel construction phase begins: First, a WireGuard virtual interface is created and configured with the listening port, public / private key pair, peer information, and connection keep-alive duration to establish a low-level encrypted channel; second, VLAN sub-interfaces (such as...) are configured for the TRUNK port. Figure 8 The steps are as follows: First, set the Tag ID for VLAN 10 and add it to the specified bridge domain to access the local teaching service system. Second, create a Loopback sub-interface and configure its MAC and IP addresses as a stable tunnel source endpoint. Third, create a VxLAN virtual interface, specify the source IP and destination IP, add it to the same bridge domain as the TRUNK sub-interface, and configure static routes so that data packets encapsulated through this VxLAN virtual interface are forced to undergo secondary encryption and encapsulation through the WireGuard interface, thereby completing the "tunnel nesting" sender configuration.
[0075] Correspondingly, the interconnection access gateway device M1 performs symmetrical configuration operations on the main control range side. Similarly, the VPP program takes over its WAN and TRUNK ports and completes the basic public network configuration of the WAN port. In tunnel construction, device M1 creates a corresponding WireGuard virtual interface to establish an encrypted connection with S1; simultaneously, it configures a VLAN sub-interface (such as...) for its TRUNK port. Figure 8VLAN 11 is added to the bridge domain to physically connect to the federal range service platform. In addition, M1 is also configured with a Loopback sub-interface and a VxLAN virtual interface. Static routes are configured to ensure that response data sent by the service platform can be redirected to the WireGuard tunnel for encrypted transmission after being encapsulated by VxLAN.
[0076] With the above configuration, as Figure 8 As shown by the red dashed arrow, once the gateway devices on both sides are deployed, a virtual Layer 2 link across the Internet is established. The raw Ethernet frames sent by the teaching service system enter gateway S1 through the VLAN 10 interface, are mapped to a VxLAN tunnel for inner encapsulation, and then routed to the WireGuard interface for outer encryption encapsulation, finally traversing the public network to reach gateway M1. Gateway M1 performs a reverse decapsulation operation, restoring the original data frames to the test range service platform through the VLAN 11 interface. This mechanism enables the two systems to communicate as if connected to the same Layer 2 switch, even when physically separated, meeting the special network environment requirements of teaching services such as course selection and classes.
[0077] Based on the above network access method, the following description illustrates the link usage after network access is completed, using an educational application scenario as an example. (Refer to...) Figure 9 This is a schematic diagram of a network communication design for a course selection process provided in an embodiment of this application. Figure 9 The diagram illustrates the interaction process of an attacker selecting courses and requesting resources in an educational application scenario. First, the attacker, "S11" (IP address 192.168.10.2), located within the attacker's local area network, connects to the LAN interface of the "Teaching Service System" (IP address 192.168.10.1) via the local area network to complete the "login to the Education Service System" operation (i.e.,...). Figure 9 Step 1). Subsequently, in order to obtain the latest list of target resources, the teaching service system sends a "request currently available courseware / target resources" command to the remote "Federated Target Range Service Platform" (IP address 192.168.30.2) through its TRUNK side interface (IP address 192.168.30.1). Figure 9 (Step 2) This communication process utilizes a pre-established VXLAN OverwireGuard encrypted communication tunnel to transmit across the public network, ensuring the security of signaling interaction and Layer 2 interoperability.
[0078] After acquiring usable targets and courseware resources, the process enters the user interaction phase. Attacker S11 performs the "select course" operation on the interface of the teaching service system (i.e., Figure 9Step 3) confirms the required exercise content. This process completes the entire interaction chain from user authentication and cross-domain resource discovery to business confirmation, laying the business foundation for attackers to subsequently use their self-owned machines to conduct practical operations on selected targets.
[0079] Step 402: In response to a connection request from a user terminal within the user's local area network, establish an encrypted communication tunnel between the interconnection access gateway device and the user terminal.
[0080] Step 402 is described in detail below.
[0081] In some embodiments, upon responding to a connection request from a user terminal within the user's local area network (LAN), an encrypted terminal communication tunnel is established between the interconnection access gateway device and the user terminal. In this step, the user terminal located within the attacker's LAN (such as a PC or laptop used by the attacker) initiates an access procedure and connects to the local gateway. After verifying the terminal's legitimacy, the interconnection access gateway device establishes an encrypted terminal communication tunnel with the terminal. Unlike the aforementioned backbone tunnel, this encrypted terminal communication tunnel primarily addresses the "last mile" of access security, ensuring that the user terminal's traffic in an uncontrolled LAN environment is not eavesdropped on or tampered with, while also achieving a logical binding between the user terminal and the gateway.
[0082] Reference Figure 10 This is a schematic diagram of a network construction control flow design provided in an embodiment of this application. Figure 10 The diagram illustrates the control flow for access link network construction and dynamic attacker configuration in a lightweight network access scheme based on large Layer 2 network interconnection provided in this application embodiment. This flow aims to address the complex and diverse network environments of various target ranges by restricting the attacker and target IPs to the same logical network segment, thus avoiding complex cross-domain Layer 3 routing configurations. The entire process, using an educational application scenario as an example, covers the entire interaction from request initiation to terminal access.
[0083] First, such as Figure 10 As shown in steps 1 and 2, the network construction process is initiated by the teaching service system. According to a pre-agreed time (or course schedule), this system sends a "request network construction" command to the federal target range service platform through the established backbone channel. The platform, as the central control node, responds to this request by performing global network orchestration and issuing corresponding configuration commands to the associated interconnected access gateway devices (including the attacker's gateway S1, the target provider's gateway, and the main control target range gateway). This process establishes a logical Layer 2 network spanning physical regions at the underlying level, ensuring that all participating nodes are connected.
[0084] Subsequently, the terminal configuration distribution and access phase begins, such as... Figure 10As shown in steps 3 and 4. After completing the network setup, the Federal Range Service Platform generates "attacker configuration" data containing specific tunnel parameters (such as WireGuard private key, endpoint IP, VNI identifier, and dynamically allocated VxLAN IP in the same network segment), and returns it to the teaching service system. When the attacker (student) logs into the teaching service system for online classes, the system transmits the above configuration data to the attacker's own machine. Based on this, the machine automatically establishes a first-level VxLAN over WireGuard encrypted communication tunnel with the local interconnection access gateway device S1, and configures the obtained dynamic IP (such as 10.1.1.3), thereby achieving "seamless" access to the federal network range with an IP identity in the same network segment and directly accessing cross-domain target resources.
[0085] Understandably, the network deployments of each sub-range are complex and diverse, generally only considering internal network interconnection within their own range. Without requiring changes to the network environment of each range, this invention proposes a lightweight network access scheme based on large Layer 2 network interconnection, restricting the IPs of multiple attackers and targets requiring interconnection within the federated network range to the same network segment, thus eliminating the need to handle complex Layer 3 routing relationships. For example... Figure 10 As shown, taking the education application scenario as an example, it includes several steps. (1) The teaching service system requests network construction from the target service platform at the agreed time; (2) The target service platform sets up the network according to the requirements and issues relevant configurations to each associated interconnection access gateway device; (3) The attacker's self-owned machine needs to establish a first-level VXLAN over Wireguard encrypted tunnel with its corresponding gateway device, and at the same time uses an IP in the same network segment as the target for access. Therefore, the target service platform will return the student's configuration, including the corresponding Wireguard, VXLAN and dynamically allocated IP information in the same network segment. The configuration data structure example is shown in the code example below.
[0086] { "wireguardPrivateKey": "yPJk4LJrljNyMkikMTNM+XzaCrQGlMgzU5ixactiJ3M=", "endpointIp": "192.168.10.1", "vni": 101, "peerWireguardPublicKey": "sTL9gDuAEJo5UiuLyl8Pluy+OazsTZZBvq4LIBaeAgw=", "wireguardAddressIp": "10.10.10.6 / 30", "vxlanIp": "10.1.1.3 / 24", "endpointPort": "9090", "peerWireguardAddressIp": "10.10.10.5", } (4) After the teaching service system obtains the attacker's machine configuration, when the attacker logs into the system (accesses the page through a browser) to attend online classes, the attacker establishes a communication tunnel with the corresponding interconnected access gateway device on the attacker's own machine according to the configuration data.
[0087] Reference Figure 11 This is a schematic diagram of a network construction data flow design provided in an embodiment of this application. For example... Figure 11 The image shown is an illustration of an application scenario where a single attacker group can simultaneously access targets in both the main target range and sub-target ranges, as provided in an embodiment of this application. Figure 11 As shown, this network architecture enables cross-regional "large Layer 2 communication within the same network segment." The attacker group in the left-hand "sub-target range (attacker)" utilizes its self-owned machine (physical IP 192.168.10.2) and the dynamically acquired access IP (10.1.1.3) to logically and directly access the target (10.1.1.1) in the upper "main control range" and the target (10.1.1.2) in the right-hand "sub-target range (target)." The pre-deployment of network access in this scenario involves multiple configurations, focusing on establishing a first-level encrypted communication link between the attacker's self-owned machine and the local interconnection access gateway device S1, as well as a backbone link between gateway S1 and remote gateways M1 and S2. The Layer 2 bridge domains of all devices are set to the same identifier (e.g., 101) to ensure logical connectivity of the broadcast domain.
[0088] To establish the first-level VxLAN over WireGuard encrypted tunnel, the attacker's self-owned machine (using Linux as an example) needs to perform specific client configurations. First, a persistent configuration file (e.g., named wg0.conf) is created to establish a WireGuard virtual interface. The configuration includes the listening port, public / private key pair generation, peer gateway information, and connection keep-alive duration, as well as setting the allowed IP range. Based on this, the attacker's machine further creates a VxLAN virtual interface, specifies the source and destination IPs for tunnel encapsulation, and binds them to a designated bridge domain. Simultaneously, static routing rules are configured to force all packets passing through this VxLAN virtual interface to be redirected to the WireGuard sub-interface for encryption encapsulation, thus completing the tunnel exit construction on the terminal side.
[0089] Corresponding to the terminal configuration, the interconnection access gateway device S1 needs to perform symmetrical access configuration. First, the physical layer and link layer are configured for the LAN port facing the local area network, including link status, MTU size, IP address (192.168.10.3), and basic static routes, ensuring physical connectivity with the attacker's machine. Then, gateway S1 creates a corresponding WireGuard virtual interface to match the attacker's encryption parameters and creates a VxLAN virtual interface, configuring the corresponding source and destination IP addresses and the same bridge domain information. By configuring static routes, the gateway ensures that decrypted traffic or return traffic can correctly enter the tunnel. After the above bidirectional configuration, the attack data stream sent by the attacker's machine is successfully guided to the interconnection access gateway device S1 and distributed to the main control range or sub-range via the subsequent backbone tunnel, achieving end-to-end Layer 2 transparent transmission.
[0090] Step 403: Receive the first encapsulated message from the user terminal through the terminal encrypted communication tunnel, and decapsulate the first encapsulated message to obtain the original Layer 2 data frame.
[0091] Step 403 will be described in detail below.
[0092] In some embodiments, after establishing the encrypted communication tunnel between the target range and the terminal, the first encapsulated message sent from the user terminal is received through the terminal encrypted communication tunnel, and the first encapsulated message is decapsulated to obtain the original Layer 2 data frame. During this data processing stage, attack traffic or service traffic generated by the user terminal is encapsulated into a first encapsulated message conforming to the tunnel protocol format by the terminal-side software before transmission. When this message arrives at the gateway, the gateway device performs the operation of stripping the outer tunnel header, i.e., decapsulation, thereby restoring the payload that the user terminal truly intended to send, i.e., the original Layer 2 data frame. This original Layer 2 data frame retains link layer information such as the source MAC address and destination MAC address, enabling the traffic to be treated as a native data frame in the Layer 2 network for subsequent processing, achieving transparency to upper-layer protocols.
[0093] The following section will further describe how to receive the first encapsulated message from the user terminal through the terminal encrypted communication tunnel.
[0094] Reference Figure 12 The process of receiving a first encapsulated message from a user terminal through a terminal encrypted communication tunnel includes the following steps 1201 to 1203.
[0095] Step 1201: Use the Vector Packet Processing (VPP) program to take over the physical network port of the Internet access gateway device.
[0096] Step 1202: Based on the WireGuard listening port established on the physical network interface by the VPP program, the first encapsulated message is received through the terminal encrypted communication tunnel.
[0097] Step 1203: Perform handshake signature verification on the first encapsulated message. When the handshake signature verification is successful, it is determined that the first encapsulated message comes from a legitimate user terminal.
[0098] Steps 1201 to 1203 are described in detail below.
[0099] In some embodiments, before receiving the first encapsulated message, the Vector Packet Processing (VPP) program needs to take over the physical network interface of the interconnect access gateway device. Specifically, this step involves the transfer of control at the data plane driver level of the network device. The Vector Packet Processing (VPP) program is a high-performance network protocol stack technology running in user space. Through low-level driver mechanisms such as the Data Plane Development Kit (DPDK), it bypasses the operating system kernel and directly monopolizes control of the physical network interface card (NIC) on the interconnect access gateway device, i.e., the physical network port. Through this takeover mechanism, the device no longer relies on the interrupt handling mode of the traditional operating system kernel to send and receive data, but instead enters a high-speed I / O mode based on polling, laying the foundation for subsequent high-concurrency data processing.
[0100] Then, based on the WireGuard listening port established by the VPP program on the physical network interface, the first encapsulated packet is received through the terminal encrypted communication tunnel. In this step, the VPP program integrates a WireGuard protocol plugin or processing node and binds a specific UDP port as the service entry point, i.e., the WireGuard listening port, on the managed physical interface. This port is in a continuous listening state, specifically used to capture and identify specific encrypted traffic. When the user terminal initiates communication, the data is encapsulated in the tunnel protocol packet, forming the first encapsulated packet, and sent to the listening port. Since VPP directly manages the network interface, these packets are directly entered into the VPP's processing graph node after being received by the network card, realizing high-speed packet reception in user space.
[0101] Next, a handshake signature verification is performed on the first encapsulated message. If the handshake signature verification passes, it is determined that the first encapsulated message comes from a legitimate user terminal. This is a crucial step in ensuring access security. Before decapsulating the message, the VPP program uses a pre-built encryption algorithm (such as the Curve25519 elliptic curve algorithm) to extract the authentication information in the message header and performs a matching operation with the locally stored peer public key, i.e., performs handshake signature verification. This process aims to confirm the authenticity of the message sender's identity and the integrity of the data. Only when the verification algorithm returns a pass result does the system recognize that the message indeed originates from an authorized user terminal, thus allowing it to enter the subsequent processing flow; if the verification fails, the system will directly discard the message at the underlying level to defend against unauthorized access or replay attacks.
[0102] Through steps 1201 to 1203 above, by deeply integrating VPP high-performance data plane technology with the WireGuard security protocol, and utilizing the VPP program to take over the physical network interface, the performance bottleneck of the traditional kernel protocol stack in handling network interruptions and context switching is effectively eliminated, greatly improving the throughput and forwarding efficiency of gateway devices when handling large-scale concurrent encrypted traffic. Secondly, by implementing strict handshake signature verification on the high-performance VPP plane, not only is a "zero-trust" level of access security control achieved, ensuring that only terminals holding legitimate keys can establish connections, but also the heavy encryption, decryption, and verification computation tasks are removed from the kernel space, avoiding overall response delays caused by security computation overload.
[0103] In addition, another perspective is given on how to receive the first encapsulated message from the user terminal.
[0104] Reference Figure 13 Both the terminal encrypted communication tunnel and the range encrypted communication tunnel are constructed using a Layer 2 extended protocol and an encrypted tunnel protocol. The terminal encrypted communication tunnel receives the first encapsulated message sent from the user terminal and decapsulates the first encapsulated message to obtain the original Layer 2 data frame, including the following steps 1301 to 1303.
[0105] Step 1301: Decrypt and remove the header of the outermost layer of the first encapsulated message based on the private key of the interconnection access gateway device to obtain the inner message. The outermost layer is generated based on the encrypted tunnel protocol.
[0106] Step 1302: Obtain the first virtual network identifier based on the Layer 2 extended protocol header of the inner message.
[0107] Step 1303: Based on the matching result of the mapping relationship between the first virtual network identifier and the bridge domain, remove the header of the Layer 2 extended protocol of the inner packet to obtain the original Layer 2 data frame.
[0108] Steps 1301 to 1303 are described in detail below.
[0109] In some embodiments, after receiving a first encapsulated message from a user terminal via a terminal encrypted communication tunnel, the outermost layer of the first encapsulated message is decrypted and its header removed using the private key of the interconnection access gateway device to obtain the inner message. The outermost layer is generated based on an encrypted tunnel protocol. In this step, when the interconnection access gateway device receives the data stream, it first processes the secure shell built by an encrypted tunnel protocol (such as WireGuard). The device calls the locally stored asymmetric encryption credential, i.e., the private key, to decrypt the message. Since the sender (user terminal) uses the gateway's public key for encryption encapsulation, only a matching private key can successfully decrypt the data. After successful decryption, the device removes the header data carrying the encrypted information (i.e., header removal), thereby exposing the payload wrapped inside, i.e., the inner message. This process removes the "security disguise" of the data during public network transmission.
[0110] Then, based on the Layer 2 extended protocol header of the inner packet, the first virtual network identifier (VNI) is obtained. In this step, the exposed inner packet undergoes structural parsing. This packet is essentially a data packet encapsulated using a Layer 2 extended protocol (such as VxLAN), and its header contains key fields used to distinguish different logical networks. By reading this header information, the tag used to identify the user's tenant or service network segment, namely the first virtual network identifier (VNI), is extracted. This identifier is crucial for achieving multi-tenant isolation, similar to dividing different "virtual channels" within the physical network, ensuring that the data packet belongs only to a specific logical network context.
[0111] Next, based on the matching result of the first virtual network identifier and the bridge domain mapping relationship, the Layer 2 extension protocol header of the inner packet is removed to obtain the original Layer 2 data frame. In this step, the extracted VNI is compared with the locally maintained bridge domain mapping table to confirm which logical bridge domain the data packet is allowed to enter. After successful verification, the device performs a second decapsulation operation to remove the Layer 2 extension protocol header information. This step completely restores the payload originally sent by the user terminal, i.e., the original Layer 2 data frame (containing source MAC, destination MAC, and payload data). At this point, the data packet has been completely restored to its original form within the local area network and can be forwarded at Layer 2 as if it were on a local switch.
[0112] Through steps 1301 to 1303 above, a layer-by-layer decapsulation mechanism from the outside in precisely addresses the requirements of "secure transmission" and "logical isolation." The outer layer decryption ensures the confidentiality and tamper-proof capability of data in the untrusted public network, while the extraction of the inner VNI and header stripping achieves accurate tenant identification and transparent restoration of large Layer 2 data after decryption. This design makes the complex cross-domain tunnel completely transparent to upper-layer services, truly realizing secure, isolated, and seamless Layer 2 interconnection between user terminals and the test range's internal network.
[0113] Step 404: Based on the bridge domain mapping relationship, encapsulate the original Layer 2 data frame to obtain the second encapsulated message.
[0114] Step 404 will be described in detail below.
[0115] In some embodiments, after obtaining the original Layer 2 data frame, it is encapsulated based on the bridge domain mapping relationship to obtain a second encapsulated message. In this step, the interconnection access gateway device performs route matching and re-encapsulation on the decapsulated original Layer 2 data frame according to the generated bridge domain mapping relationship. Specifically, the device looks up the corresponding mapping table entry based on the characteristics of the data frame (such as its VLAN tag or source port), determines the target range logical network it should enter, adds a new tunnel header (such as a VxLAN header and an outer IP header), and encapsulates it into a second encapsulated message adapted for backbone transmission. This process realizes the conversion from the user-side access protocol to the target range-side backbone transmission protocol, as described below.
[0116] Reference Figure 14 The encrypted tunnel protocol is the WireGuard protocol, and the Layer 2 extension protocol is the VXLAN protocol. Based on the bridge domain mapping relationship, the original Layer 2 data frame is encapsulated to obtain the second encapsulated message, including the following steps 1401 to 1403.
[0117] Step 1401: Based on the target MAC address of the original Layer 2 data frame, determine the corresponding outgoing interface in the bridge domain mapping relationship, and associate the outgoing interface with the target range encrypted communication tunnel.
[0118] Step 1402: Based on the second virtual network identifier corresponding to the encrypted communication tunnel in the test range, add a VXLAN header to the original Layer 2 data frame to obtain the inner message to be sent.
[0119] Step 1403: Based on the WireGuard public key and endpoint IP address of the target range-side gateway device, add a WireGuard header to the inner message to be sent and encrypt it to obtain the second encapsulated message.
[0120] Steps 1401 to 1403 are described in detail below.
[0121] In some embodiments, after obtaining the original Layer 2 data frame, the corresponding outgoing interface is determined in the bridge domain mapping relationship based on the destination MAC address of the original Layer 2 data frame. The outgoing interface is associated with the encrypted communication tunnel of the test range. In this step, the interconnection access gateway device performs a table lookup forwarding logic similar to that of a traditional Layer 2 switch. The original Ethernet frame obtained after decapsulation is parsed, and its link layer destination address, i.e., the destination MAC address, is extracted. Subsequently, the locally maintained forwarding information table, i.e., the bridge domain mapping relationship, is retrieved. This table records the correspondence between MAC addresses and logical ports. By searching and matching, the device locates which logical interface, i.e., the outgoing interface, should be forwarded to. It can be understood that this outgoing interface is not a physical network cable interface, but is logically bound to the backbone transmission channel leading to the main control gateway or the sub-test range gateway, i.e., the encrypted communication tunnel of the test range, thereby determining the next-hop logical node of the data flow.
[0122] Then, based on the second virtual network identifier corresponding to the encrypted communication tunnel in the test range, a VXLAN header is added to the original Layer 2 data frame to obtain the inner message to be sent. In this step, the device begins to perform the first layer encapsulation operation, namely Layer 2 extended encapsulation. According to the determined outgoing interface, the device obtains the logical network ID associated with the tunnel, namely the second virtual network identifier (VNI). This identifier is used to distinguish different service planes or tenants in the backbone network. The device writes the VNI into the standard VXLAN protocol header and adds this header before the original Layer 2 data frame, thereby encapsulating it into a format suitable for overlay network transmission, i.e., the inner message to be sent. This process realizes the logical mapping of the original Layer 2 data frame from the local area network space to the virtual overlay network space.
[0123] Finally, based on the WireGuard public key and endpoint IP address of the target-side gateway device, a WireGuard header is added to the inner packet to be sent and encrypted to obtain the second encapsulated packet. In this step, the device performs a second-layer encapsulation operation, namely secure encrypted encapsulation. The device determines the identity information of the receiving device (such as the master gateway) based on routing information, including the WireGuard public key used for asymmetric encryption authentication and its physical location identifier in the public network, i.e., the endpoint IP address. Using this information, the device follows the WireGuard protocol specification to add a secure header to the inner packet to be sent and performs high-strength encryption on the payload. The resulting second encapsulated packet has the ability to be securely transmitted in an untrusted public network and is ready to be sent to the Internet.
[0124] Through steps 1401 to 1403 above, a three-level processing flow of "table lookup addressing - logical encapsulation - security encryption" is employed. First, by mapping MAC addresses to outgoing interfaces, precise routing of cross-domain traffic is achieved. Second, a "tunnel-within-a-tunnel" architecture, with VXLAN nested within WireGuard, cleverly combines the advantages of VXLAN in Layer 2 network expansion and multi-tenant isolation with the advantages of WireGuard in lightweight, high-performance encrypted transmission. This combination not only ensures that Layer 2 data frames (such as ARP requests and broadcast frames) within the test range can transparently traverse the Layer 3 Internet, but also completely eliminates the risk of data leakage during public network transmission of overlay traffic through high-strength encryption of the outer layer, providing solid data plane support for building a secure, flexible, and low-overhead federated test range network.
[0125] Step 405: Send the second encapsulated message to the main control gateway device through the range encrypted communication tunnel.
[0126] Step 405 will be described in detail below.
[0127] In some embodiments, after receiving the second encapsulated message, it is sent to the master control gateway device via the range encrypted communication tunnel. Finally, the re-encapsulated second encapsulated message is sent into the established range encrypted communication tunnel and transmitted across the Internet or WAN to the remote master control gateway device. Upon receiving the message, the master control gateway device performs the corresponding decapsulation operation and forwards the data frame to the internal target. This step completes the final delivery of data from the user-side edge to the range core.
[0128] In addition, refer to Figure 15 The access data forwarding method of the network access system also includes the following steps 1501 to 1504.
[0129] Step 1501: Receive the third encapsulated message from the range-side gateway device through the range encrypted communication tunnel.
[0130] Step 1502: Based on the private key of the interconnection access gateway device and the protocol configuration of the target range encrypted communication tunnel, decapsulate the third encapsulated message to obtain the return layer 2 data frame.
[0131] Step 1503: Based on the destination MAC address of the returned Layer 2 data frame, match the corresponding user terminal target address in the bridge domain mapping relationship.
[0132] Step 1504: Based on the encryption parameters corresponding to the target address of the user terminal, encapsulate the returned Layer 2 data frame into a fourth encapsulation message adapted to the terminal encrypted communication tunnel, and send it to the user terminal through the terminal encrypted communication tunnel.
[0133] Steps 1501 to 1504 are described in detail below.
[0134] In some embodiments, upon receiving feedback from the target range, a third-encapsulated message is received from the target range-side gateway device via the target range's encrypted communication tunnel. This step describes the starting point of the data backhaul path, where the interconnection access gateway device, acting as the exit node of the attacker's local area network, listens for response data from the internet side. The third-encapsulated message refers to an encrypted data packet sent by the main control gateway or sub-target range gateway, transmitted through the backbone network, and arriving at the local location. This message carries the target's response to the attack (such as ICMP echo replies, HTTP responses, etc.) within the target range and is encrypted using WireGuard and encapsulated using VXLAN at the sending end to ensure security and logical isolation during transmission over the public network.
[0135] Then, based on the private key of the interconnection access gateway device and the protocol configuration of the target range encrypted communication tunnel, the third-encapsulated message is decapsulated to obtain the return Layer 2 data frame. In this step, the device performs a reverse data restoration operation. First, the outer encryption shell of the message is decrypted and verified using the locally stored private key, and the WireGuard protocol header is stripped off. Then, according to the protocol configuration of the target range encrypted communication tunnel (such as VXLAN VNI identification rules), the inner VXLAN header is identified and stripped off. After this series of header removal processes, the device restores the unencrypted payload, i.e., the return Layer 2 data frame. This data frame restores its original Ethernet frame structure, containing the destination MAC address (pointing to the attacker's terminal) and the source MAC address (pointing to the target).
[0136] Next, based on the destination MAC address of the returned Layer 2 data frame, the device matches the corresponding user terminal target address in the bridge domain mapping relationship. In this step, the device performs a forwarding lookup within the Layer 2 bridge domain. The device reads the destination MAC address from the header of the returned frame and searches it in the locally maintained MAC address table (FDB table) or the bridge domain mapping relationship. This mapping relationship was dynamically generated when the terminal tunnel was established, recording the correspondence between the attacker's terminal's MAC address and a specific logical interface or tunnel endpoint. Through matching, the device determines which specific object within the local area network the data frame should be forwarded to, thereby locking the user terminal target address (i.e., the logical exit of the user-side tunnel).
[0137] Finally, based on the encryption parameters corresponding to the user terminal's target address, the returned Layer 2 data frame is encapsulated into a fourth-encapsulated message adapted to the terminal's encrypted communication tunnel, and sent to the user terminal through the terminal's encrypted communication tunnel. This is the "last mile" of data return. To ensure the security of data transmission within the user's local area network, the device does not directly send plaintext frames. Instead, it uses the key and tunnel parameters (i.e., encryption parameters) negotiated with the user terminal to re-encapsulate the original frame, generating a fourth-encapsulated message conforming to the access-side protocol format. Subsequently, this message is injected into the terminal's encrypted communication tunnel and ultimately delivered to the attacker's self-owned machine.
[0138] Steps 1501 to 1504 constitute the complete "backhaul traffic processing logic," forming a closed loop with the aforementioned sending process. This ensures that the response traffic returning from the test range undergoes precise decryption, route mapping, and re-encryption, delivering it securely and error-free to the specific attacker's terminal. This "double decryption-table lookup-double resealing" processing mechanism not only guarantees end-to-end encryption on the backhaul path but also enables the user terminal to receive the native Ethernet response frame through transparent Layer 2 frame restoration. This perfectly simulates the real network experience of direct attack and defense within the same local area network, shielding the complex tunnel transmission details in between.
[0139] Through steps 401 to 405 above, by establishing dual tunnels (terminal tunnel and range tunnel) on the interconnection access gateway device and executing the "decapsulation-mapping-recapsulation" message processing flow, firstly, through bridge domain mapping and Layer 2 frame pass-through, user terminals distributed in different locations can logically and directly "connect" to the internal network of the range, realizing large-scale Layer 2 interconnection across wide area networks, and meeting the practical needs of Layer 2 protocol attack scenarios such as ARP spoofing and sniffing in network attack and defense exercises; secondly, this gateway-based centralized forwarding mechanism decouples the complex tunnel configuration and encryption calculations from the user terminal to the gateway device, greatly reducing the configuration difficulty and resource consumption of the user-side terminal, and realizing lightweight, plug-and-play large-scale concurrent access.
[0140] Reference Figure 16 This is a schematic diagram illustrating the configuration of a lightweight network access method for a federated network range, provided in an embodiment of this application. Figure 16 As shown, Figure 16 The document clearly defines three different types of data flows: the black solid line represents the "actual data flow" (physical path), the red solid line represents the "logical control flow" (signaling interaction), and the green solid line represents the "logical data flow" (business attack and defense).
[0141] exist Figure 16The upper part of the network negotiation phase shows that the "attacker group" located in the "university" on the left first connects to the "education service system" (192.168.30.1) via the local area network. At this time, the generated logical control flow (red arrow) is initiated by the education service system, encapsulated by the local "interconnection access gateway device S1", and follows the physical path of the actual data flow (black arrow), traversing the Internet and reaching the "interconnection access gateway device cluster" on the "master control range" side, and finally delivered to the "federated network range service platform" (192.168.30.2). This process completes the issuance of authentication and network request instructions.
[0142] exist Figure 16 The second half of the diagram shows the network construction and practical operation phase, demonstrating the network status after the execution of control commands. At this point, each sub-range (such as sub-ranges S1 and S2) is interconnected with the main control range. The attacker group located in "sub-range S1" has obtained a dynamically assigned intranet IP address (10.1.1.x / 24). The resulting logical data flow (green arrow) shows that the attackers can logically directly access the "target" (10.1.1.240) located in the main control range and the "target" (10.1.1.241) located in sub-range S2. Although physically these traffic still need to be encrypted and transmitted through interconnection access gateway devices in various locations, from the user's perspective, this appears as direct Layer 2 communication within a unified 10.1.1.x network segment, achieving the physically distributed and logically unified range access effect provided by this application.
[0143] Reference Figure 17 This is a schematic diagram of network access in an educational application scenario provided in an embodiment of this application. For example... Figure 17 As shown, the entire network architecture connects three geographically dispersed regions via the Internet: "Sub-Range S1 (Attacker)" on the left, "Main Control Range" above, and "Sub-Range S2 (Target Provider)" on the right. These three parties construct a cross-domain encrypted communication network based on VXLAN OVER WIREGUARD TUNNEL through their respective deployed "Interconnection Access Gateway Device S1," "Interconnection Access Gateway Device M1," and "Interconnection Access Gateway Device S2."
[0144] On the attacker's side (sub-range S1), multiple parallel "attack groups" (e.g., attack groups 1, 2, and 3) are displayed, located in different local area network segments (e.g., attack group 1 corresponds to 192.168.100.10-20 / 24). Through the configuration of the interconnection access gateway device S1, different attack groups are mapped to different logical tunnels (tunnel 1, tunnel 2, and tunnel 3) and corresponding exercise tasks (task 1, task 2, and task 3). This design demonstrates that the present invention can support multiple groups of users to access the same physical access point concurrently, and perform logical isolation according to task requirements.
[0145] On the resource side, target resources are flexibly distributed across different areas. Within the main control range, gateway M1 manages "Target M11," "Target M12," and "Target M13," which are respectively assigned to VLANs 200, 201, and 202. Within the sub-range S2, gateway S2 manages "Target S21," "Target S22," and "Target S23," located in VLANs 100, 101, and 102. This distribution reflects the resource-sharing characteristics of the federated ranges.
[0146] Figure 17 The diagram further illustrates the multi-task cross-domain access path using dashed arrows of different colors: Task 1 (green dashed path): The data flow of attack group 1, after being encapsulated by gateway S1, directly accesses "target M11" located in the main control range through a tunnel. Task 2 (blue dashed path): The data flow of the attack group is split, accessing "target M13" in the main control range on one hand, and "target S23" in sub-range S2 on the other. This intuitively demonstrates that the solution of this application supports a single attack group to simultaneously access multiple target resources distributed in different physical locations. Task 3 (purple dashed path): The data flow of attack group 3 is then routed to sub-range S2 to access "target S21" within it.
[0147] In summary, the accompanying diagram vividly demonstrates that the present invention, through interconnection access gateway devices and encrypted tunnel technology, successfully achieves flexible, secure, and transparent Layer 2 network interconnection from multiple sources (multiple attack groups) to multiple destinations (main target range and multiple targets in sub-target ranges) in large-scale concurrent scenarios. It supports attacker groups accessing a single target as well as attacker groups accessing multiple non-conflicting targets simultaneously. Furthermore, it supports isolated access for multiple attacker groups through VXLAN tunnels and VLANs.
[0148] This application also provides an access data forwarding device for a network access system, which can implement the access data forwarding method of the network access system described above. (Refer to...) Figure 18 The device 1800 includes: The range tunnel establishment module 1810 is used to establish a range encrypted communication tunnel from the interconnection access gateway device to the main control gateway device in response to the network construction configuration command, and to obtain the network bridge domain mapping relationship based on the bridge domain information of the network construction configuration command. The terminal tunnel establishment module 1820 is used to establish an encrypted communication tunnel between the interconnection access gateway device and the user terminal in response to a connection request from a user terminal in the user-side local area network. The message receiving module 1830 is used to receive the first encapsulated message sent from the user terminal through the terminal encrypted communication tunnel, and to decapsulate the first encapsulated message to obtain the original Layer 2 data frame. The message encapsulation module 1840 is used to encapsulate the original Layer 2 data frame based on the bridge domain mapping relationship to obtain the second encapsulated message; The message forwarding module 1850 is used to send the second encapsulated message to the main control gateway device through the range encrypted communication tunnel.
[0149] In some embodiments, the message receiving module 1830 is further configured to: The outermost layer of the first encapsulated message is decrypted and its header removed using the private key of the interconnection access gateway device to obtain the inner message. The outermost layer is generated based on the encrypted tunnel protocol. Based on the Layer 2 extended protocol header of the inner message, the first virtual network identifier is obtained; Based on the matching result of the mapping relationship between the first virtual network identifier and the bridge domain, the header of the inner layer message is removed to obtain the original layer 2 data frame.
[0150] In some embodiments, the message encapsulation module 1840 is further configured to: Based on the target MAC address of the original Layer 2 data frame, the corresponding outgoing interface is determined in the bridge domain mapping relationship, and the outgoing interface is associated with the target range encrypted communication tunnel. Based on the second virtual network identifier corresponding to the encrypted communication tunnel of the test range, a VXLAN header is added to the original Layer 2 data frame to obtain the inner message to be sent. Based on the WireGuard public key and endpoint IP address of the target range-side gateway device, a WireGuard header is added to the inner message to be sent and encrypted to obtain the second encapsulated message.
[0151] In some embodiments, the range tunnel establishment module 1810 is further configured to: Based on the first VXLAN network identifier indicated in the user-side configuration parameters, a first virtual interface corresponding to the terminal encrypted communication tunnel is created, and the first virtual interface is added to the specified bridge domain. Based on the second VXLAN network identifier indicated in the range-side configuration parameters, create a second virtual interface corresponding to the range encrypted communication tunnel, and add the second virtual interface to the specified bridge domain; Establish a Layer 2 forwarding path between the first virtual interface and the second virtual interface within a specified bridge domain, and obtain the bridge domain mapping relationship based on the Layer 2 forwarding path.
[0152] In some embodiments, the message receiving module 1830 is further configured to: The Vector Packet Processing (VPP) program takes over the physical network port of the Internet access gateway device. The WireGuard listening port is established on the physical network interface based on the VPP program, and the first encapsulated message is received through the terminal encrypted communication tunnel. The first encapsulated message is subjected to handshake signature verification. When the handshake signature verification is successful, it is determined that the first encapsulated message comes from a legitimate user terminal.
[0153] In some embodiments, the message forwarding module 1850 is further configured to: Receive third-encapsulated messages from the range-side gateway device through the range-encrypted communication tunnel; Based on the private key of the interconnection access gateway device and the protocol configuration of the target range encrypted communication tunnel, the third encapsulated message is decapsulated to obtain the returned Layer 2 data frame. Based on the destination MAC address of the returned Layer 2 data frame, match the corresponding user terminal target address in the bridge domain mapping relationship; Based on the encryption parameters corresponding to the target address of the user terminal, the returned Layer 2 data frame is encapsulated into a fourth encapsulated message adapted to the terminal encrypted communication tunnel, and sent to the user terminal through the terminal encrypted communication tunnel. In some embodiments, the range tunnel establishment module 1810 is further configured to: Create a loopback interface and configure the loopback IP address on the interconnection access gateway device; An encrypted communication tunnel for the test range is established using the loopback IP address as the tunnel source address.
[0154] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, the specific implementation of the access data forwarding device of the network access system is basically the same as the specific implementation of the access data forwarding method of the network access system described above, and will not be repeated here.
[0155] This application also provides an electronic device, including: At least one memory; At least one processor; At least one program; The program is stored in a memory, and the processor executes the at least one program to implement the access data forwarding method of the network access system described above in this application. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), in-vehicle computers, etc.
[0156] Please see Figure 19 , Figure 19 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1902 can be implemented in the form of ROM (Read-Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory 1902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1902 and is called and executed by the processor 1901 to execute the access data forwarding method of the network access system of the embodiments of this application. The input / output interface 1903 is used to implement information input and output; The communication interface 1904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1905 transmits information between various components of the device (e.g., processor 1901, memory 1902, input / output interface 1903, and communication interface 1904); The processor 1901, memory 1902, input / output interface 1903, and communication interface 1904 are connected to each other within the device via bus 1905.
[0157] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the access data forwarding method of the network access system described above.
[0158] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0159] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0160] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0161] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0162] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0163] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0164] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, or indirect coupling or communication connection between the apparatus or units, and may be electrical, mechanical, or other forms.
[0166] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0167] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0168] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0169] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for forwarding access data in a network access system, characterized in that, The network access system includes an interconnection access gateway device deployed on the user-side local area network and a main control gateway device deployed on the test range side. The method is applied to the interconnection access gateway device, and the method includes: In response to the network construction configuration command, a target range encrypted communication tunnel is established from the interconnection access gateway device to the main control gateway device, and the network bridge domain mapping relationship is obtained based on the bridge domain information of the network construction configuration command; In response to a connection request from a user terminal within the user-side local area network, an encrypted communication tunnel between the interconnection access gateway device and the user terminal is established. The terminal receives a first encapsulated message from the user terminal through the encrypted communication tunnel, and decapsulates the first encapsulated message to obtain the original Layer 2 data frame. Based on the bridge domain mapping relationship, the original Layer 2 data frame is encapsulated to obtain a second encapsulated message; The second encapsulated message is sent to the master control gateway device through the encrypted communication tunnel of the test range.
2. The access data forwarding method for a network access system according to claim 1, characterized in that, Both the terminal encrypted communication tunnel and the range encrypted communication tunnel are constructed using a Layer 2 extended protocol and an encrypted tunneling protocol. The process involves receiving a first encapsulated message from the user terminal through the terminal encrypted communication tunnel and decapsulating the first encapsulated message to obtain an original Layer 2 data frame, including: The outermost layer of the first encapsulated message is decrypted and its header removed based on the private key of the interconnection access gateway device to obtain the inner layer message, wherein the outermost layer is generated based on the encrypted tunnel protocol; Based on the Layer 2 extended protocol header of the inner message, the first virtual network identifier is obtained; Based on the matching result of the mapping relationship between the first virtual network identifier and the bridge domain, the header of the Layer 2 extended protocol of the inner packet is removed to obtain the original Layer 2 data frame.
3. The access data forwarding method for a network access system according to claim 2, characterized in that, The encrypted tunnel protocol is the WireGuard protocol, the Layer 2 extended protocol is the VXLAN protocol, and the original Layer 2 data frame is encapsulated based on the bridge domain mapping relationship to obtain a second encapsulated message, including: Based on the target MAC address of the original Layer 2 data frame, the corresponding outgoing interface is determined in the bridge domain mapping relationship, and the outgoing interface is associated with the target range encrypted communication tunnel. Based on the second virtual network identifier corresponding to the encrypted communication tunnel of the target range, a VXLAN header is added to the original Layer 2 data frame to obtain the inner message to be sent. Based on the WireGuard public key and endpoint IP address of the target range-side gateway device, a WireGuard header is added to the inner message to be sent and encrypted to obtain the second encapsulated message.
4. The access data forwarding method for a network access system according to claim 1, characterized in that, The network construction configuration instructions include user-side configuration parameters and range-side configuration parameters. The process of obtaining the network-bridge domain mapping relationship based on the bridge domain information from the network construction configuration instructions includes: Based on the first VXLAN network identifier indicated in the user-side configuration parameters, a first virtual interface corresponding to the encrypted communication tunnel of the terminal is created, and the first virtual interface is added to the specified bridge domain; Based on the second VXLAN network identifier indicated in the range-side configuration parameters, a second virtual interface corresponding to the encrypted communication tunnel of the range is created, and the second virtual interface is added to the designated bridge domain; Establish a Layer 2 forwarding path between the first virtual interface and the second virtual interface within the specified bridge domain, and obtain the bridge domain mapping relationship based on the Layer 2 forwarding path.
5. The access data forwarding method for a network access system according to claim 1, characterized in that, Receiving the first encapsulated message from the user terminal through the terminal encrypted communication tunnel includes: The Vector Packet Processing (VPP) program takes over the physical network port of the Internet access gateway device. Based on the WireGuard listening port established by the VPP program on the physical network interface, and receiving the first encapsulated message through the terminal encrypted communication tunnel; A handshake signature verification is performed on the first encapsulated message. When the handshake signature verification is successful, it is determined that the first encapsulated message comes from a legitimate user terminal.
6. The access data forwarding method for a network access system according to claim 1, characterized in that, The method further includes: Receive a third encapsulated message from the target range-side gateway device through the target range encrypted communication tunnel; Based on the private key of the interconnected access gateway device and the protocol configuration of the target range encrypted communication tunnel, the third encapsulated message is decapsulated to obtain a return layer 2 data frame. Based on the destination MAC address of the returned Layer 2 data frame, the corresponding user terminal target address is matched in the bridge domain mapping relationship; Based on the encryption parameters corresponding to the target address of the user terminal, the returned Layer 2 data frame is encapsulated into a fourth encapsulated message adapted to the encrypted communication tunnel of the terminal, and sent to the user terminal through the encrypted communication tunnel of the terminal.
7. The method according to claim 1, characterized in that, The establishment of the range encrypted communication tunnel from the interconnection access gateway device to the main control gateway device includes: Create a loopback interface and configure a loopback IP address on the interconnection access gateway device; The target range encrypted communication tunnel is established using the loopback IP address as the tunnel source address.
8. An access data forwarding device for a network access system, characterized in that, The network access system includes an interconnection access gateway device deployed on the user-side local area network and a main control gateway device deployed on the test range side. The device is applied to the interconnection access gateway device, and the device includes: The range tunnel establishment module is used to establish a range encrypted communication tunnel from the interconnected access gateway device to the main control gateway device in response to the network construction configuration command, and to obtain the network bridge domain mapping relationship based on the bridge domain information of the network construction configuration command. The terminal tunnel establishment module is used to establish an encrypted terminal communication tunnel between the interconnection access gateway device and the user terminal in response to a connection request from a user terminal in the user-side local area network. The message receiving module is used to receive a first encapsulated message sent from the user terminal through the terminal encrypted communication tunnel, and to decapsulate the first encapsulated message to obtain the original Layer 2 data frame. The message encapsulation module is used to encapsulate the original Layer 2 data frame based on the bridge domain mapping relationship to obtain a second encapsulated message; The message forwarding module is used to send the second encapsulated message to the main control gateway device through the target range encrypted communication tunnel.
9. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the access data forwarding method of the network access system according to claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the access data forwarding method of the network access system as described in claims 1 to 7.
