Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a VPN networking method for redirecting the access data of an external network, which can change the direct access of the access data of the network outside the VPN networking on terminal equipment such as a mobile phone and the like into the access of the access data of the network outside the VPN networking through a communication channel in the networking, and the access after forwarding by a router, thereby enabling members in the networking to fully use the networking function and conveniently counting all data traffic of the members. The invention also provides a VPN networking system for realizing the method.
The invention is realized by the following technical scheme:
a VPN networking method for redirecting access data of an external network, comprising the steps of:
S1, establishing a networking environment, namely adding at least one VPN router supporting a network forwarding function and at least one terminal device into the same VPN network through a VPN server by utilizing a VPN technology at a networking control end, wherein a VPN networking program is installed on the terminal device, and the VPN router is embedded with a corresponding VPN networking program. The terminal device and the VPN router may be in the same network or in different networks.
S2, starting a unified network outlet function, namely after a network outlet of the terminal equipment is set as one of the VPN routers at a networking control end, restarting a VPN networking program on the terminal equipment, receiving all network data traffic on the terminal equipment by adding an open route mode according to configuration information by the VPN networking program, and transferring the network data traffic in the networking according to the flow direction of the traffic or forwarding the network data traffic to the set VPN router by the VPN networking program, and forwarding the network data traffic by the VPN router to complete the unified network outlet function so as to be convenient for counting the traffic of each terminal equipment.
Further, when the VPN networking program in the step S2 receives all network data traffic on the terminal equipment, the method further comprises the steps of establishing mqtt long connection, monitoring the change of network outlet configuration information in real time through the mqtt long connection, if the network outlet configuration information is detected to be changed, disconnecting the VPN connection, restarting the VPN networking program, adding an open route according to the changed network outlet configuration information, receiving all network data traffic on the terminal equipment, and forwarding the traffic to a newly configured VPN router through the VPN networking program.
In the step S2, the flow flows in the networking or are forwarded to the VPN router through a VPN networking program according to the flow directions of the flow flows, and then the VPN router forwards the flow; if the traffic is the traffic outside the networking, the members in the VPN networking are screened, the information of the members of the VPN router set as the network outlet is screened, the data is forwarded to the members of the VPN router through the communication channel in the VPN networking, and then the data is forwarded by the data forwarding function of the members of the VPN router.
Further, the method comprises the step of verifying whether the network outlet setting is effective, wherein the method comprises the steps of carrying out packet grabbing on the bound VPN router to check whether the network outlet setting of the terminal equipment is effective, or judging whether the network outlet setting is effective by inquiring the ip address of the terminal equipment, and if the ip address is consistent with the bound VPN router, evaluating that the network outlet setting is effective.
Further, querying the ip address of the terminal device may be performed on a browser of the terminal device.
Further, the step S1 comprises the steps of firstly determining members needing networking, and then adding each networking member at a networking control end according to the SN/UID/SID of the networking member, if the networking member is not in a member list, adding the networking member in a member adding mode.
In step S2, the device terminal logs in to the VPN networking program through the account password, and after logging, actively queries configuration information of its network outlet.
Further, the VPN router is bound with an account number and a password.
Further, the terminal equipment is an android mobile phone or an android tablet.
A VPN networking system for redirecting external network access data adopts the VPN networking method for redirecting external network access data, and comprises a networking control program, a VPN server, at least one VPN router and at least one terminal device, wherein each terminal device is used for networking through the VPN server and the networking control program, each terminal device is provided with the VPN networking program, the networking control program can be installed on a PC, the VPN router is connected with the networking control program, the VPN router is embedded with the corresponding VPN networking program and has a network forwarding function, and the network outlet of the terminal device is set as one of the VPN routers on the networking control program.
The invention sets VPN router for transmitting data in networking, and sets the network outlet of terminal equipment such as mobile phone as the VPN router, so that all flow data of terminal equipment flows through the VPN router, concretely, the data in networking flows in networking directly, the data outside networking is transmitted through the outlet router, thus realizing redirecting all external network access data outside VPN networking to VPN networking, supporting the complete use of networking function by member equipment in networking, for example, ensuring the safety of data, enjoying alarming strategy in networking, monitoring large screen, accelerating and limiting speed limit, limiting operation of access of internal network and external network, and simultaneously counting the data flow of all members in networking.
Detailed Description
A VPN networking method for redirecting access data of an external network, comprising the steps of:
S1, establishing a networking environment, namely adding at least one VPN router supporting a network forwarding function and at least one terminal device into the same VPN network by using a VPN technology through a VPN server at a networking control end, so that the networking environment is established.
As shown in FIG. 1, a VPN network comprises a VPN server, at least one VPN router and a terminal device, wherein the VPN router is used for network forwarding, a corresponding VPN networking program is embedded in the router, the VPN router can be used as a networking member to be added into a VPN networking environment, the terminal device can be a mobile phone, a tablet and the like, the VPN router and the terminal device can be in the same network or not in the same network, and interconnection and intercommunication among the devices can be realized through VPN. The networking members can be set according to the actual situation, as shown in fig. 2, a plurality of mobile phones, PCs and other terminal devices are arranged, and can mutually access through VPN networking, and can also remotely access a resource server and an intranet. And the terminal equipment is provided with a VPN networking program.
The networking method comprises the specific steps of determining members needing networking, and adding networking members according to SN/UID/SID of the networking members at a networking control end, wherein if the networking members are not in a member list, the networking members are added in a member adding mode.
The VPN router is bound with an account, a networking control end can be logged in through the account, and the router can be searched on the networking control end through the account. The terminal equipment is also registered and allocated with an account number and password, the VPN networking program can be logged in through the account number and password, after the VPN networking program is started, a virtual ip address in a network is allocated, and the communication of the members in the network can be carried out through the virtual ip, so that the operations of resource access, sharing and the like can be realized in the network.
S2, starting a unified network outlet function, namely carrying out networking configuration at a networking control end, setting a network outlet of terminal equipment as one of the VPN routers, restarting a VPN networking program on the terminal equipment after the configuration is completed, logging in the VPN networking program by an account number password, actively inquiring configuration information of the network outlet after logging in, receiving all network data traffic on the terminal equipment according to the configuration information by adding an open route mode, and transferring the network data traffic in the networking according to the flow direction of the traffic or forwarding the network data traffic to the set VPN router by the VPN networking program, wherein the VPN router is used for forwarding, and compared with the general networking, the VPN router only can count traffic data in the networking and cannot count data outside the networking.
If there is a plurality of VPN routers in the network, the network outlet of each terminal device in the network can be set as any one of the VPN routers according to the situation. If the network where the terminal equipment is located is already connected with a router, then the network outlet of the terminal equipment is set as another VPN router, the network flow of the terminal equipment firstly passes through the router of the network where the terminal equipment is located, then flows to the VPN router set as the network outlet, and finally the data is forwarded.
When the VPN networking program in the S2 step receives all network data traffic on the terminal equipment, as shown in fig. 4, the method further comprises the steps of establishing mqtt long connection, monitoring the change condition of the network outlet configuration information of the terminal equipment in real time through the mqtt long connection, disconnecting the VPN connection if the network outlet configuration information is detected to be changed, restarting the VPN networking program, adding open routes according to the changed network outlet configuration information, receiving all network data traffic on the terminal equipment, and forwarding the traffic to a newly configured VPN router through the VPN networking program. If not, the VPN networking state is continuously maintained.
The method for transferring the data flow comprises the steps that a VPN networking program detects whether the forwarded flow is the flow in the networking, if the forwarded flow is the flow in the networking, the flow is forwarded in the networking through a VPN server, the process is the same as the flow of data in the networking when the conventional VPN is networking, if the forwarded flow is the flow outside the networking, members in the VPN networking are screened, member information set as a network outlet is screened, the data is forwarded to the members through a communication channel in the VPN networking, and then the data is forwarded through a data forwarding function on the members.
After the network egress setup, it may also be verified whether the network egress setup is valid by (1) performing a packet-grabbing on the bound VPN router to see if the network egress setup of the terminal device is valid. (2) Judging whether the network outlet setting is effective or not by inquiring the ip address of the terminal equipment, if the ip address is consistent with the VPN router bound with the terminal equipment, evaluating the network outlet setting to be effective, and inquiring the ip address of the terminal equipment can be carried out on a browser of the terminal equipment.
The following illustrates specific setup and operation steps of the networking control end of the present invention, and specific embodiments of the present invention.
1. Networking, as shown in fig. 5, a "remote networking" menu is set on the networking control terminal platform interface, a "network member" option is set under the networking control terminal platform interface, a member list is displayed in the "network member" card, and the SN/UID/SID number, intranet IP, virtual IP and the like of the member can be checked from the member list. When the member is not in the list, the member can be added through the function box of 'add member' on the interface, the member comprises 'hardware member' and 'software member', the hardware member refers to a router which can be used for forwarding data, at least one hardware member, namely a VPN router, needs to exist in one VPN network, and the software member is terminal equipment, such as a mobile phone, a tablet and the like. And adding the hardware and the software into the same networking to complete the networking.
The networking control end platform is only required to be installed on a PC capable of networking, the hardware member VPN router is bound with an account, and networking can be completed on the platform through the account and the login networking control end platform. The software member terminal equipment is provided with a corresponding VPN networking program, and after registering the account number and the password, the user can log in the VPN networking program to finish subsequent operation.
2. Setting a software member network outlet, specifically, as shown in fig. 6 and fig. 7, selecting a corresponding software member at a networking control end platform, selecting more- > network outlet options in a member operation column, selecting a corresponding VPN router in a popup window, wherein the VPN router is also a hardware member in the networking, and changing the state into an open state. The terminal device does not need to be connected with the network of the router, and a 5G network or wifi capable of connecting with other networks can be used.
3. Taking a mobile phone as an example, a software member logs in the software member through an account password on a VPN networking program installed on the mobile phone, and after logging in successfully, configuration information of a network outlet can be actively inquired.
4. The mobile phone end opens the VPN networking program again, in the networking process, the mobile phone end can check the network outlet configuration information, if the configured network outlet function is detected, the VPN networking program can additionally increase an open route for receiving all network data traffic (i.e. traffic generated by all software on the mobile phone) on the mobile phone equipment when the VPN is created, and meanwhile, the VPN networking program can monitor the change of the network outlet configuration information in real time through the established mqtt long connection. If the VPN is changed, the VPN is disconnected, and then the network is re-established according to the changed information, and if the VPN is not changed, the networking state of the VPN is maintained.
5. When the mobile phone terminal sends data, the VPN networking program can detect whether the data are the flow in the networking, if the data are the flow in the networking, the flow still can be transmitted in the networking through the VPN server, if the data are the flow outside the networking, the VPN member can be screened for one time, a router which is set as an outlet is screened, the data are forwarded to the router member through a communication channel (a forwarding channel and a p2p channel) in the networking, and then the data are forwarded by a data forwarding function on the member, so that the specific sending flow is shown in the figure. In this way, the flow data used on the mobile phone can be unified to the router in the networking and sent out under any network, and the network access data outside the VPN networking on the mobile phone is changed from direct access to access after passing through a communication channel in the networking once and is accessed after being forwarded by the router.
A VPN networking system for redirecting external network access data adopts the VPN networking method for redirecting external network access data, and comprises a VPN router, terminal equipment, networking control programs and a VPN server, wherein at least one of the VPN router and the terminal equipment can be as shown in fig. 8, and also can comprise a plurality of VPN routers and a plurality of terminal equipment as shown in fig. 2, 9 and 10, each terminal equipment carries out networking through the VPN server and the networking control programs, each terminal equipment is provided with the VPN networking program, the networking control programs are arranged at the networking control end, the networking control programs can be arranged on a PC, the VPN router is connected with the networking control programs, the VPN router is embedded with corresponding VPN networking programs and has a network forwarding function, and the network outlet of the terminal equipment is set as one of the VPN routers on the networking control programs. The VPN router and the terminal device may be in the same network or in different networks, and only need to be in environments with networks. The VPN server side is used for providing networking control function and can comprise a server, wherein the VPN server side distributes virtual IP to each member accessing to the networking through a networking control program so as to realize networking function and realize external network access data redirection through the method.
Taking fig. 2 as an example, terminal devices (mobile phones and PCs) in the networking are networked through a VPN server, the networking further comprises an internal corporate network, and a resource server connected in the networking through a VPN router, the resource server can provide data resources, after a network outlet of the terminal devices is set as the VPN router in the networking, the terminal devices (mobile phones and PCs) can share the resources provided by the resource server, can access the internal network and can also access the external network, and data forwarding is performed between the terminal devices and the external network through the set VPN router, namely, the data traffic of the external network is also in the VPN networking, the traffic of the terminal devices can be easily counted, and meanwhile, the terminal devices can also enjoy complete networking functions, such as ensuring the safety of data, high data flow rate and the like, because the internal and external data are all in the networking.
The foregoing detailed description is directed to embodiments of the invention which are not intended to limit the scope of the invention, but rather to cover all modifications and variations within the scope of the invention.