CN110912759B - Automatic connection method and system for VPN network abnormity - Google Patents

Automatic connection method and system for VPN network abnormity Download PDF

Info

Publication number
CN110912759B
CN110912759B CN201911397407.1A CN201911397407A CN110912759B CN 110912759 B CN110912759 B CN 110912759B CN 201911397407 A CN201911397407 A CN 201911397407A CN 110912759 B CN110912759 B CN 110912759B
Authority
CN
China
Prior art keywords
vpn
client
server
restarting
vpn server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911397407.1A
Other languages
Chinese (zh)
Other versions
CN110912759A (en
Inventor
古欣
邵慧
赵光振
刘宝泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Youren Networking Co ltd
Original Assignee
Shandong Youren Networking Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Youren Networking Co ltd filed Critical Shandong Youren Networking Co ltd
Priority to CN201911397407.1A priority Critical patent/CN110912759B/en
Publication of CN110912759A publication Critical patent/CN110912759A/en
Application granted granted Critical
Publication of CN110912759B publication Critical patent/CN110912759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

The invention discloses a method and a system for automatic connection of VPN network abnormity, which comprises the following steps: establishing connection between the VPN client and the VPN server; detecting whether the VPN client acquires an IP address distributed to the client by the VPN server, and judging whether a VPN tunnel between the VPN client and the VPN server exists or not; if so, the VPN client side is normally connected with the VPN server, otherwise, the next step is carried out; after the set time is delayed, whether the VPN client side obtains the IP address is detected again, and if the IP address is not detected for N times continuously, the VPN client side is restarted; after restarting, re-detecting whether the VPN client acquires the IP address distributed to the client by the VPN server; until detecting that the VPN client is normally connected with the VPN server. The invention can automatically detect the connection state of the VPN network, and can realize the automatic reconnection of the VPN network when the network is abnormal, thereby ensuring the operation reliability of the VPN network.

Description

Automatic connection method and system for VPN network abnormity
Technical Field
The invention relates to the technical field of VPN network connection, in particular to a method and a system for automatic connection of VPN network abnormity.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Currently, many users often use virtual local area network (VPN) technology to implement cross-segment communication. A VPN can be understood as a virtual private line inside an enterprise. It can establish a private communication line between two or more intranets connected to the Internet at different locations via a special encrypted communication protocol.
Because the existing VPN network can not realize automatic recovery, when the VPN network fails, personnel are required to go to the site to manually recover the connection of the VPN network, which consumes a great deal of manpower and increases the operation cost of the network; in addition, a network reconnection failure may occur, which affects the safe operation of the whole system.
Disclosure of Invention
In order to solve the problems, the invention discloses a method and a system for automatically connecting abnormal VPN networks, which can automatically detect the connection condition of the VPN networks, and can realize automatic reconnection of the VPN networks when the networks are abnormal, thereby ensuring the operation reliability of the VPN networks.
In some embodiments, the following technical scheme is adopted:
a VPN network abnormity automatic connection method comprises the following steps:
(1) Establishing connection between the VPN client and the VPN server;
(2) Detecting whether the VPN client acquires an IP address distributed to the client by the VPN server or not, and judging whether a VPN tunnel between the VPN client and the VPN server exists or not; if so, the VPN client is normally connected with the VPN server, otherwise, the next step is carried out;
(3) After the set time is delayed, whether the VPN client side obtains the IP address distributed to the client side by the VPN server side is detected again, if the IP address is not detected for N times continuously, and N is larger than 2, the VPN client side is restarted;
(4) After restarting, whether the VPN client acquires the IP address distributed to the client by the VPN server is detected again; if so, the VPN client is normally connected with a VPN server; otherwise, after the set time is added on the basis of the last restart time, restarting again until detecting that the VPN client is normally connected with the VPN server.
Further, after detecting that the VPN client is normally connected to the VPN server, the method further includes: judging whether the VPN client starts a ping detection function or not;
if not, checking the connection state of the VPN client and the VPN server at set time intervals according to the abnormal automatic connection method of the VPN network of claim 1;
if the VPN server is started, detecting whether the ping is communicated every set time, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for M times continuously, restarting the VPN client.
Further, the restarting the VPN client specifically includes: software restarting is carried out on the VPN client; or, the hardware restart of the client is realized by controlling the closing of the dog feeding process of the hardware watchdog of the client.
Furthermore, after the set time is added on the basis of the last restart time, restarting is carried out again; and when the restarting interval time exceeds a set value, taking the set value as the restarting interval time.
In other embodiments, the following technical solutions are adopted:
a VPN network anomaly automatic connection system comprising:
means for establishing a connection between the VPN client and the VPN server;
the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side and judging whether a VPN tunnel between the VPN client side and the VPN server side exists or not;
when the connection is abnormal, the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side or not again after delaying the set time;
means for restarting the VPN client if the IP address is not detected for N consecutive times, N > 2;
the device is used for re-detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side after restarting;
and the device is used for restarting again after the set time is added on the basis of the last restart time when the IP address distributed to the client by the VPN server is not acquired until the normal connection between the VPN client and the VPN server is detected.
Further, still include:
means for determining whether the VPN client starts a ping detection function;
if not, checking the connection state of the VPN client and the VPN server at set time intervals according to the abnormal automatic connection method of the VPN network of claim 1;
if the VPN server is started, detecting whether the ping is communicated every set time, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for M times continuously, restarting the VPN client.
In other embodiments, the following technical solutions are adopted:
a VPN client side adopts the abnormal automatic connection method of the VPN network, and when the VPN network fails, automatic connection between the VPN client side and a VPN server is achieved.
Compared with the prior art, the invention has the beneficial effects that:
the method can ensure the reliability of the VPN network, effectively solves the defect that the VPN network cannot be automatically reconnected after the fault by adding the reconnection detection process, and saves the cost of manually recovering the VPN network when a client goes to the site.
Drawings
Fig. 1 is a flowchart of an abnormal automatic connection method for a VPN network according to an embodiment of the present invention.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, 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.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
In one or more embodiments, disclosed is a VPN network abnormal automatic connection method, referring to fig. 1, including:
(1) Establishing connection between the VPN client and the VPN server;
and configuring VPN related parameters on the VPN client interface, configuring corresponding parameter files according to the selected protocol, and connecting the VPN server through the selected protocol and the configured parameter files.
(2) Detecting whether the VPN client acquires an IP address distributed to the client by the VPN server, and judging whether a VPN tunnel between the VPN client and the VPN server exists or not; if so, the VPN client side is normally connected with the VPN server, otherwise, the next step is carried out;
(3) After the set time is delayed, whether the VPN client side obtains the IP address distributed to the client side by the VPN server side is detected again, if the IP address is not detected for N times continuously, and N is larger than 2, the VPN client side is restarted;
in this embodiment, the detection is performed again after 2 minutes of delay, and if the detection is performed 3 times continuously or the connection to the server is not detected successfully, the VPN client is restarted.
(4) After restarting, re-detecting whether the VPN client acquires the IP address distributed to the client by the VPN server; if so, the VPN client is normally connected with a VPN server; otherwise, after the set time is added on the basis of the last restart time, restarting again until detecting that the VPN client is normally connected with the VPN server.
In this embodiment, the time is increased by 6 minutes every time the computer is restarted, and the computer is restarted for one hour until the time exceeds one hour.
In some other embodiments, after detecting that the VPN client is normally connected to the VPN server, the method further includes: and judging whether the VPN client side starts a ping detection function or not.
Ping detection, which means that the time required for a frame of data to be transferred from one host to another host can be measured using a Ping command, thereby determining the response time of the host. The role of this command is mainly to check whether the route can be reached. Since the packet length of the command is small, the command is transmitted over the network at a very fast speed, and whether the station to be visited is reachable can be detected quickly. Typically, before accessing a site, the command is executed to determine whether the site is reachable.
If not, checking the connection state of the VPN client and the VPN server at set time intervals according to the abnormal automatic connection method of the VPN network;
if the VPN server is started, detecting whether the ping is communicated every 2 minutes, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for 3 times continuously, restarting the VPN client.
It should be noted that the method for restarting the VPN client may be realized by software control, so that the software of the VPN client is restarted; and the hardware restart of the client can be realized by controlling the closing of the dog feeding process of the hardware watchdog of the client.
Example two
In one or more embodiments, disclosed is a VPN network anomaly automatic connection system, including:
means for establishing a connection between the VPN client and the VPN server;
the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side and judging whether a VPN tunnel between the VPN client side and the VPN server side exists or not;
when the connection is abnormal, the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side or not again after delaying the set time;
a device for restarting the VPN client when N is more than 2 when the IP address distributed to the client by the VPN server is not detected for N times continuously;
the device is used for re-detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side after restarting;
and the device is used for restarting again after the set time is added on the basis of the last restart time when the IP address distributed to the client by the VPN server is not acquired until the normal connection between the VPN client and the VPN server is detected.
In other embodiments, the method further comprises:
means for determining whether the VPN client starts a ping detection function;
if not, checking the connection state of the VPN client and the VPN server at set time intervals according to the abnormal automatic connection method of the VPN network of claim 1;
if the VPN client is started, detecting whether the ping is communicated every set time, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for M times continuously, restarting the VPN client.
It should be noted that the working methods of the apparatuses in this embodiment are all implemented by the methods disclosed in the first embodiment, and are not described herein again.
EXAMPLE III
In one or more embodiments, a VPN client is disclosed, where the VPN client uses the method for automatic connection when a VPN network fails, and the VPN client and a VPN server are automatically connected when the VPN network fails.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (5)

1. A VPN network abnormity automatic connection method is characterized by comprising the following steps:
(1) Establishing connection between the VPN client and the VPN server;
(2) Detecting whether the VPN client acquires an IP address distributed to the client by the VPN server, and judging whether a VPN tunnel between the VPN client and the VPN server exists or not; if so, the VPN client is normally connected with the VPN server, otherwise, the next step is carried out;
(3) After the set time is delayed, whether the VPN client side obtains the IP address distributed to the client side by the VPN server side is detected again, if the IP address is not detected for N times continuously, and N is larger than 2, the VPN client side is restarted;
(4) After restarting, re-detecting whether the VPN client acquires the IP address distributed to the client by the VPN server; if so, the VPN client side is normally connected with the VPN server; otherwise, after the set time is added on the basis of the last restart time, restarting again until the normal connection between the VPN client and the VPN server is detected;
after detecting that the VPN client is normally connected with the VPN server, the method further comprises the following steps: judging whether the VPN client side starts a ping detection function or not;
if not, according to the steps (1) to (4), checking the connection state of the VPN client and the VPN server at set time intervals;
if the VPN server is started, detecting whether the ping is communicated every set time, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for M times continuously, restarting the VPN client.
2. The method according to claim 1, wherein the restarting of the VPN client specifically comprises: software restarting is carried out on the VPN client; or, the hardware restart of the client is realized by controlling the closing of the dog feeding process of the hardware watchdog of the client.
3. The abnormal automatic connection method for a VPN network according to claim 1, wherein the VPN network is restarted again after a set time is added on the basis of the last restart time; and when the restarting interval time exceeds a set value, taking the set value as the restarting interval time.
4. An automatic VPN network anomaly connection system, comprising:
means for establishing a connection between the VPN client and the VPN server;
the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side and judging whether a VPN tunnel between the VPN client side and the VPN server side exists or not;
when the connection is abnormal, the device is used for detecting whether the VPN client side obtains the IP address distributed to the client side by the VPN server side or not again after delaying the set time;
a device for restarting the VPN client when N is more than 2 when the IP address distributed to the client by the VPN server is not detected for N times continuously;
the device is used for re-detecting whether the VPN client side obtains the IP address of the VPN server side after restarting;
a device for restarting again after adding a set time on the basis of the last restart time when the IP address distributed to the client by the VPN server is not obtained until the normal connection between the VPN client and the VPN server is detected;
further comprising:
means for determining whether the VPN client starts a ping detection function;
if not, according to the steps (1) - (4) in the claim 1, checking the connection state of the VPN client and the VPN server at set time intervals;
if the VPN server is started, detecting whether the ping is communicated every set time, and if the ping is communicated, indicating that the data transmission between the VPN client and the VPN server is normal; and if the ping is detected to be unavailable for M times continuously, restarting the VPN client.
5. A VPN client, characterized in that, by using the VPN network abnormal automatic connection method according to any of claims 1 to 3, when a VPN network fails, automatic connection between the VPN client and a VPN server is realized.
CN201911397407.1A 2019-12-30 2019-12-30 Automatic connection method and system for VPN network abnormity Active CN110912759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911397407.1A CN110912759B (en) 2019-12-30 2019-12-30 Automatic connection method and system for VPN network abnormity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911397407.1A CN110912759B (en) 2019-12-30 2019-12-30 Automatic connection method and system for VPN network abnormity

Publications (2)

Publication Number Publication Date
CN110912759A CN110912759A (en) 2020-03-24
CN110912759B true CN110912759B (en) 2023-01-06

Family

ID=69814125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911397407.1A Active CN110912759B (en) 2019-12-30 2019-12-30 Automatic connection method and system for VPN network abnormity

Country Status (1)

Country Link
CN (1) CN110912759B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884920B (en) * 2020-07-13 2022-04-01 浙江世导裕新网络科技有限公司 Two-place machine room network communication connection interruption repairing system and method
CN112822705B (en) * 2021-01-14 2022-09-20 深圳震有科技股份有限公司 VPN tunnel self-recovery method and system in 5G network
CN114513435A (en) * 2022-01-14 2022-05-17 深信服科技股份有限公司 Method for detecting VPN tunnel, electronic device and storage medium
CN116894111B (en) * 2023-09-11 2024-01-26 中移(苏州)软件技术有限公司 Monitoring method, monitoring system, electronic equipment and readable storage medium
CN116915838B (en) * 2023-09-14 2024-01-05 深圳市智慧城市科技发展集团有限公司 State maintenance method for virtual private network, terminal equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274531A (en) * 2018-09-15 2019-01-25 深圳市海能通信股份有限公司 Data acquisition equipment method for restarting, system and computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193103A1 (en) * 2002-06-18 2005-09-01 John Drabik Method and apparatus for automatic configuration and management of a virtual private network
CN108092839B (en) * 2016-11-23 2020-08-14 杭州海康威视数字技术股份有限公司 Method and device for establishing network connection
CN110213293A (en) * 2019-06-17 2019-09-06 深圳前海微众银行股份有限公司 VPN login method, device, equipment and computer storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274531A (en) * 2018-09-15 2019-01-25 深圳市海能通信股份有限公司 Data acquisition equipment method for restarting, system and computer readable storage medium

Also Published As

Publication number Publication date
CN110912759A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110912759B (en) Automatic connection method and system for VPN network abnormity
US11323307B2 (en) Method and system of a dynamic high-availability mode based on current wide area network connectivity
EP3687141A1 (en) Monitoring wireless access point events
US20230362051A1 (en) Control Plane Device Switching Method and Apparatus, and Forwarding-Control Separation System
US20070130324A1 (en) Method for detecting non-responsive applications in a TCP-based network
US20100102631A1 (en) Apparatus power restart method in response to network connection status
WO2021128977A1 (en) Fault diagnosis method and apparatus
CN105589712B (en) BMC module update method and device
WO2009102919A2 (en) Dhcp initialization responsive to network layer connectivity
EP3264634B1 (en) Automatically detecting an error in a communication and automatically determining a source of the error
US20200236036A1 (en) Internet reachability detection and internet high availability for multi-homed network devices
CN114629822A (en) Link detection method and device, electronic equipment and storage medium
CN110505220B (en) Method and device for supporting OPC protocol to realize dual-computer hot standby and communication terminal
CN112333013B (en) Self-adaptive networking method, device, router and storage medium
US20130198347A1 (en) Safe state for networked devices
CN111083174B (en) Firewall dual-computer hot standby system, standby firewall and state processing method and device
CN107911496A (en) A kind of VPN service terminal acts on behalf of the method and device of DNS
CN113162815A (en) Flow switching method, system, equipment and medium
CN103746842A (en) Method and system for detecting fault restarting of line card
CN108270593A (en) A kind of two-node cluster hot backup method and system
CN107896176B (en) Processing method of computing node, intelligent terminal and storage medium
CN106330537B (en) SDN network equipment control surface management device and method
CN114422428A (en) Restarting method and apparatus for service node, electronic device and storage medium
CN106789281B (en) Method for realizing disconnection reconnection in OPC protocol communication process
US10491544B2 (en) Consistency control of a logical path passing through a relay device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 250101 rooms 1103 and 1105, 11 / F, building 1, Aosheng building, 1166 Xinluo street, high tech Zone, Jinan City, Shandong Province

Applicant after: Shandong Youren networking Co.,Ltd.

Address before: 250101 rooms 1103 and 1105, 11 / F, building 1, Aosheng building, 1166 Xinluo street, high tech Zone, Jinan City, Shandong Province

Applicant before: SHANDONG YOUREN INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant