A network proxy method and system capable of switching export IP
By setting up VPN server and client on the user side and cloud server side, and using the fixed IP address of the VPN client to connect to the network proxy service, the high maintenance cost problem caused by frequent switching of public IPs on the external cloud server is solved, and efficient network proxy service configuration and use is achieved.
Patent Information
- Application Number
- CN202310692897.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-06-13
AI Technical Summary
In the prior art, frequent switching of external public network IPs of cloud servers requires manual configuration, resulting in low operational efficiency and high maintenance costs, especially in high frequency switching scenarios.
The VPN server and VPN client are set up on the user side and the cloud server side respectively. The VPN client actively connects back to the VPN server to determine the fixed IP address. The network proxy service on the cloud server is used through the fixed IP address of the VPN client, which simplifies the network proxy connection process of the cloud server.
It realizes that each cloud server needs only one configuration, convenient and efficient connection of network proxy services using switchable egress IP, reducing maintenance costs and operational complexity.
Smart Images

Figure CN116708554B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network proxy technology, and in particular to a network proxy method and system capable of switching export IP addresses. Background Art
[0002] Switchable egress IP proxy is a network technology that, in certain situations, requires a large number of different IP addresses to simulate different users or requests, or requires switching IP addresses to circumvent anti-crawler mechanisms, bypass IP restrictions, etc. By using this technology, it allows users to access the network through the proxy IP on the Internet. Users can hide their real IP address and use the IP address on the proxy server to communicate on their computer's behalf. These proxy IP addresses can be changed in different geographical locations and network environments, thereby enhancing user privacy and security. This technology is mainly used for network security and data protection and has become a standard practice in many industries, including network security attack and defense drills, online marketing, search engine optimization, data mining and web crawling, simulating users from different regions accessing websites to monitor site service status, etc.
[0003] Existing IP-switchable product delivery models rely on cloud servers. Users must deploy their programs within the cloud server for use. Program configuration changes, package updates, and other operations require local upload or direct operation within the cloud server, resulting in low efficiency. Network proxy technology utilizes a proxy server to process network requests. The proxy server receives client requests, forwards them to the target server, and then returns the response to the client.
[0004] After setting up a cloud server's network proxy, users are required to connect to the cloud server's external public IP address by default to utilize the network proxy service. Due to the cloud server's mutable external public IP address, users face the challenge of needing to configure a new external public IP address each time the cloud server switches its external public IP address. This requires real-time acquisition and maintenance of the switched external public IP address, increasing maintenance costs. Manual configuration is time-consuming and labor-intensive in scenarios where the external public IP address frequently switches. Summary of the Invention
[0005] In order to solve the above technical problems, this application proposes the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a network proxy method capable of switching an egress IP address, comprising:
[0007] A VPN server and a VPN client are respectively set on the user side and the cloud server side, wherein the VPN server is set locally on the user side, the VPN client is deployed on the cloud server side, and the VPN server is communicated with the VPN client;
[0008] The VPN client actively connects back to the VPN server to determine the fixed IP address of the VPN client;
[0009] The user uses the network proxy service on the cloud server through the fixed IP address of the VPN client.
[0010] In one possible implementation, respectively setting up a VPN server and a VPN client on a user side and a cloud server side includes:
[0011] Install the VPN client on each cloud server and load the OpenVPN configuration file generated on the VPN server.
[0012] Upload the OpenVPN configuration file to each cloud server and copy the OpenVPN configuration file to the / etc / openvpn / directory;
[0013] Start the OpenVPN client and load the configuration file to connect to the VPN server: openvpn –config / etc / openvpn / config.ovpn –daemon.
[0014] In a possible implementation, the VPN client actively connects back to the VPN server to determine the fixed IP address of the VPN client, including:
[0015] Create a file for each client in the directory specified by client-config-dir on the VPN server. The file contains the client's configuration information.
[0016] Use the ifconfig-push command in the client configuration file to specify the client's IP address, setting an internal fixed IP address for the VPN client of each cloud server.
[0017] In a possible implementation, the user uses the network proxy service on the cloud server through the fixed IP address of the VPN client, including:
[0018] The user accesses the cloud server through the fixed IP address of the VPN client;
[0019] The network proxy service on the cloud server receives the user's network request and forwards it to the target server;
[0020] The response received from the target server is returned to the user.
[0021] In a possible implementation, the method further includes: establishing a network proxy service on the cloud server.
[0022] In one possible implementation, establishing a network proxy service on a cloud server includes:
[0023] Use the command line apt-get install XXX to install the XXX proxy service software package. XXX is the name of the proxy server software package. apt-get is a command line tool used to install, update, and uninstall software packages on the system. It can quickly and conveniently manage software packages in the command line. apt-get install is to install the proxy service software package.
[0024] After the installation is complete, the configuration file of XXX is located in / etc / XXX / XXX.conf and the log file is located in / var / log / XXX / XXX.log;
[0025] Edit XXX's configuration file / etc / XXX / XXX.conf;
[0026] The proxy server can enable the network proxy service function by starting the XXX service.
[0027] In a possible implementation, editing the configuration file / etc / XXX / XXX.conf of XXX includes:
[0028] auth: controls the authentication method, which can be set to none, userpass, pam or gssapi. The default is none, which means no authentication is required. If you need to use a username and password for authentication, you can set it to userpass and configure the users file.
[0029] permit: Controls the client access permission, which can be set to none, all, or specify an IP address and network mask; the default is none, which means no access is allowed. If you want all clients to have access, set it to all;
[0030] Configure the user password file: If username and password authentication is enabled, you need to configure the user password file. Use the following command to create a password file / etc / XXX / XXX.passwd;
[0031] Then add users to the file using the following format: username:password.
[0032] In a second aspect, an embodiment of the present application provides a network proxy system capable of switching an egress IP address, comprising:
[0033] A configuration module is configured to respectively configure a VPN server and a VPN client on a user terminal and a cloud server terminal, wherein the VPN server is locally configured on the user terminal, the VPN client is deployed on the cloud server terminal, and the VPN server is in communication with the VPN client;
[0034] A determination module, configured for the VPN client to actively connect back to the VPN server to determine the fixed IP address of the VPN client;
[0035] The network proxy module is used for users to use the network proxy service on the cloud server through the fixed IP address of the VPN client.
[0036] In this embodiment of the application, users connect to cloud servers using the fixed internal IP address assigned to the VPN client by the VPN server. This allows them to connect to the network proxy service built on each cloud server through the VPN tunnel, eliminating the need to maintain and frequently change the cloud server's external public IP address to connect to the network proxy service of each cloud server. This allows users to configure each cloud server once and then connect to it conveniently and efficiently using the switchable egress IP network proxy. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of a network proxy method capable of switching egress IP addresses provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a VPN server and VPN client configuration provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of the framework of a network proxy system with switchable egress IP provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The present invention will be described below with reference to the accompanying drawings and specific implementation methods.
[0041] Figure 1 A flow chart of a network proxy method for switching an egress IP provided in an embodiment of the present application is provided. Figure 1 The network proxy method capable of switching the egress IP in this embodiment includes:
[0042] S101, setting up a VPN server and a VPN client on the user side and the cloud server side respectively.
[0043] See also Figure 2The VPN server is set locally on the user side, and the VPN client is deployed on the cloud server side. The VPN server is connected to the VPN client in communication, and one VPN server is connected to multiple VPN clients.
[0044] The VPN server is the central point of the VPN connection, responsible for receiving requests from clients and forwarding them to the internal network. It also encrypts and decrypts transmitted data to ensure communication security. VPN clients connect to the VPN server over the public network. Through VPN clients, they can interact with internal network resources as if they were on the internal network.
[0045] Specifically, install the VPN client on each cloud server and load the OpenVPN configuration file generated on the VPN server. The VPN client can be installed using a package manager in Linux. For example, in CentOS, you can use the following command: yum install openvpn. yum is a command-line tool for managing packages on RPM (Red Hat Package Manager)-based Linux systems. It is primarily used in distributions like CentOS to manage installation, updates, and uninstallation of packages, as well as resolve dependency issues. The yum command automatically searches for packages in repositories, installs or uninstalls them, and manages dependencies.
[0046] Upload the OpenVPN configuration file to each cloud server and copy the OpenVPN configuration file to the / etc / openvpn / directory.
[0047] Start the OpenVPN client and load the configuration file to connect to the VPN server: openvpn –config / etc / openvpn / config.ovpn –daemon.
[0048] will start the OpenVPN client and run it as a daemon so that it runs continuously in the background.
[0049] S102: The VPN client actively connects back to the VPN server to determine the fixed IP address of the VPN client.
[0050] Set a fixed internal IP address for each cloud server's VPN client on the VPN server. When each cloud server connects to the VPN server as a VPN client, the VPN server assigns a fixed internal IP address to each cloud server's VPN client. This fixed internal IP address is specified in the VPN server configuration file.
[0051] You can create a file for each client in the directory specified by client-config-dir on the VPN server. The file name is the same as the client's Common Name and contains the client's configuration information. In the client configuration file, you can use the ifconfig-push command to specify the client's IP address.
[0052] For example, create a file named client_1 in the / etc / openvpn / clients directory with the following content:
[0053] ifconfig-push 172.16.10.1 255.255.255.0
[0054] The above configuration specifies the IP address 172.16.10.1 and subnet mask 255.255.255.0 for the client named client_1. Similarly, you can generate VPN client configuration files for multiple cloud servers, for example, specifying the IP address 172.16.10.2 for the client named client_2.
[0055] S103: The user uses the network proxy service on the cloud server through the fixed IP address of the VPN client.
[0056] The user accesses the cloud server through the fixed IP address of the VPN client; the network proxy service on the cloud server receives the user's network request and forwards it to the target server; and the response received from the target server is returned to the user.
[0057] This embodiment also includes establishing a network proxy service on a cloud server with switchable IP addresses, allowing users to connect to the network proxy service. This embodiment uses SS5 as an example. SS5 is a SOCKS v4 / v5 proxy server that allows client programs to access the internet through the proxy server and also supports authentication and access control.
[0058] Install SS5 directly using your package manager. For example, on Ubuntu, you can use the following command: apt-get install ss5. apt-get is a command-line tool used to install, update, and uninstall software packages on systems like Ubuntu. It allows for quick and convenient package management from the command line. apt-get install installs the SS5 proxy service package.
[0059] After the installation is complete, the SS5 configuration file is located at / etc / ss5 / ss5.conf and the log file is located at / var / log / ss5 / ss5.log.
[0060] Edit the SS5 configuration file / etc / ss5 / ss5.conf and configure it as needed. The more important configuration items are as follows:
[0061] auth: Controls the authentication method. It can be set to none, userpass, pam, or gssapi. The default is none, meaning no authentication is required. If you need to use a username and password for authentication, you can set it to userpass and configure the users file.
[0062] permit: Controls client access permissions. You can set it to none, all, or specify an IP address and network mask. The default is none, which means no access. If you want all clients to have access, set it to all.
[0063] If username and password authentication is enabled, you need to configure a user password file. You can use the following command to create a password file / etc / ss5 / ss5.passwd.
[0064] Then you can add users to the file using the following format: username:password, and start the SS5 service to enable the proxy service function.
[0065] Corresponding to the network proxy method with switchable egress IP provided in the above embodiment, the present application also provides an embodiment of a network proxy system with switchable egress IP.
[0066] See also Figure 3 The network proxy system 20 with switchable egress IP in this embodiment includes:
[0067] The configuration module 201 is used to respectively set up a VPN server and a VPN client on the user side and the cloud server side, wherein the VPN server is set up locally on the user side, the VPN client is deployed on the cloud server side, and the VPN server is communicated with the VPN client.
[0068] The determining module 202 is configured for the VPN client to actively connect back to the VPN server to determine the fixed IP address of the VPN client.
[0069] The network proxy module 203 is used for users to use the network proxy service on the cloud server through the fixed IP address of the VPN client.
[0070] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0071] The above description is merely a specific embodiment of the present application. Any person skilled in the art may easily conceive of variations or substitutions within the technical scope disclosed in this application, and such variations or substitutions shall be within the scope of protection of this application. The scope of protection of this application shall be subject to the scope of protection of the claims.
Claims
1. A network proxy method capable of switching an exit IP, characterized in that: include: A VPN server and a VPN client are respectively set on the user side and the cloud server side, wherein the VPN server is set locally on the user side, the VPN client is deployed on the cloud server side, and the VPN server is communicated with the VPN client; The VPN client actively connects back to the VPN server to determine the fixed IP address of the VPN client; The user uses the network proxy service on the cloud server through the fixed IP address of the VPN client.
2. The network proxy method with switchable export IP according to claim 1, characterized in that: The VPN server and VPN client are respectively set up on the user side and the cloud server side, including: Install the VPN client on each cloud server and load the OpenVPN configuration file generated on the VPN server. Upload the OpenVPN configuration file to each cloud server and copy the OpenVPN configuration file to the / etc / openvpn / directory; Start the OpenVPN client and load the configuration file to connect to the VPN server: openvpn –config / etc / openvpn / config.ovpn –daemon.
3. The network proxy method with switchable exit IP according to claim 1, characterized in that: The VPN client actively connects back to the VPN server to determine the fixed IP address of the VPN client, including: Create a file for each client in the directory specified by client-config-dir on the VPN server. The file contains the client's configuration information. Use the ifconfig-push command in the client configuration file to specify the client's IP address, setting an internal fixed IP address for the VPN client of each cloud server.
4. The network proxy method with switchable export IP according to claim 1, characterized in that: The user uses the network proxy service on the cloud server through the fixed IP address of the VPN client, including: The user accesses the cloud server through the fixed IP address of the VPN client; The network proxy service on the cloud server receives the user's network request and forwards it to the target server; The response received from the target server is returned to the user.
5. The network proxy method with switchable exit IP according to any one of claims 1 to 4, characterized in that: Also includes: Establish a network proxy service on the cloud server.
6. The network proxy method with switchable export IP according to claim 5, characterized in that: The network proxy service built on the cloud server includes: Use the command line apt-get install XXX to install the XXX proxy service software package. XXX is the name of the proxy service software package. apt-get is a command line tool used to install, update, and uninstall software packages on the system. It can quickly and conveniently manage software packages in the command line. apt-get install is to install the proxy service software package. After the installation is complete, the configuration file of XXX is located in / etc / XXX / XXX.conf and the log file is located in / var / log / XXX / XXX.log; Edit XXX's configuration file / etc / XXX / XXX.conf; The proxy server can enable the network proxy service function by starting the XXX service.
7. The network proxy method with switchable export IP according to claim 5, characterized in that: The configuration file / etc / XXX / XXX.conf of XXX is edited, including: auth: controls the authentication method, which can be set to none, userpass, pam or gssapi. The default is none, which means no authentication is required. If you need to use a username and password for authentication, you can set it to userpass and configure the users file. permit: Controls the client access permission, which can be set to none, all, or specify an IP address and network mask; the default is none, which means no access is allowed. If you want all clients to have access, set it to all; Configure the user password file: If username and password authentication is enabled, you need to configure the user password file. Use the following command to create a password file / etc / XXX / XXX.passwd; Then add users to the file using the following format: username:password.
8. A network proxy system capable of switching export IP, characterized in that: include: A configuration module is configured to respectively configure a VPN server and a VPN client on a user terminal and a cloud server terminal, wherein the VPN server is locally configured on the user terminal, the VPN client is deployed on the cloud server terminal, and the VPN server is in communication with the VPN client; A determination module, configured for the VPN client to actively connect back to the VPN server to determine the fixed IP address of the VPN client; The network proxy module is used for users to use the network proxy service on the cloud server through the fixed IP address of the VPN client.
Citation Information
Patent Citations
Data processing method and device for virtual private network system, and virtual private network system
CN109218157A
Abnormal automatic connection method and system for VPN network
CN110912759A