Address switching method, device, client and storage medium applicable to VPN
By automatically switching the IP address of the VPN client, the cumbersome problem of users manually switching IP addresses in case of VPN service failure is solved, the address switching efficiency is improved, and detailed error reporting information processing is provided.
Patent Information
- Application Number
- CN202310172382.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-02-24
AI Technical Summary
When the VPN service fails, existing VPN technology requires users to manually switch IP addresses, which is cumbersome and inefficient.
Provide an address switching method suitable for VPN, which automatically switches between intranet IP and public IP by obtaining user requests, replacing and switching Internet protocol addresses, avoiding manual operations by users.
When the VPN service fails, the IP address is automatically switched, which improves the efficiency of address switching, realizes seamless switching between the VPN service and the public network server, and helps users handle exceptions by outputting different error messages.
Smart Images

Figure CN116346766B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of virtual private networks, and more specifically, to an address switching method, device, client, and storage medium applicable to VPN. Background Art
[0002] Currently, in order to improve the security of enterprise business-related data, the client will use a virtual private network (VPN) to encrypt the network, and the server's Internet Protocol address (IP address) also uses an intranet IP address, which can only be accessed using a VPN and cannot be accessed through a public IP address.
[0003] VPN service is a remote access technology, which means establishing a private network on a public network for encrypted communication. A complete set of VPN services includes a VPN server and VPN software installed on the client. The VPN server uses a public IP address and can access the business server in the intranet. Specifically, after the client activates the VPN software, it will encrypt the network request and forward it to the VPN server. After the VPN server forwards it to the business processor, it will send the response back to the client to achieve data encryption during the entire request process.
[0004] The business server is configured with two IP addresses, one for the intranet IP address and one for the public IP address. The public IP address is blocked by the firewall by default. Due to the risk of VPN service failure, after the VPN service fails, the client cannot use the intranet IP address to access the business server. At this time, the backup address needs to be enabled. The backup address is the public IP address to ensure that the business server can still process the requests initiated by the user normally.
[0005] However, in the traditional solution, the user manually configures the IP address through software on the client, and when any of the intranet IP address or the public network IP address fails to be accessed, the user manually switches the currently configured IP address to another IP address. This solution has high requirements on user operation and is also very cumbersome. Summary of the invention
[0006] In view of at least one defect or improvement need in the prior art, the present invention provides an address switching method, device, client and storage medium suitable for VPN. In the event of a VPN service failure, the user does not need to manually switch the IP address currently configured on the client, thereby improving the efficiency of address switching.
[0007] To achieve the above-mentioned purpose, according to a first aspect of the present invention, there is provided an address switching method applicable to VPN, which is applied to a client, the client is connected to a service server network, the client and the service server are both configured with an intranet Internet Protocol address and a public Internet Protocol address, the client is installed with VPN software, and is used to initiate a request to the service server through the intranet Internet Protocol address, VPN software and VPN server, or initiate a request to the service server through the public Internet Protocol address; the method comprises:
[0008] Get user request;
[0009] According to the currently configured Internet Protocol address, replacing the Internet Protocol address requested by the user with the currently configured Internet Protocol address;
[0010] In case of abnormal response to user request, switch the currently configured Internet Protocol address;
[0011] Returns the currently configured Internet Protocol address and replaces the Internet Protocol address requested by the user with the currently configured Internet Protocol address.
[0012] Further, in the event of an abnormal response to a user request, the currently configured Internet Protocol address is switched, including in the event of an abnormal response to a user request, determining whether it is the first time to switch the currently configured Internet Protocol address; if so, switching the currently configured Internet Protocol address.
[0013] Further, in the case of an abnormal response to a user request, the currently configured Internet Protocol address is switched, including in the case of an abnormal response to the user request and the currently configured Internet Protocol address is an intranet Internet Protocol address, determining whether Internet connectivity is normal; in the case of normal Internet connectivity, determining whether the VPN server is connected normally; in the case of an abnormal connection to the VPN server, determining whether the VPN server is faulty; in the case of a VPN server fault, shutting down the VPN server and switching the currently configured Internet Protocol address to a public Internet Protocol address.
[0014] Furthermore, the above-mentioned address switching method applicable to VPN also includes outputting a first error message when the user request response is abnormal, the Internet connectivity is normal, and the VPN server connection is normal, and the first error message includes that the network environment where the VPN server is located is unstable.
[0015] Furthermore, the above-mentioned address switching method applicable to VPN also includes outputting a second error message when the user request response is abnormal, the Internet connectivity is normal, the VPN server connection is abnormal, and the VPN server has no faults, and the second error message includes a business server failure, a business server business complexity, or a VPN server business complexity.
[0016] Furthermore, in the event of an abnormal response to a user request, the currently configured Internet Protocol address is switched, including in the event of an abnormal response to the user request and the currently configured Internet Protocol address is a public Internet Protocol address, switching the currently configured Internet Protocol address to an intranet Internet Protocol address; starting a VPN server, and waiting for the VPN server to connect until the VPN server is successfully connected.
[0017] Furthermore, the above-mentioned address switching method applicable to VPN also includes switching the currently configured Internet Protocol address to an intranet Internet Protocol address when the user request response is abnormal and the currently configured Internet Protocol address is a public Internet Protocol address; starting the VPN server and waiting for the VPN server to connect; and when the VPN server connection fails, outputting a third error message, the third error message including the VPN server connection failure.
[0018] According to a second aspect of the present invention, there is also provided an address switching device applicable to VPN, which is applied to a client, the client is connected to a business server network, the client and the business server are both configured with an intranet Internet Protocol address and a public Internet Protocol address, the client is installed with VPN software, and is used to initiate a request to the business server through the intranet Internet Protocol address, VPN software and VPN server, or initiate a request to the business server through the public Internet Protocol address; the device comprises:
[0019] An acquisition module, configured to acquire a user request;
[0020] a replacement module configured to replace the Internet Protocol address requested by the user with the currently configured Internet Protocol address according to the currently configured Internet Protocol address;
[0021] a switching module configured to switch a currently configured Internet Protocol address in case of an abnormal response to a user request;
[0022] The return module is configured to return the Internet Protocol address according to the current configuration, and replace the Internet Protocol address requested by the user with the Internet Protocol address of the current configuration.
[0023] According to the third aspect of the present invention, there is also provided a client, which includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of any one of the above-mentioned methods.
[0024] According to a fourth aspect of the present invention, there is also provided a storage medium storing a computer program executable by a client, wherein when the computer program runs on the client, the client executes the steps of any one of the above methods.
[0025] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0026] (1) By obtaining a user request, executing two rounds of replacing the user requested Internet Protocol address with the currently configured Internet Protocol address according to the currently configured Internet Protocol address, and switching the currently configured Internet Protocol address when the user request response is abnormal, the VPN service can automatically switch to the currently configured Internet Protocol address when a VPN service fails, without the need for manual switching by the user, thereby achieving seamless switching between the VPN service and the public network server by the client, thereby achieving the purpose of improving the efficiency of address switching;
[0027] (2) By outputting different error messages, including unstable network environment where VPN server is located, business server failure, business server business complexity, VPN server business complexity, business server failure, and VPN server connection failure, users can be prompted to handle exceptions according to different error messages. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 An application environment diagram of an address switching method applicable to VPN provided in an embodiment of the present application;
[0030] Figure 2 A flowchart of an address switching method applicable to a VPN provided in an embodiment of the present application;
[0031] Figure 3 A flowchart of an address switching method applicable to a VPN provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the structure of an address switching device applicable to VPN provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of the structure of a client provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0035] The terms "first", "second", "third", "fourth", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0036] The address switching method applicable to VPN provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the client communicates with the business server through the network. The client can be, but is not limited to, various smart phones and tablet computers. The business server can be implemented with an independent server or a server cluster composed of multiple servers, and the business server is set in the enterprise intranet.
[0037] Both the client and the business server are configured with an intranet Internet Protocol address (referred to as the intranet address) and a public Internet Protocol address (referred to as the public address). The public address of the business server is blocked by the firewall by default. The client is installed with VPN software. The client can connect to the VPN server through the VPN software, and then initiate a request to the business server to access the enterprise intranet data through the intranet address after the VPN server is successfully connected; the client can also directly initiate a request to the business server to access the enterprise intranet data through the public address, so that in the case of VPN server connection failure and VPN server failure, a request to the business server to access the enterprise intranet data can be initiated through the public address.
[0038] like Figure 2 As shown, a method for address switching applicable to VPN is provided, which is executed by a client and includes the following steps:
[0039] Step 201, obtaining a user request.
[0040] Among them, the user request is a request initiated by the user through the client to access the intranet data, and the Internet Protocol address requested by the user defaults to the intranet address.
[0041] Exemplarily, the client adds an interceptor in the Android network framework to intercept requests initiated by users.
[0042] Step 202: According to the currently configured Internet Protocol address, replace the Internet Protocol address requested by the user with the currently configured Internet Protocol address.
[0043] Exemplarily, when the Internet Protocol address requested by the user is an intranet address, if the Internet Protocol address currently configured on the client is an intranet address, the Internet Protocol address requested by the user remains unchanged; if the Internet Protocol address currently configured on the client is a public network address, the Internet Protocol address requested by the user is replaced with a public network address.
[0044] In the case where the Internet Protocol address requested by the user is a public network address, if the Internet Protocol address currently configured on the client is a public network address, the Internet Protocol address requested by the user remains unchanged; if the Internet Protocol address currently configured on the client is an intranet address, the Internet Protocol address requested by the user is replaced with the intranet address.
[0045] Step 203: When the user request response is abnormal, switch the currently configured Internet Protocol address.
[0046] Exemplarily, after replacing the Internet Protocol address requested by the user with the currently configured Internet Protocol address according to the currently configured Internet Protocol address, the client will formally initiate a request, and each request will be monitored through the exception capture function in the client software. If SocketTimeoutException (representing request timeout) or ConnectException (representing connection error) is captured, it is determined that the user request response is abnormal, and in the case of an abnormal user request response, the currently configured Internet Protocol address is switched.
[0047] Since the reasons for the abnormal response to the user request include abnormal VPN server connection, at least one failure in the VPN server or the business server, etc., in the case of an abnormal response to the user request, it will be determined whether to switch the currently configured Internet Protocol address based on whether it has been retried once.
[0048] In one embodiment, when the user request response is abnormal, before switching the currently configured Internet Protocol address, it is necessary to determine whether it is the first time to switch the currently configured Internet Protocol address; if so, switch the currently configured Internet Protocol address; if not, output an error message, and the error message includes that both the VPN server and the business server are faulty.
[0049] Step 204, returning according to the currently configured Internet Protocol address, replacing the Internet Protocol address requested by the user with the currently configured Internet Protocol address.
[0050] Exemplarily, when the client switches the currently configured Internet Protocol address for the first time in the case of abnormal user request response, it returns to the above step 202, replaces the Internet Protocol address requested by the user with the currently configured Internet Protocol address according to the currently configured Internet Protocol address, and executes steps 202 and 203 again, so as to achieve a maximum of two rounds of steps 202 and 203 for one user request, namely: when the public network address cannot be accessed, switch to the intranet address, and test whether the intranet address is successfully accessed; and when the intranet address cannot be used, switch to the public network address, and test whether the public network address is successfully accessed, so that an error can be reported for the situation where both the VPN server and the business server fail. In addition, the abnormal response of the first round of user request will not be displayed to the user, and only when both rounds fail will the error message be output and a pop-up window will be prompted to the user.
[0051] There are two situations in which both the VPN server and the business server fail. The first situation is that the server cannot be accessed using the public network address, and the server still cannot be accessed after switching to the intranet address. The second situation is that the server cannot be accessed using the intranet address, and the server still cannot be accessed after switching to the public network address.
[0052] In the above-mentioned address switching method applicable to VPN, by obtaining the user request, two rounds of execution are performed according to the currently configured Internet Protocol address, and the Internet Protocol address requested by the user is replaced with the currently configured Internet Protocol address. In the case of an abnormal response to the user request, the currently configured Internet Protocol address is switched. In the case of a failure in the VPN service, it can automatically switch to the currently configured Internet Protocol address without the need for manual switching by the user, thereby achieving seamless switching of the client between the VPN service and the public network server, thereby achieving the purpose of improving the efficiency of address switching.
[0053] In one embodiment, Figure 3 As shown, an address switching method suitable for VPN is provided.
[0054] Step 1: Add an interceptor to the Android network framework to intercept requests initiated by users.
[0055] Step 2: Two sets of IP addresses (intranet address and public network address) will be stored inside the client software. Each intercepted request will replace the requested IP address according to the current configuration (using the public network address or intranet address) and initiate the request.
[0056] Step 3: Switch IP address and retry after request error
[0057] After the IP address is replaced, a request will be formally initiated, and each request will be monitored through the Java exception capture function. If SocketTimeoutException (representing a request timeout) or ConnectException (representing a connection error) is captured, it can be determined that the request is abnormal, and it is considered that there is a problem with the VPN server or business server. The next step will be to determine whether to switch the IP address:
[0058] 3.1. The current configuration uses the intranet address: First test the Internet connectivity. This can be achieved by pinging (ping is an Internet packet explorer used to test network connections) a public DNS such as (233.5.5.5). If there is no problem with the ping, it means that the public network address is valid, and request the business server to enable public network access; after receiving the request, the business server will test whether the VPN server is connected normally. The VPN server connection abnormality means that the client cannot connect to the VPN server through the public network. The VPN server connection abnormality may be that the VPN server is busy or complex in business processing, or it may be that the VPN server is faulty; if the VPN server connection is abnormal, test whether the VPN server is faulty. If the VPN server is faulty, shut down the VPN server, remove the firewall restrictions, allow access to the business server through the public network address, and respond to the client request. After receiving the request, the client switches the current configuration to use the public network address and repeats step 2;
[0059] If the VPN server connection is normal, an error is thrown normally and the first error message is displayed to the user. The first error message is that the network environment of the public network where the VPN server is located is unstable;
[0060] If the VPN server connection is abnormal and the VPN server has no faults, an error is thrown normally and the second error message is displayed to the user. The second error message is that the service server is faulty, the service server service is complex or the VPN server service is complex.
[0061] 3.2. The current configuration is to use the public network address: switch the current configuration to use the intranet address, start the VPN server, and wait for the VPN server to connect successfully. If the VPN server is connected successfully, repeat step 2, otherwise an error is thrown normally and the third error message is displayed to the user. The third error message is that the VPN server connection failed.
[0062] For the above steps 2 and 3, a request is executed at most twice (i.e., step 1, step 2, step 3, step 2, step 3, where step 2 and step 3 are executed at most twice). The exception in the first round of requests will not be displayed to the user. If both rounds of IP address switching fail, it means that both the business server and the VPN server are faulty, and the backup address is not enabled. At this time, an error is thrown normally and a pop-up window prompts the user.
[0063] Both rounds of IP address switching are handled silently in the background of the client software. All the user sees is that the loading animation on the client display screen will be longer than normal. The user will not perceive that a network request has been attempted twice, thus achieving a seamless switching effect.
[0064] In this embodiment, by obtaining a user request, two rounds of replacing the Internet Protocol address requested by the user with the currently configured Internet Protocol address are executed according to the currently configured Internet Protocol address. In the case of an abnormal response to the first user request, the currently configured Internet Protocol address is switched. In the case of an abnormal connection to the VPN server and a VPN server failure, the currently configured Internet Protocol address can be automatically switched without manual switching by the user, thereby achieving the purpose of improving the address switching efficiency; and in the case of an abnormal response to the second user request, an error message is output, which can prompt the user to perform exception processing according to different error messages.
[0065] Based on the same inventive concept, the embodiment of the present application also provides an address switching device applicable to VPN for implementing the above-mentioned address switching method applicable to VPN. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more address switching devices applicable to VPN provided below can refer to the limitations of the address switching method applicable to VPN above, and will not be repeated here.
[0066] like Figure 4 As shown, the present application also provides an address switching device 400 suitable for VPN, which includes an acquisition module 401, which is configured to obtain a user request; a replacement module 402, which is configured to replace the Internet Protocol address requested by the user with the currently configured Internet Protocol address according to the currently configured Internet Protocol address; a switching module 403, which is configured to switch the currently configured Internet Protocol address in the event that the user request response is abnormal; and a return module 404, which is configured to return the currently configured Internet Protocol address and replace the Internet Protocol address requested by the user with the currently configured Internet Protocol address.
[0067] Each module in the above-mentioned address switching device applicable to VPN can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the client in the form of hardware, or can be stored in the memory in the client in the form of software, so that the processor can call and execute the corresponding operations of each module above.
[0068] The present application also provides a client, which can be a mobile device, such as an Android smartphone or tablet computer, and its internal structure diagram can be as shown in Figure 5 As shown. The client includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the client is used to provide computing and control capabilities. The memory of the client includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the client is used to exchange information between the processor and an external device. The communication interface of the client is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an address switching method suitable for VPN is implemented. The display unit of the client is used to form a visually visible picture, which can be a display screen, and the display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the client can be a touch layer covered on the display screen, or a button set on the client shell, etc.
[0069] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the client to which the solution of the present application is applied. The specific client may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0070] The present application also provides a client, which includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps in the above-mentioned method embodiments.
[0071] The present application also provides a computer-readable storage medium, which stores a computer program executable by a client, and when the computer program is run on the client, the client executes the steps in the above-mentioned method embodiments. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0072] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0073] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0074] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0075] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0076] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0077] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for a client to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.
[0078] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0079] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
[0080] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0081] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An address switching method applicable to VPN, characterized in that: Applied to a client, the client is connected to a business server network, the client and the business server are both configured with an intranet Internet Protocol address and a public Internet Protocol address, the client is installed with VPN software, and is used to initiate a request to the business server through the intranet Internet Protocol address, the VPN software and the VPN server, or initiate a request to the business server through the public Internet Protocol address; the method comprises: Get user request; According to the currently configured Internet Protocol address, replacing the Internet Protocol address requested by the user with the currently configured Internet Protocol address; In the case where the user request response is abnormal, switching the currently configured Internet Protocol address, which includes, in the case where the user request response is abnormal, determining whether it is the first time to switch the currently configured Internet Protocol address; if so, switching the currently configured Internet Protocol address; in the case where the user request response is abnormal and the currently configured Internet Protocol address is a public network Internet Protocol address, switching the currently configured Internet Protocol address to an intranet Internet Protocol address; starting the VPN server and waiting for the VPN server to connect until the VPN server is successfully connected; The currently configured Internet Protocol address is returned, and the Internet Protocol address requested by the user is replaced with the currently configured Internet Protocol address.
2. The method according to claim 1, characterized in that When the user request response is abnormal, switching the currently configured Internet Protocol address includes: In the case where the user request response is abnormal and the currently configured Internet Protocol address is an intranet Internet Protocol address, determining whether Internet connectivity is normal; Under the condition that the Internet connectivity is normal, determining whether the VPN server is connected normally; In the case where the VPN server connection is abnormal, determining whether the VPN server is faulty; In the event of a failure of the VPN server, the VPN server is shut down and the currently configured Internet Protocol address is switched to a public Internet Protocol address.
3. The method according to claim 2, characterized in that The method further comprises: When the user request response is abnormal, the Internet connectivity is normal, and the VPN server connection is normal, a first error message is output, wherein the first error message includes that the network environment where the VPN server is located is unstable.
4. The method according to claim 2, characterized in that The method further comprises: When the user request response is abnormal, the Internet connectivity is normal, the VPN server connection is abnormal, and the VPN server has no faults, second error information is output, and the second error information includes that the business server is faulty, the business server business is complex, or the VPN server business is complex.
5. The method according to claim 1, characterized in that The method further comprises: If the user request response is abnormal and the currently configured Internet Protocol address is a public Internet Protocol address, switching the currently configured Internet Protocol address to an intranet Internet Protocol address; Starting the VPN server and waiting for the VPN server to connect; When the VPN server connection fails, third error information is output, wherein the third error information includes the VPN server connection failure.
6. An address switching device suitable for VPN, characterized in that: Applied to a client, the client is connected to a business server network, the client and the business server are both configured with an intranet Internet Protocol address and a public Internet Protocol address, the client is installed with VPN software, and is used to initiate a request to the business server through the intranet Internet Protocol address, the VPN software and the VPN server, or initiate a request to the business server through the public Internet Protocol address; The device comprises: An acquisition module, configured to acquire a user request; A replacement module, configured to replace the Internet Protocol address requested by the user with the currently configured Internet Protocol address according to the currently configured Internet Protocol address; a switching module configured to switch the currently configured Internet Protocol address when the user request response is abnormal, including determining whether it is the first time to switch the currently configured Internet Protocol address when the user request response is abnormal; if so, switching the currently configured Internet Protocol address; when the user request response is abnormal and the currently configured Internet Protocol address is a public Internet Protocol address, switching the currently configured Internet Protocol address to an intranet Internet Protocol address; starting the VPN server and waiting for the VPN server to connect until the VPN server is successfully connected; A return module is configured to return the Internet Protocol address according to the current configuration, and replace the Internet Protocol address requested by the user with the Internet Protocol address of the current configuration.
7. A client, characterized in that: The method comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of the method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: It stores a computer program executable by a client, and when the computer program runs on the client, the client executes the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Fault detection method and business provider edge (PE) equipment
CN102195822A