Method for establishing virtual private network connection and network device
Through the mesh network between the network device and the main routing device, the VPN settings are automatically received and the connection is established, which solves the problem of cumbersome VPN connection methods and realizes a convenient and efficient VPN connection process.
Patent Information
- Application Number
- CN202310570885.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2024-11-22
AI Technical Summary
The existing VPN connection method requires the user to manually install software or set up the router, and the steps are cumbersome and inconvenient to use.
The mesh network is established with the main routing device through the network device, automatically receives VPN settings, and automatically establishes VPN connection when it is not connected to the Internet network, simplifying the process of VPN connection.
It improves the convenience and efficiency of VPN connections, and users can obtain encrypted connections without manual settings, improving user experience.
Smart Images

Figure CN119011336A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a network device, and in particular to a method for establishing a virtual private network connection and a network device using the method. Background Art
[0002] A Virtual Private Network (VPN) primarily uses tunneling technology and security technologies such as encryption and decryption on the public Internet to establish a private and secure network connection. Currently, when users want to use VPN to connect to the Internet, they generally install VPN software on their terminal devices (such as mobile phones or computers) to connect to external VPN servers. Alternatively, users can install a VPN extension on their routers to allow their terminal devices to connect to external VPN servers through this router. However, the above traditional methods require users to manually install VPN software or manually configure VPN settings on the router, and the setup steps are cumbersome and can easily cause trouble for users. Summary of the Invention
[0003] This invention provides a method for establishing a VPN connection, comprising the following steps. A network device establishes a connection with a master routing device to construct a mesh network, wherein the network device is a child routing device of the mesh network. The network device receives VPN settings from a master routing device, wherein the master routing device is a VPN server corresponding to the VPN settings. The network device determines whether to connect to the internet via the master routing device. In response to not connecting to the internet via the master routing device, the network device determines to establish a VPN connection with the master routing device according to the VPN settings.
[0004] The present invention further provides a network device comprising a transceiver, a storage device, and a processor. The processor is coupled to the transceiver and the storage device and configured to perform the following operations: establishing a connection with a master routing device to construct a mesh network, wherein the network device is a child routing device of the mesh network; receiving VPN settings from the master routing device, wherein the master routing device is a VPN server corresponding to the VPN settings; determining whether to connect to the internet via the master routing device; and determining, in response to not connecting to the internet via the master routing device, establishing a VPN connection with the master routing device according to the VPN settings.
[0005] Based on the above, in the embodiments of the present disclosure, a network device serving as a sub-routing device can establish a mesh network with a main routing device. The main routing device establishes a VPN server and automatically transmits the VPN settings to the network device, so that the network device can receive the VPN settings from the main routing device. Thereafter, when the network device is connected to the Internet without going through the main routing device, the network device can automatically establish a VPN connection to the main routing device based on the recorded VPN settings. In this way, the user does not need to perform cumbersome VPN settings on the network device, and the terminal device can obtain a VPN encrypted connection by connecting to the network device, thereby greatly improving the convenience and efficiency of establishing a VPN connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 is a schematic diagram of a mesh network according to an embodiment of the present disclosure;
[0007] Figure 2 is a schematic diagram of a main routing device and a network device according to an embodiment of the present disclosure;
[0008] Figure 3 is a flow chart of a method for establishing a VPN connection according to an embodiment of the present disclosure;
[0009] Figure 4A This is a schematic diagram of a network device according to an embodiment of the present disclosure serving as a sub-routing device under a main routing device;
[0010] Figure 4B is a schematic diagram of establishing a VPN connection between a master routing device and a network device according to an embodiment of the present disclosure;
[0011] Figure 5 It is a flow chart of a method for establishing a VPN connection according to an embodiment of the present disclosure.
[0012] Description of Reference Numerals
[0013] 10: Mesh network;
[0014] T1, T41, T42: terminal equipment;
[0015] 110: main routing device;
[0016] 120: network device;
[0017] 111,121: transceiver;
[0018] 112, 122: storage device;
[0019] 113,123:processor;
[0020] F1: First place;
[0021] F2: Second place;
[0022] S301~S309, S510~S540: steps. DETAILED DESCRIPTION
[0023] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0024] Please refer to Figure 1 , the mesh network 10 can be composed of multiple network access points connected to each other, and these network access points can include a main routing device and multiple sub-routing devices. In other words, the main routing device 110 can establish a mesh network 10 with the network device 120 as a sub-routing device. The mesh network 10 can include multiple sub-routing devices. For the convenience of explanation, Figure 1 Only two sub-routing devices are shown as a representative example, but the present disclosure does not limit the number of sub-routing devices under the main routing device 110 .
[0025] The main routing device 110 serves as a gateway for the mesh network 10 to connect to the public Internet 20. For example, the main routing device 110 can be connected to the Internet 20 via a modem of an Internet service provider (ISP). The network device 120, as a sub-routing device, can extend the coverage of the wireless signal. In some embodiments, the main routing device 110 and the network device 120 can use the 2.4GHz or 5GHz frequency band to communicate wirelessly with the terminal device T1. In some embodiments, the terminal device T1 can use a single SSID to connect to the main routing device 110 or the network device 120. Compared to using only one main routing device to establish a networking environment, a mesh network 10 with multiple network nodes has the advantages of increasing the coverage area of the wireless network, improving stability and transmission rate, etc.
[0026] In some embodiments, the main router 110 and the network device 120 serving as a slave router can establish a mesh network 10 according to the Easymesh standard developed by the WiFi Alliance. In some embodiments, when the main router 110 and the network device 120 serving as a slave router form a mesh Wi-Fi network, the main router 110 serves as a multiple access point (Multi-AP) controller, and the network device 120 serves as a Multi-AP agent. In some embodiments, the main router 110 and the network device 120 serving as a slave router can support IEEE 802.11k / v / r protocols or IEEE 802.11s protocols.
[0027] In various embodiments, the master router 110 can be connected to the network device 120 serving as a slave router via a wired communication interface or a wireless communication interface. Examples of the wired communication interface include Ethernet, coaxial cable, or power line. Examples of the wireless communication interface include WiFi or Bluetooth.
[0028] In some embodiments, the terminal device T1 is, for example, a smartphone, tablet computer, game console, laptop computer, desktop computer, smart home appliance, IoT device, etc., but the present disclosure is not limited thereto. The terminal device T1 can be connected to the Internet by connecting to a network access point in the mesh network 10.
[0029] Please refer to Figure 2 The master routing device 110 may include a transceiver 111, a storage device 112, and a processor 113. The processor 113 is coupled to the transceiver 111 and the storage device 112. The network device 120 may include a transceiver 121, a storage device 122, and a processor 123. The processor 123 is coupled to the transceiver 121 and the storage device 122.
[0030] Transceivers 111 and 121 can transmit and receive signals wirelessly or wired. Transceivers can also perform operations such as low-noise amplification, impedance matching, frequency mixing, up- or down-conversion, filtering, amplification, and the like. Master routing device 110 can receive and transmit data via transceiver 111, and network device 120 can receive and transmit data via transceiver 121. In some embodiments, master routing device 110 and network device 120 may each include an antenna (not shown).
[0031] The storage device 112 and the storage device 122 are used to store data such as files, instructions, program codes, software modules, etc., and can be, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, or other similar devices, integrated circuits, or combinations thereof.
[0032] The processor 113 and the processor 123 may be, for example, a programmable general-purpose or special-purpose microprocessor, a digital signal processor (DSP), a programmable controller, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other similar devices or a combination of these devices.
[0033] Processor 113 can execute program code, software / firmware modules, instructions, etc. stored in storage device 112, and processor 123 can execute program code, software / firmware modules, instructions, etc. stored in storage device 122 to implement the method for establishing a VPN connection according to the disclosed embodiments. In other words, processor 113 and processor 123 are each configured to perform their respective corresponding operations described below.
[0034] Please refer to Figure 3 In step S301, the main routing device 110 and the network device 120 establish a connection to the mesh network 10. In detail, after the main routing device 110 is connected to the Internet, the network device 120 can establish a mesh network connection with the main routing device 110. For example, the user can combine the main routing device 110 and the network device 120 into a mesh WiFi system. In other words, the network device 120 can establish a connection with the main routing device 110 to construct the mesh network 10, and the network device 120 is a sub-routing device of the mesh network 10. In some embodiments, the main routing device 110 and the network device 120 can perform the auto configuration search / response in the Easymesh standard to establish a mesh network connection.
[0035] In step S302, master router 110 establishes a VPN server and generates a VPN configuration. Master router 110 then becomes the VPN server corresponding to this VPN configuration. Specifically, a user accesses the router management interface of master router 110 via a browser, selects an appropriate VPN protocol, and configures server settings within the router management interface. These VPN configurations may be, for example, a VPN profile, which may include the VPN server's username, password, VPN server address, port, key, or encryption method.
[0036] In some embodiments, the main routing device 110 can establish a VPN server based on a VPN protocol, such as the Wireguard protocol, Point to Point Tunneling Protocol (PPTP), Layer Two Tunneling Protocol (L2TP), OpenVPN protocol, or Internet Protocol Security (IPsec), etc., which is not limited in this disclosure.
[0037] In step S303, in response to generating the VPN settings, master router 110 synchronizes and transmits the VPN settings to network devices 120 in mesh network 10. Specifically, after master router 110 completes the establishment of the VPN server, master router 110 automatically synchronizes the VPN settings corresponding to the VPN server to one or more slave routers under master router 110.
[0038] In step S304, network device 120 receives and records the VPN configuration. Network device 120 may record the VPN configuration to storage device 122 of network device 120. Specifically, while network device 120 maintains a mesh network connection with master router 110, network device 120 may receive the VPN configuration from master router 110.
[0039] In step S305, network device 120 disconnects from master routing device 110. Specifically, network device 120 may be moved to another location and disconnected from master routing device 110. When network device 120 disconnects from master routing device 110, it is removed from mesh network 10 and no longer serves as a network access node for mesh network 10. For example, network device 120 may be brought from a user's home to a hotel. Alternatively, network device 120 may be moved from a parent company's office to a branch office.
[0040] In step S306, the network device 120 connects to the Internet. Specifically, after the network device 120 disconnects from the main router 110, the network device 120 can reconnect to the Internet. In some embodiments, the network device 120 can connect to the Internet based on a connection mode, such as a standalone router mode, a wireless repeater mode, a wireless access point mode, or a Wireless Internet Service Provider (WISP) mode. In some embodiments, the network device 120 can connect to the Internet based on a network protocol, such as Point-to-Point Protocol over Ethernet (PPPoE), Dynamic Host Configuration Protocol (DHCP), Static IP protocol, Point to Point Tunneling Protocol (PPTP), Layer Two Tunneling Protocol (L2TP), IPv6 protocol, or IPv4 protocol, but this disclosure is not limited to this.
[0041] In step S307, network device 120 determines whether it is connected to the internet via master router 110. Specifically, network device 120 determines whether it is connected to the internet via the mesh network of master router 110. In other words, network device 120 determines whether it serves as a network access point in the mesh network that includes master router 110.
[0042] In some embodiments, network device 120 may determine whether it is connected to the Internet via master routing device 110 based on the routing path of the packet. More specifically, network device 120 may determine whether it is connected to the Internet via master routing device 110 by determining whether the routing path of the packet includes the network address of master routing device 110. When the routing path of the packet includes the network address of master routing device 110, network device 120 may determine that network device 120 is connected to the Internet via master routing device 110. Conversely, when the routing path of the packet does not include the network address of master routing device 110, network device 120 may determine that network device 120 is not connected to the Internet via master routing device 110.
[0043] If the determination in step S307 is negative, in step S308, in response to not being connected to the Internet via master router 110, network device 120 determines to establish a VPN connection with master router 110 based on the VPN settings. Specifically, when network device 120 determines that it is not a slave router under master router 110, network device 120 may establish a VPN connection based on the VPN settings stored in storage device 122. Network device 120 may automatically establish a VPN connection with master router 110 based on the user name, user password, VPN server address, port, key, or encryption method specified in the VPN settings.
[0044] In some embodiments, network device 120 may use the username and password in the VPN settings to submit an authentication request to master router 110 for identity verification. If master router 110 determines that network device 120 has passed identity verification, master router 110, acting as a VPN server, may establish a VPN connection with network device 120, acting as a VPN client.
[0045] In some embodiments, after establishing a VPN connection with host routing device 110, network device 120 transmits packets from the terminal device to host routing device 110 via the VPN connection. Network device 120 modifies the packets sent by the terminal device using the VPN server address in the VPN settings, allowing the packets output by network device 120 to be transmitted to host routing device 110, thereby forming a virtual tunnel between network device 120 and host routing device 110.
[0046] If the answer in step S307 is yes, in step S309, network device 120 determines not to establish a VPN connection with master router 110 in response to being connected to the internet via master router 110. Specifically, when network device 120 determines that it is still a slave router under master router 110 and connected to the internet via master router 110, network device 120 does not establish a VPN connection with master router 110. Specifically, network device 120 does not establish a VPN connection with master router 110, i.e., it does not establish a VPN connection based on the VPN settings in storage device 122.
[0047] Please refer to Figure 4A, master router 110 and network device 120 are deployed by the user in a first location F1, such as the user's home. Master router 110 and network device 120 establish a mesh network 10. Master router 110 acts as a gateway to the internet, while network device 120 serves as a slave router under master router 110. Terminal device T41 connects to the internet via network device 120 and network device 120. After establishing a VPN server, master router 110 transmits the VPN settings to network device 120.
[0048] Next, please refer to Figure 4B , the user can move the network device 120 from the first place F1 to the second place F2, and the second place F2 is, for example, a hotel. When the user connects the network device 120 in the second place F2 to the Internet, the network device 120 will automatically establish a VPN connection between the network device 120 and the main routing device 110 according to the previously recorded VPN settings. Specifically, the network device 120 as a VPN client can establish a VPN connection with the main routing device 110 as a VPN server. In this way, the packets sent by the user's terminal device T42 in the second place F2 will be transmitted to the main routing device 110 via the VPN connection. It can be seen that in response to moving to the second place F2, the network device 120 can be converted into a gateway connected to the Internet and automatically establish a VPN connection with the main routing device 110.
[0049] It should be noted that in each embodiment of the present disclosure, Figures 1 to 4A and Figure 4B The network device 120 is a sub-routing device under the main routing device 110 and can establish a mesh network with the main routing device 110.
[0050] Please refer to Figure 5 , in step S510, the network device establishes a connection with the main routing device to construct a mesh network, wherein the network device is a sub-routing device of the mesh network. In step S520, the network device receives VPN settings from the main routing device, wherein the main routing device is a VPN server corresponding to the aforementioned VPN settings. In step S530, the network device determines whether to connect to the Internet via the main routing device. In step S540, in response to not connecting to the Internet via the main routing device, the network device decides to establish a VPN connection with the main routing device according to the VPN settings. Regarding the implementation and details of the above steps S510 to S540, please refer to the above Figures 1 to 4B The multiple embodiments have been described in detail and will not be repeated here.
[0051] In summary, in the embodiments disclosed herein, through the establishment of a mesh network, the main routing device serving as a VPN server can automatically synchronize VPN settings to the network device serving as a sub-routing device. Thus, when the network device is connected to the Internet without being a sub-routing device of the main routing device, the network device can automatically establish a VPN connection with the main routing device according to the VPN settings. Based on this, by carrying the network device to different fields, the automatic establishment of VPN connections disclosed herein can allow the user's private data to obtain VPN encryption protection in different fields without the need for cumbersome setup steps. In addition, by automatically establishing cross-regional VPN connections, not only can the coverage of the mesh network be effectively expanded, but terminal devices can also achieve cross-regional data access.
[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for establishing a virtual private network connection, characterized in that: The method comprises: A network device establishes a connection with a main routing device to construct a mesh network, wherein the network device is a sub-routing device of the mesh network; Receiving, by the network device, a VPN setting from the master routing device, wherein the master routing device is a VPN server corresponding to the VPN setting; The network device determines whether it is connected to the Internet via the main routing device; and In response to not being connected to the Internet via the primary routing device, the network device determines to establish a VPN connection with the primary routing device according to the VPN settings.
2. The method for establishing a virtual private network connection according to claim 1, characterized in that: The method further comprises: In response to connecting to the Internet via the primary routing device, the network device decides not to establish a VPN connection with the primary routing device.
3. The method for establishing a virtual private network connection according to claim 1, characterized in that: The method further comprises: The network device records the VPN settings to a storage device of the network device.
4. The method for establishing a virtual private network connection according to claim 1, characterized in that: The method further comprises: After the network device establishes the VPN connection with the main routing device, the network device transmits the packet from the terminal device to the main routing device according to the VPN connection.
5. The method for establishing a virtual private network connection according to claim 1, characterized in that: The step of determining whether the connection to the Internet is via the main routing device comprises: The network device determines whether to connect to the Internet via the main routing device according to the routing path of the packet.
6. The method for establishing a virtual private network connection according to claim 1, characterized in that: The method further comprises: The VPN server is established by the master routing device to generate the VPN settings; and In response to generating the VPN settings, the master routing device synchronously transmits the VPN settings to the network devices in the mesh network.
7. A network device, characterized in that: include: Transceiver; Storage device; as well as A processor, coupled to the transceiver and the storage device, is configured to: Establishing a connection with a main routing device to construct a mesh network, wherein the network device is a sub-routing device of the mesh network; receiving VPN settings from the master routing device, wherein the master routing device is a VPN server corresponding to the VPN settings; Determining whether the main routing device is connected to the Internet; as well as In response to not connecting to the Internet via the primary routing device, determining to establish a VPN connection with the primary routing device according to the VPN settings.
8. The network device according to claim 7, characterized in that: The processor is also configured to: In response to connecting to the Internet via the primary routing device, it is determined not to establish a VPN connection with the primary routing device.
9. The network device according to claim 7, characterized in that: The processor is also configured to: The VPN settings are recorded to a storage device of the network device.
10. The network device according to claim 7, characterized in that: The processor is also configured to: After the VPN connection with the main routing device is established, packets from the terminal device are transmitted to the main routing device according to the VPN connection.
11. The network device according to claim 7, characterized in that: The processor is also configured to: Determine whether the packet is connected to the Internet via the main routing device according to the routing path of the packet.
