CN113746653B - Gateway configuration method, client, server and storage medium - Google Patents
Gateway configuration method, client, server and storage medium Download PDFInfo
- Publication number
- CN113746653B CN113746653B CN202010478554.8A CN202010478554A CN113746653B CN 113746653 B CN113746653 B CN 113746653B CN 202010478554 A CN202010478554 A CN 202010478554A CN 113746653 B CN113746653 B CN 113746653B
- Authority
- CN
- China
- Prior art keywords
- gateway
- client
- server
- idle
- information corresponding
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 claims abstract description 51
- 230000015654 memory Effects 0.000 claims description 24
- 238000001914 filtration Methods 0.000 claims description 18
- 238000012360 testing method Methods 0.000 claims description 14
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007723 transport mechanism Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5046—Resolving address allocation conflicts; Testing of addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0227—Filtering policies
- H04L63/0236—Filtering by address, protocol, port number or service, e.g. IP-address or URL
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to the field of network communications technologies, and in particular, to a gateway configuration method, a client, a server, and a storage medium, where the gateway configuration method includes: receiving gateway providing information sent by a server; acquiring gateway information corresponding to an idle gateway in the client; and configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message. By configuring the gateway of the server according to the gateway information and the gateway providing information corresponding to the idle gateway, gateway conflict can be avoided in advance when the client and the server establish communication connection, and the efficiency of the communication connection is improved.
Description
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a gateway configuration method, a client, a server, and a storage medium.
Background
DHCP (Dynamic Host Configuration Protocol ) is commonly used in large local area networks and can automatically assign parameters such as IP address, gateway and DNS server address to clients.
In the large-scale automatic test of the routing equipment, after a plurality of routing equipment are simultaneously accessed to the client, gateway conflict can be caused, so that the routing equipment cannot work normally, and the large-scale automatic test cannot be realized. The prior art is that in the DHCP phase, when a gateway conflict occurs, it is typically resolved by restarting the client. Gateway conflict occurs when a plurality of routing devices are accessed to the same client, and one routing device is generally reserved to be accessed to the client, so that the gateway can work normally; and then sending the http command to other accessed routing devices to change the default gateway, and finally ensuring that the IP addresses corresponding to the gateways of each accessed routing device are different. However, the occurrence of gateway collision cannot be avoided in advance, and the efficiency of communication connection is reduced.
Therefore, how to avoid gateway collision when the routing device accesses the client in advance and improve the communication connection efficiency becomes a problem to be solved.
Disclosure of Invention
The invention provides a gateway configuration method, a client, a server and a storage medium, wherein the gateway of the server is configured according to gateway information and gateway providing information corresponding to an idle gateway, so that gateway conflict occurring when the client and the server establish communication connection can be avoided in advance, and the efficiency of communication connection is improved.
In a first aspect, the present invention provides a gateway configuration method, applied to a client, where the method includes: receiving gateway providing information sent by a server; acquiring gateway information corresponding to an idle gateway in the client; and configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message.
In a second aspect, the present invention provides a gateway configuration method, applied to a server, where the method includes: receiving a gateway request message sent by a client, and generating a gateway providing message according to the gateway request message; sending the gateway providing message to the client so that the client configures a gateway of the server according to the gateway providing message; receiving configured gateway information sent by the client, and updating a default gateway in the server according to the configured gateway information; and distributing the default gateway information corresponding to the updated default gateway to the client so that the client establishes communication connection with the server according to the default gateway information.
In a third aspect, the present invention also provides a client, the client comprising: a network filtering drive; a memory for storing a program; a processor for calling the program in the memory to execute: receiving gateway providing information sent by a server; acquiring gateway information corresponding to an idle gateway in the client; and configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message through the network filtering driver.
In a fourth aspect, the present invention also provides a server comprising a processor and a memory; the memory is used for storing programs; the processor is configured to call the program in the memory to execute: receiving a gateway request message sent by a client; generating a gateway providing message according to the gateway request message; and sending the gateway providing message to the client so that the client configures the gateway of the server according to the gateway providing message.
In a fifth aspect, the present invention further provides a storage medium for readable storage, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement a gateway configuration method as described above.
The invention discloses a gateway configuration method, a client, a server and a storage medium, wherein the gateway provision message sent by the server is received to determine the gateway provision message; the gateway information corresponding to the idle gateway in the client can be determined by acquiring the gateway information corresponding to the idle gateway in the client; by providing the information according to the gateway information and the gateway corresponding to the idle gateway, the configuration of the gateway of the server can be realized, so that the gateway conflict when the client and the server establish communication connection can be avoided in advance, and the efficiency of communication connection is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a gateway configuration system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another gateway configuration system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a gateway configuration system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a client provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a server according to an embodiment of the present invention;
fig. 6 is a schematic flow chart of a gateway configuration method provided by an embodiment of the present invention;
FIG. 7 is a schematic diagram of a client requesting a server to assign an IP address provided by an embodiment of the present invention;
FIG. 8 is a schematic flow chart of a sub-step of acquiring gateway information corresponding to the idle gateway in FIG. 6;
FIG. 9 is a schematic diagram of generating a gateway selection scene list at a display interface of a client provided by an embodiment of the present invention;
FIG. 10 is a schematic view of a scenario in which a user inputs a selection instruction in a client provided by an embodiment of the present invention;
FIG. 11 is a schematic flow chart of a sub-step of configuring the gateway of the server in FIG. 6;
fig. 12 is a schematic flow chart of another gateway configuration method provided by an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "part" or "unit" for representing elements are used only for facilitating the description of the present invention, and have no particular meaning in themselves. Thus, "module," "component," or "unit" may be used in combination.
The embodiment of the invention provides a gateway configuration method, a client, a server, a system and a storage medium. The gateway configuration method can be applied to the client, the configuration of the gateway of the server is realized according to the gateway information and the gateway providing information corresponding to the idle gateway, the gateway conflict occurring when the client and the server establish communication connection can be avoided in advance, and the efficiency of the communication connection is improved.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a gateway configuration system according to an embodiment of the present invention. The gateway configuration system includes a client 10 and a server 20. It should be noted that, after the server 20 accesses the port of the client 10 through the signal line, the client 10 requests the server 20 to allocate an IP (Internet Protocol ) address based on DHCP (Dynamic Host Configuration Protocol ) to establish a communication connection.
The DHCP process may include, but is not limited to, DHCP DISCOVER, DHCP OFFER, DHCP REQUEST, DHCP ACK, and the like. Wherein the DHCP DISCOVER phase is a phase in which the client 10 looks for the server 20; the DHCP OFFER phase is a phase in which server 20 assigns an IP address to client 10; the DHCP REQUEST phase is a phase in which the client 10 REQUESTs the server 20 to use the IP address; the DHCP ACK phase is a phase in which the server 20 transmits an IP address assignment acknowledgement message to the client 10.
In the embodiment of the present invention, in the DHCP DISCOVER phase, the client 10 sends a gateway request message to the server 20. In the DHCP OFFER phase, server 20 returns a gateway OFFER message according to the gateway request message; the gateway providing message includes default gateway information acquired by the server 20, for example, a default gateway in the server 20 and an IP address corresponding to the default gateway.
Illustratively, the server 20 stores therein a default gateway and an IP address corresponding to the default gateway. The number of the servers 20 may be one or more; different servers 20 may store the same default gateway and the same IP address, although the same default gateway and different IP addresses are also possible.
The gateway conflict in the embodiment of the invention means that the IP addresses corresponding to the gateway are in conflict. It can be understood that if the default gateways in different servers 20 are the same, and the IP addresses corresponding to the default gateways are also the same, the problem of gateway collision may occur. If the default gateways in different servers 20 are the same, and the IP addresses corresponding to the default gateways are different, the problem of gateway collision will not occur.
Illustratively, when server a and server B are simultaneously connected to client 10, server a and server B simultaneously assign the same default gateway and the same IP address to client 10; the client 10 receives two identical default gateways and the same IP address, resulting in a gateway conflict, and the client 10 cannot establish a communication connection with both server a and server B.
In some embodiments, server 20 may be directly connected to ports of client 10 via signal lines. As shown in fig. 1.
In other embodiments, server 20 may be connected to a switch via a signal line and then to a port of client 10 via the switch. It will be appreciated that when there are multiple servers 20 that need to be connected to the client 10, the servers 20 need to be connected together to a switch and network packets of the servers 20 are forwarded to the client 10 via the switch due to the limited number of physical ports in the client 10. Fig. 2 is a schematic structural diagram of another gateway configuration system according to an embodiment of the present invention.
Note that a switch is a network device for forwarding an electrical signal. The switch may provide an unshared electrical signal path for any two network nodes that access the switch.
The signal line may be a network cable, or may be another signal line for communication connection, for example, a USB data line.
In some embodiments, after the server 20 accesses the port of the client 10 through the signal line, the client 10 sends a gateway request message to the server 20, so that the server 20 returns a gateway providing message according to the gateway request message; after receiving the gateway request message sent by the client 10, the server 20 obtains default gateway information in the server 20 according to the gateway request message, and generates a gateway providing message including the default gateway information. The client 10 receives the gateway providing message sent by the server 20 and obtains gateway information corresponding to the idle gateway in the client 10, where the gateway information may include the gateway, an IP address corresponding to the gateway, and a usage status of the gateway. The client 10 configures the gateway of the server 20 according to the gateway information and gateway providing message corresponding to the idle gateway; for example, according to the gateway information corresponding to the idle gateway, the default gateway information in the gateway providing message is modified to obtain the configured gateway information. The client 10 transmits the configured gateway information to the server 20, and the server 20 may update the default gateway in the server 20 according to the configured gateway information. The server 20 distributes the updated default gateway information corresponding to the default gateway to the client 10, so that the client 10 establishes communication connection with the server 20 according to the default gateway information corresponding to the updated default gateway.
In the DHCP process, the client 10 corresponds to a DHCP client, and the server 20 corresponds to a DHCP server. In an embodiment of the present invention, client 10 may comprise a computer, which may include, but is not limited to, a desktop computer, a notebook computer, and the like. The server 20 may include, but is not limited to, routing devices, data cards of USB interfaces, and the like having routing functions.
It should be noted that, the data card of the USB interface may be connected to the client 10 through a USB data line; after the USB data line is connected to the port of the client 10, the data card of the USB interface may generate a virtual network card, so that the data card of the USB interface is connected to the client 10 as a routing device.
In some embodiments, when the server 20 may be a USB-interface data card, as shown in fig. 3, the USB-interface data card is connected as a port of the server 20 to the client 10.
Referring to fig. 4, the client 10 may include a network filtering driver 11. By way of example, a network filter driver 11 may be installed in the client 10; the network filter driver 11 has functions of changing, deleting, and adding data to the network packet. For example, the network filtering driver 11 is configured to modify the gateway provisioning message according to gateway information corresponding to the idle gateway.
It should be noted that, when the Network filter driver 11 is applied to NDIS (Network DRIVER INTERFACE Specification ), the Network filter driver 11 may dynamically modify the IP address uploaded by the server by using functions of changing, deleting and adding data on a receiving or transmitting path of a driver stack.
In some embodiments, the network filtering driver 11 may obtain, when running, an IP address corresponding to an idle gateway stored in the shared cache area in the client 10; and then, according to the IP address corresponding to the idle gateway, replacing the IP address corresponding to the default gateway in the provisioning message to obtain the configured IP address.
In an embodiment, the client 10 may further include a processor 12 and a memory 13, where the network filtering driver 11, the processor 12, and the memory 13 may be connected by a bus, such as any suitable bus, for example, an I2C (Inter-INTEGRATED CIRCUIT) bus.
The memory 13 may include a nonvolatile storage medium and an internal memory. The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions that, when executed, cause a processor to perform any of a number of gateway configuration methods.
Wherein the processor 12 is operative to provide computing and control capabilities supporting the operation of the entire client 10. Illustratively, the processor 12 implements modification of the gateway provisioning message according to the gateway information corresponding to the idle gateway by running the network filtering driver 11.
The Processor 12 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Referring to fig. 5, fig. 5 is a schematic block diagram illustrating a structure of a server 20 according to an embodiment of the present invention. The server 20 includes a processor 21 and a memory 22 connected by a system bus, wherein the memory 21 may include a nonvolatile storage medium and an internal memory.
The internal memory provides an environment for the execution of programs in the non-volatile storage medium that, when executed by the processor 22, cause the processor 22 to perform any of the gateway configuration methods. Illustratively, the memory 21 stores parameters such as the IP address of the server 20, default gateway and DNS server address.
The processor 22 is operative to provide computing and control capabilities supporting the operation of the entire server 20. Illustratively, the processor 22, upon receiving the gateway request message sent by the client 10, obtains default gateway information from the gateway request message and generates a gateway provisioning message including the default gateway information, and then sends the gateway provisioning message to the client 10.
It should be appreciated that the Processor 22 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Some embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
As shown in fig. 6, fig. 6 is a schematic flowchart of a gateway configuration method according to an embodiment of the present invention. The gateway configuration method is applied to the client, and the gateway of the server is configured according to the gateway information and the gateway providing information corresponding to the idle gateway, so that gateway conflict occurring when the client and the server establish communication connection can be avoided in advance, and the efficiency of communication connection is improved. The gateway configuration method includes steps S101 to S103.
Step S101, receiving gateway providing information sent by a server.
It should be noted that, the process that the client requests the server to allocate an IP address based on the dynamic host configuration protocol to establish a communication connection includes the following phases: (1) the client sends a gateway request message to the server; (2) The client receives gateway providing information sent by the server; (3) The client sends the configured gateway information to the server; (4) The client receives the updated default gateway sent by the server. As shown in fig. 7, fig. 7 is a schematic diagram of a client requesting a server to assign an IP address.
In some embodiments, if it is detected that the signal line of the server accesses a port of the client, an allocation of an IP address is requested to the server based on a dynamic host configuration protocol to establish a communication connection. For example, a gateway request message is sent to the server to cause the server to return a gateway offer message based on the gateway request message.
The gateway request information is used for requesting the server to allocate the IP address. It should be noted that, the gateway providing message sent by the server may be sent as a network data packet; the gateway provisioning message may include default gateway information, such as a default gateway and an IP address corresponding to the default gateway, among others.
In some embodiments, before receiving the gateway provisioning message sent by the server, the method further comprises: and when detecting that the server accesses the port of the client, sending a gateway request message to the server so that the server returns a gateway providing message according to the gateway request message.
By way of example, it is possible to monitor whether a new device access port is available through a gateway service program in the client.
Illustratively, in this embodiment, the port of the client is referred to as a physical port; for example, RJ-45 ports, USB ports, SC ports, parallel ports, serial ports, and the like.
In some embodiments, the server may be accessed into the port of the client via a signal line. Wherein the signal lines may include, but are not limited to, net lines. The server is illustratively connected to the client's RJ-45 port via a network cable.
When detecting that a server accesses a port of a client, sending a gateway request message to the server, so that the server can send a gateway providing message comprising a default gateway and an IP address; by receiving the gateway provisioning message sent by the server, the default gateway and IP address in the server can be determined.
Step S102, acquiring gateway information corresponding to the idle gateway in the client.
It should be noted that the idle gateway refers to a gateway that is not occupied or used. The gateway information may include the gateway, an IP address corresponding to the gateway, and a usage status of the gateway.
In particular, the gateway may implement interconnections between different networks at the transport layer, the gateway being essentially the IP address of one network to the other. Gateways in the TCP/IP protocol are most commonly used, and after setting the IP address of the gateway, the TCP/IP protocol can only realize the mutual access between different networks. Wherein, the IP address of the gateway refers to the IP address of the device with the routing function. In the embodiment of the invention, the default gateway in the server needs to be configured so as to avoid gateway conflict.
Referring to fig. 8, before obtaining the gateway information corresponding to the idle gateway in the client, the following steps S1021 to S1023 may be further included.
Step S1021, gateway information corresponding to all ports in the client is obtained to generate a gateway information list.
It should be noted that ports may be divided into virtual ports and physical ports. In this embodiment, the port in the client refers to a virtual port. It is understood that virtual ports refer to ports within a client, including 65536 ports. By way of example, ports of a client may include, but are not limited to, 80 ports, 21 ports, 23 ports, and the like. Each port corresponds to a gateway and IP address. If the port is not occupied or used, the gateway corresponding to the port can be determined to be an idle gateway.
In an embodiment, gateway information corresponding to all ports in the client may be obtained in advance; the gateway information corresponding to the port in the client can also be obtained when the port of the server accessed to the client is detected; and the gateway information corresponding to the port in the client can be acquired when the gateway providing message sent by the server is received.
In an embodiment, the gateway information corresponding to all ports in the client may be obtained in real time, or the gateway information corresponding to the ports in the client may be obtained at regular time. The time length of the timing may be set according to practical situations, and specific numerical values are not limited herein.
In some embodiments, when obtaining gateway information corresponding to a port in a client to generate a gateway information list, the method may include: calling a preset gateway traversal command; according to the gateway traversing command, sequentially collecting gateway information corresponding to ports in the client; and generating a gateway information list according to the collected gateway information.
The preset gateway traversal command may be preset to be stored in a memory in the client. When the gateway information corresponding to the port needs to be acquired, a preset gateway traversing command can be called. Illustratively, the gateway traversal command may include an ipconfig command. By running the ipconfig command, the IP address, default gateway, subnet mask, default gateway value, etc. corresponding to each port can be obtained.
In some embodiments, by running the ipconfig command, gateway information corresponding to ports in the client is collected sequentially; and then generating a gateway information list according to the collected gateway information. The gateway information list is shown in table 1, for example.
Table 1 is a gateway information list
Gateway (GW) | IP address | Use state |
192.168.0.1 | 192.168.0.3 | Idle |
192.168.0.1 | 192.168.0.5 | In use |
192.168.1.1 | 192.168.1.20 | Idle |
192.168.1.1 | 192.168.1.30 | Idle |
192.168.1.1 | 192.168.1.40 | Idle |
192.168.2.1 | 192.168.2.9 | In use |
192.168.3.1 | 192.168.3.15 | Idle |
192.168.3.1 | 192.168.3.16 | Idle |
It should be noted that the same gateway corresponds to a plurality of IP addresses. For example, the IP address corresponding to gateway 192.168.0.1 may include 192.168.0.3 and 192.168.0.5, and may also include 192.168.0.6, 192.168.0.7, 192.168.0.8, and so on.
Illustratively, the generated gateway information list includes a plurality of gateways, IP addresses corresponding to the plurality of gateways, and usage states corresponding to the plurality of gateways, respectively, according to the collected gateway information.
In other embodiments, the client has a list of gateway information stored therein; and sequentially collecting gateway information corresponding to the ports in the client by running the ipconfig command so as to update the gateway information list in real time.
And collecting gateway information corresponding to the port in the client in real time or at fixed time through a preset gateway traversing command, and generating or updating a gateway information list, so that the latest gateway information of the port can be collected.
Step S1022, determining the gateway information corresponding to the idle gateway in the gateway information list.
In some embodiments, determining gateway information corresponding to the idle gateway in the gateway information list may include: determining a current gateway selection scene of a client; and acquiring gateway information corresponding to the idle gateway in the gateway information list according to the gateway selection scene.
The gateway selection scene may be understood as that the policies selected by the gateway are different in different scenes. For example, the gateway selection scenario may include a test scenario and a deployment scenario. It should be noted that, the test scenario refers to that after the gateway of the server is configured, the communication test is performed, and frequent plugging is required between the server and the client; the deployment scenario refers to that after the gateway of the server is configured, the server is applied to the actual environment.
In some embodiments, determining the current gateway selection scenario for the client may include: and determining the number of servers, and determining the current gateway selection scene of the client according to the number of servers.
Illustratively, determining the number of servers may be determined by the number of gateway provisioning messages received. For example, if the number of received gateway provisioning messages is N, the number of servers may be determined to be N. The value of N is determined according to practical situations, and specific values are not limited herein.
The number of servers is determined, and the number of ports where the servers access the clients can be monitored by the gateway service program. For example, if it is monitored by the gateway service program that there are N ports with server access, the number of servers may be determined to be N.
For example, when the number of servers is greater than a preset number value, determining that the current gateway selection scene of the client is a test scene; and when the number of the servers is smaller than or equal to a preset number value, determining that the current gateway selection scene of the client is a deployment scene.
Wherein, the preset quantity value can be represented by M; the value of M is determined according to practical circumstances, and specific values are not limited herein.
In other embodiments, determining the selection scene may include: and displaying a gateway selection scene table on a display interface of the client, receiving a selection instruction input by a user on the display interface, and determining the current gateway selection scene of the client according to the selection instruction.
For example, a gateway selection scenario table may be generated at a display interface of a client, the gateway selection scenario table including two options of a test scenario and a deployment scenario. As shown in fig. 9, fig. 9 is a schematic diagram of generating a gateway selection scene list at a display interface of a client.
For example, the user may select an option in the gateway selection scene table, for example, by clicking a display interface or clicking a mouse, etc. to input a selection instruction. As shown in fig. 10, fig. 10 is a schematic view of a scenario in which a user inputs a selection instruction in a client.
After the user inputs the selection instruction on the display interface, the current gateway selection scene of the client can be determined according to the selection instruction.
For example, when a selection instruction input by a user is used to select a test scenario, it may be determined that the current gateway selection scenario of the client is the test scenario. When a selection instruction input by a user is used for selecting a deployment scenario, the current gateway selection scenario of the client can be determined to be the deployment scenario.
In some embodiments, according to a current gateway selection scene of the client, gateway information corresponding to an idle gateway in the gateway information list is obtained.
In some embodiments, when the current gateway selection scene of the client is a test scene, gateway information corresponding to an idle gateway of the same network segment in the gateway information list is obtained.
Note that the same network segment refers to the same IP address of the gateway.
For example, in the gateway information list, since the gateway corresponding to the IP address 192.168.0.3 and the IP address 192.168.0.5 is 192.168.0.1, the IP address 192.168.0.3 and the IP address 192.168.0.5 belong to the same network segment.
For another example, the gateway corresponding to the IP address 192.168.1.20 is 192.168.1.1, the gateway corresponding to the IP address 192.168.2.9 is 192.168.2.1, and the gateways corresponding to the two IP addresses are different, so that the IP address 192.168.1.20 and the IP address 192.168.2.9 belong to different network segments.
For example, when the current gateway selection scene of the client is a test scene, the gateway information corresponding to the idle gateway of the same network segment in the gateway information list is obtained.
For example, if gateway 192.168.1.1 is selected, a list of free gateway information is generated as shown in table 2.
Table 2 is a list of idle gateway information
Gateway (GW) | IP address | Use state |
192.168.1.1 | 192.168.1.20 | Idle |
192.168.1.1 | 192.168.1.30 | Idle |
192.168.1.1 | 192.168.1.40 | Idle |
For example, if gateway 192.168.3.1 is selected, a list of free gateway information is generated as shown in table 3.
Table 3 is a list of idle gateway information
Gateway (GW) | IP address | Use state |
192.168.3.1 | 192.168.3.15 | Idle |
192.168.3.1 | 192.168.3.16 | Idle |
In other embodiments, when the current gateway selection scene of the client is a deployment scene, gateway information corresponding to idle gateways of different network segments in the gateway information list is obtained.
For example, if the current gateway selection scene of the client is a deployment scene, the gateway information corresponding to the idle gateways of different network segments in the gateway information list is obtained, and an idle gateway information list is generated, as shown in table 4.
Table 4 is a list of idle gateway information
Gateway (GW) | IP address | Use state |
192.168.0.1 | 192.168.0.3 | Idle |
192.168.1.1 | 192.168.1.20 | Idle |
192.168.1.1 | 192.168.1.30 | Idle |
192.168.1.1 | 192.168.1.40 | Idle |
192.168.3.1 | 192.168.3.15 | Idle |
192.168.3.1 | 192.168.3.16 | Idle |
The current gateway selection scene of the client can be determined according to the data of the server or according to the selection instruction input by the user; by selecting a scene according to the current gateway of the client, gateway information corresponding to the idle gateway can be obtained from the gateway information list, and the idle gateway information list is generated.
Step S1023, the gateway information corresponding to the idle gateway is used as a global variable and stored in a shared buffer area in the client.
In some embodiments, after determining the gateway information corresponding to the idle gateway in the gateway information list, the gateway information corresponding to the idle gateway is stored as a global variable in a shared cache in the client.
Illustratively, the list of free gateway information is stored as a global variable to a shared cache in the client.
It should be noted that, by storing the gateway information corresponding to the idle gateway as a global variable, the gateway information corresponding to the idle gateway is enabled to be valid in the whole program or the file, and can be repeatedly called, and will not be disabled after one call.
Illustratively, the above list of idle gateway information is stored as a global variable in a shared cache in the client. When the gateway information corresponding to the idle gateway is needed, the gateway information corresponding to the idle gateway can be directly read from the shared buffer area, so that the efficiency is improved.
As shown in fig. 8, acquiring gateway information corresponding to the idle gateway in the client may include step S1024.
Step S1024, the gateway information corresponding to the idle gateway is obtained from the shared buffer area in the client.
Illustratively, a network filtering driver is installed in the client, and gateway information corresponding to the idle gateway can be obtained from the shared cache region through the network filtering driver. For example, from the idle gateway information list in the shared buffer area, the idle gateway and the IP address corresponding to the idle gateway are obtained.
For example, the number of the acquired IP addresses corresponding to the idle gateway may be determined according to the number of the gateway provisioning messages. For example, if the client receives n gateway provisioning messages, it indicates that there are n servers that need to be communicatively connected to the client; in order to ensure that the IP addresses after the gateways of each server are configured are different, n IP addresses corresponding to idle gateways need to be acquired.
In some embodiments, if the two gateway providing messages a and b are received, the IP addresses corresponding to the two idle gateways need to be obtained from the idle gateway information list in the shared buffer.
For example, IP addresses corresponding to two idle gateways of the same network segment may be obtained. For example, the acquired IP addresses are 192.168.1.20 and 192.168.1.30.
For example, IP addresses corresponding to two idle gateways of different network segments may also be obtained. For example, the acquired IP addresses are 192.168.0.3 and 192.168.1.30.
By acquiring the gateway information corresponding to the idle gateway from the shared buffer area, the gateway providing message can be modified by following the gateway information corresponding to the idle gateway.
Step S103, configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message.
The gateway information may include an idle gateway and an IP address corresponding to the gateway; the gateway provisioning message may include a default gateway for the server and an IP address corresponding to the default gateway.
The process of configuring the gateway of the server refers to replacing the default gateway and the IP address corresponding to the default gateway in the gateway providing message according to the idle gateway and the IP address corresponding to the idle gateway, and the configured gateway information includes the idle gateway and the IP address corresponding to the idle gateway.
For example, a network filter driver may be installed at a client. The network filtering driver is used for configuring the gateway of the server according to the gateway information and the gateway providing information corresponding to the idle gateway.
By configuring the gateway of the server, the IP address corresponding to the default gateway in the server can be replaced by the IP address corresponding to the idle gateway, so that the problem of gateway conflict is avoided in advance when a plurality of servers are in communication connection with the client, and the efficiency of communication connection is improved.
Referring to fig. 11, fig. 11 is a flowchart of configuring a gateway of a server according to gateway information and gateway providing messages corresponding to idle gateways in step S103, and may include the following steps S1031 and S1032.
Step S1031, modifying the gateway providing message according to the gateway information corresponding to the idle gateway, to obtain configured gateway information.
The network filtering driver has functions of changing, deleting, adding data and the like to the network data packet. The modification of the gateway provisioning message sent by the server may be determined by network filtering.
The gateway providing information is modified by the network filtering driver based on the gateway information corresponding to the idle gateway, and the configured gateway information is obtained. Through the network filtering driving, the default gateway and the IP address in the gateway providing message can be modified, and then the default gateway and the IP address in the server can be updated, so that gateway conflict between a plurality of servers and clients in communication connection is avoided.
In some embodiments, when the idle gateway is the same as the default gateway in the gateway provisioning message, the IP address of the default gateway is replaced according to the IP address corresponding to the idle gateway.
In other embodiments, when the idle gateway is different from the default gateway in the gateway provisioning message, the default gateway is replaced according to the idle gateway, and the IP address of the default gateway is replaced according to the IP address corresponding to the idle gateway.
It will be appreciated that the gateway of the server is configured in order to modify the IP address corresponding to the default gateway in the server. When the default gateway in the idle gateway and the default gateway in the server do not belong to the same network segment, the default gateway also needs to be modified to obtain the modified default gateway.
The configured gateway information includes an idle gateway and an IP address corresponding to the idle gateway.
Step S1032, sending the configured gateway information to the server, so that the server updates a default gateway based on the configured gateway information, and distributes the default gateway information corresponding to the updated default gateway to the client.
It will be appreciated that during the selection phase of the DHCP process, the client needs to request from the server the IP address corresponding to the default gateway for the server. In the embodiment of the invention, since the gateway providing message sent by the server is configured, the configured gateway information needs to be sent to the server to request to use the configured gateway information.
The idle gateway and the IP address corresponding to the idle gateway are sent to the server to request the use of the IP address corresponding to the idle gateway. For example, if there are two servers a and B, and the IP addresses corresponding to the idle gateway include 192.168.1.20 and 192.168.1.30, the IP address 192.168.1.20 may be sent to the a server, and the IP address 192.168.1.30 may be sent to the B server; requesting use of the IP address 192.168.1.20 from the a server and requesting use of the IP address 192.168.1.30 from the B server ensures that the a server and the B server do not assign the same IP address to the client, avoiding IP address conflicts.
The configured gateway information is sent to the server, so that the server can update the default gateway, and further the default gateway information corresponding to the updated default gateway is distributed to the client, and the phenomenon of gateway conflict can be avoided.
As shown in fig. 11, after the configured gateway information is transmitted to the server in step S1032, the following steps S1033 and S1034 may be further included.
Step S1033, receiving default gateway information allocated by the server, where the default gateway information is obtained by updating, by the server, a default gateway in the server according to the configured gateway information.
When the default gateway in the server is updated, the IP address corresponding to the default gateway is updated. The default gateway information thus obtained after updating includes the updated default gateway and the IP address corresponding to the updated default gateway.
For example, if the configured gateway information includes the idle gateway 192.168.1.1 and the IP address 192.168.1.30, the server may update the default gateway in the server and the IP address corresponding to the default gateway according to the idle gateway 192.168.1.1 and the IP address 192.168.1.30, to obtain default gateway information corresponding to the updated default gateway. The default gateway information obtained by the server is then sent to the client.
The default gateway information corresponding to the updated default gateway comprises: the default gateway is 192.168.1.1, and the IP address corresponding to the default gateway is 192.168.1.30.
And step S1034, establishing communication connection with the server according to the default gateway information.
Illustratively, a communication connection is established with the server according to the default gateway information corresponding to the updated default gateway, so as to perform data transmission.
In some embodiments, if the default gateway after the client receives the update of the server a is 192.168.1.1, the IP address corresponding to the default gateway is 192.168.1.20, the default gateway after the update of the server B is 192.168.3.1, and the IP address corresponding to the default gateway is 192.168.3.15, the client establishes a communication connection with the server a according to the IP address 192.168.1.20, and establishes a communication connection with the server B according to the IP address 192.168.3.15. Therefore, gateway conflict can not occur when the client establishes communication connection with the server A and the server B, and the efficiency of communication connection is improved.
According to the gateway configuration method, the client, the server, the system and the storage medium provided by the embodiment, when the port of the server accessed to the client is detected, the gateway request message is sent to the server, so that the server can send the gateway providing message comprising the default gateway and the IP address; the default gateway and the IP address in the server can be determined by receiving the gateway providing message sent by the server; through a preset gateway traversing command, gateway information corresponding to the port in the client is collected in real time or at regular time, and a gateway information list is generated or updated, so that the latest gateway information of the port can be collected; the current gateway selection scene of the client can be determined according to the data of the server or according to the selection instruction input by the user; according to the current gateway selection scene of the client, gateway information corresponding to the idle gateway can be obtained from the gateway information list, and an idle gateway information list is generated; by configuring the gateway of the server, the IP address corresponding to the default gateway in the server can be replaced by the IP address corresponding to the idle gateway, so that the problem of gateway conflict is avoided in advance when a plurality of servers are in communication connection with the client, and the efficiency of communication connection is improved.
As shown in fig. 12, fig. 12 is a schematic flowchart of a gateway configuration method according to still another embodiment of the present invention. The gateway configuration method can be applied to the server, and the gateway providing information is sent to the client according to the gateway request information sent by the client, so that the client configures the gateway of the server according to the gateway providing information, gateway conflict occurring when the client and the server establish communication connection is avoided in advance, and the efficiency of communication connection is improved. The gateway configuration method includes steps S201 to S204.
Step S201, receiving gateway request information sent by a client, and generating gateway providing information according to the gateway request information.
Illustratively, as shown in FIG. 7, after the signal line of the server accesses the port of the client, the client requests allocation of an IP address to the server based on a dynamic host configuration protocol; for example, the client sends a gateway request message to the server to cause the server to return a gateway offer message based on the gateway request message.
Illustratively, default gateway information in the server is obtained from the gateway request message, and a gateway provisioning message is generated from the default gateway information. Wherein the gateway provisioning message includes default gateway information.
It should be noted that, the gateway in the server is a default gateway. In the DHCP process, the server needs to assign the default gateway and the IP address corresponding to the default gateway to the client.
Illustratively, the default gateway information herein may include, but is not limited to, a default gateway and an IP address corresponding to the default gateway.
For example, the default gateway in the server is 192.168.1.1, and the IP address corresponding to the default gateway is 192.168.1.2.
By acquiring the default gateway information according to the gateway request message, the gateway providing message including the default gateway information can be sent to the client, and the default gateway information is further configured by the client.
Step S202, the gateway providing message is sent to the client, so that the client configures the gateway of the server according to the gateway providing message.
In some embodiments, after generating the gateway provisioning message including the default gateway information, the gateway provisioning message needs to be sent to the client. The gateway provisioning message is illustratively sent to the client as a network data packet to enable the client to configure according to a default gateway in the gateway provisioning message to obtain a configured gateway message.
Illustratively, configuring may include replacing the gateway with a default gateway in the message according to an idle gateway in the client.
The specific process of the client configuring the gateway of the server according to the gateway providing message may be referred to the detailed description of the above embodiments, which is not repeated herein.
By sending the gateway provisioning message to the client, the client may be caused to configure the gateway of the server according to the gateway provisioning message; and the server can update the default gateway according to the configured gateway information, so that gateway conflict between the server and the client during communication connection can be avoided.
Step 203, receiving the configured gateway information sent by the client, and updating the default gateway in the server according to the configured gateway information.
After receiving the gateway providing message sent by the server, the client can filter and drive the IP address corresponding to the default gateway in the gateway providing message through the network to replace the IP address corresponding to the default gateway in the idle gateway to obtain the configured gateway information.
The specific process of replacing the IP address corresponding to the default gateway in the gateway provisioning message may be referred to the detailed description of the above embodiment, which is not repeated herein.
For example, after obtaining the configured gateway information, the client may send the configured gateway information to the server through a network data packet, so that the server updates a default gateway in the server according to the configured gateway information.
The configured gateway information comprises an idle gateway and an IP address corresponding to the idle gateway.
For example, after updating the default gateway in the server, the current default gateway of the server is an idle gateway, and the IP address corresponding to the idle gateway of the IP address corresponding to the current default gateway.
In some embodiments, if the idle gateway is the same as the default gateway in the server, the IP address of the default gateway is replaced according to the IP address corresponding to the idle gateway.
For example, if the idle gateway is 192.168.1.1, the IP address corresponding to the idle gateway is 192.168.1.20, and the default gateway in the server is 192.168.1.1, and the IP address corresponding to the default gateway is 192.168.1.2, then the IP address corresponding to the default gateway needs to be replaced with 192.168.1.20.
In other embodiments, if the idle gateway is different from the default gateway in the server, the default gateway is replaced according to the idle gateway, and the IP address of the default gateway is replaced according to the IP address corresponding to the idle gateway.
For example, if the idle gateway is 192.168.1.1, the IP address corresponding to the idle gateway is 192.168.1.20, and if the default gateway in the server is 192.168.5.1, the IP address corresponding to the default gateway is 192.168.5.8, the default gateway 192.168.5.1 needs to be replaced with 192.168.1.1, and the IP address 192.168.5.8 corresponding to the default gateway needs to be replaced with 192.168.1.20.
The default gateway in the server and the IP address corresponding to the default gateway can be updated according to the configured idle gateway and the IP address corresponding to the idle gateway, so that gateway conflict can not be generated when the server and the client establish communication connection.
And step S204, distributing the default gateway information corresponding to the updated default gateway to the client so that the client establishes communication connection with the server according to the default gateway information.
It will be appreciated that the gateway changes and the corresponding IP address of the gateway changes. In the embodiment of the invention, the default gateway information corresponding to the updated default gateway is allocated to the client, which means that the default gateway and the IP address corresponding to the default gateway are allocated to the client. By distributing the updated default gateway to the client, the client can establish communication connection with the server according to the updated default gateway, so that gateway conflict can be avoided, and the efficiency of communication connection is improved.
For example, if the updated default gateway is 192.168.1.1 and the IP address corresponding to the default gateway is 192.168.1.20, the default gateway 192.168.1.1 and the IP address 192.168.1.20 corresponding to the default gateway 192.168.1.1 are allocated to the client through the network data packet.
In some embodiments, if the updated default gateway of the server a is 192.168.1.1, the IP address corresponding to the default gateway is 192.168.1.20, the updated default gateway of the server B is 192.168.3.1, the IP address corresponding to the default gateway is 192.168.3.15, the client establishes a communication connection with the server a according to the IP address 192.168.1.20, and establishes a communication connection with the server B according to the IP address 192.168.3.15. So that gateway collision does not occur when the client establishes communication connection with the server A and the server B.
According to the gateway configuration method, the client, the server, the system and the storage medium provided by the embodiment, by receiving the gateway request message sent by the client, default gateway information in the server can be obtained according to the gateway request message, and a gateway providing message comprising the default gateway information can be generated; by sending the gateway provisioning message to the client, the client may be enabled to configure the gateway of the server according to the gateway provisioning message; the default gateway in the server can be updated according to the configured gateway information by receiving the configured gateway information sent by the client; by distributing the default gateway information corresponding to the updated default gateway to the client, the client establishes communication connection with the server according to the updated default gateway information, so that gateway conflict can be avoided when the server establishes communication connection with the client, and the efficiency of communication connection is improved.
The embodiment of the invention also provides a storage medium which is used for readable storage, the storage medium stores a program, the program comprises program instructions, and the processor executes the program instructions to realize any gateway configuration method provided by the embodiment of the invention.
For example, the program is loaded by a processor, and the following steps may be performed:
receiving gateway providing information sent by a server; acquiring gateway information corresponding to an idle gateway in the client; and configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message.
For another example, the program is loaded by a processor, and the following steps may be performed:
Receiving a gateway request message sent by a client, and generating a gateway providing message according to the gateway request message; sending the gateway providing message to the client so that the client configures a gateway of the server according to the gateway providing message; receiving configured gateway information sent by the client, and updating a default gateway in the server according to the configured gateway information; and distributing the default gateway information corresponding to the updated default gateway to the client so that the client establishes communication connection with the server according to the default gateway information.
The storage medium may be an internal storage unit of the client and the server described in the foregoing embodiments, for example, hard disks or memories of the client and the server. The storage medium may also be external storage devices of the client and the server, such as plug-in hard disks equipped on the client and the server, smart memory cards (SMART MEDIA CARD, SMC), secure digital cards (Secure DIGITAL CARD, SD Card), flash memory cards (FLASH CARD), and the like.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a storable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). The term storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the present invention shall fall within the scope of the appended claims.
Claims (15)
1. A gateway configuration method applied to a client, the method comprising:
receiving gateway providing information sent by a server;
acquiring gateway information corresponding to an idle gateway in the client;
configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message;
before the gateway information corresponding to the idle gateway in the client is acquired, the method further comprises:
Acquiring gateway information corresponding to all ports in the client to generate a gateway information list;
Determining gateway information corresponding to an idle gateway in the gateway information list;
The gateway information corresponding to the idle gateway is used as a global variable and stored into a shared cache area in the client;
The obtaining gateway information corresponding to the idle gateway in the client includes:
and acquiring gateway information corresponding to the idle gateway from the shared cache area in the client.
2. The gateway configuration method according to claim 1, wherein the client is provided with a network filtering driver, and the configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message includes:
and configuring the gateway of the server based on the gateway information corresponding to the idle gateway and the gateway providing message through the network filtering driver.
3. The gateway configuration method according to claim 1, wherein before the receiving the gateway providing message sent by the server, further comprising:
And when detecting that the server accesses the port of the client, sending a gateway request message to the server so that the server returns a gateway providing message according to the gateway request message.
4. The method according to claim 1, wherein the obtaining gateway information corresponding to a port in the client to generate a gateway information list includes:
calling a preset gateway traversal command;
according to the gateway traversing command, sequentially collecting gateway information corresponding to ports in the client;
and generating a gateway information list according to the collected gateway information.
5. The gateway configuration method according to claim 1, wherein the determining gateway information corresponding to an idle gateway in the gateway information list includes:
determining a current gateway selection scene of the client;
and acquiring gateway information corresponding to the idle gateway in the gateway information list according to the current gateway selection scene of the client.
6. The gateway configuration method of claim 5, wherein said determining a current gateway selection scenario for the client comprises:
determining the number of servers, and determining the current gateway selection scene of the client according to the number of servers; or (b)
And displaying a gateway selection scene table on a display interface of the client, receiving a selection instruction input by a user on the display interface, and determining a current gateway selection scene of the client according to the selection instruction, wherein the gateway selection scene table comprises a test scene and a deployment scene.
7. The gateway configuration method according to claim 6, wherein said determining a current gateway selection scenario of the client according to the number of servers comprises:
When the number of the servers is larger than a preset number value, determining that the current gateway selection scene of the client is a test scene; or (b)
And when the number of the servers is smaller than or equal to the preset number value, determining that the current gateway selection scene of the client is a deployment scene.
8. The method for configuring a gateway according to claim 6, wherein the obtaining gateway information corresponding to the idle gateway in the gateway information list according to the current gateway selection scenario of the client includes:
When the current gateway selection scene of the client is a test scene, acquiring gateway information corresponding to idle gateways of the same network segment in the gateway information list; or (b)
When the current gateway selection scene of the client is a deployment scene, acquiring gateway information corresponding to idle gateways of different network segments in the gateway information list.
9. The gateway configuration method according to claim 1, wherein the configuring the gateway of the server according to the gateway information corresponding to the idle gateway and the gateway providing message includes:
Modifying the gateway providing message according to the gateway information corresponding to the idle gateway to obtain configured gateway information;
and sending the configured gateway information to the server so that the server updates a default gateway based on the configured gateway information, and distributing the default gateway information corresponding to the updated default gateway to the client.
10. The gateway configuration method according to claim 9, wherein the gateway information includes an idle gateway and IP addresses corresponding to the idle gateway; the modifying the gateway providing message according to the gateway information corresponding to the idle gateway to obtain configured gateway information includes:
When the idle gateway is the same as a default gateway in the gateway providing message, replacing an IP address corresponding to the default gateway according to the IP address corresponding to the idle gateway; or (b)
When the idle gateway is different from a default gateway in the gateway providing message, replacing the default gateway according to the idle gateway, and replacing an IP address corresponding to the default gateway according to the IP address corresponding to the idle gateway;
The configured gateway information comprises the idle gateway and an IP address corresponding to the idle gateway.
11. The gateway configuration method according to claim 9, wherein after the configured gateway information is sent to the server, further comprising:
Receiving default gateway information distributed by the server, wherein the default gateway information is obtained by updating a default gateway in the server according to the configured gateway information by the server;
And establishing communication connection with the server according to the default gateway information.
12. A gateway configuration method applied to a server, the method comprising:
receiving a gateway request message sent by a client, and generating a gateway providing message according to the gateway request message;
the gateway providing message is sent to the client, so that the client configures the gateway of the server according to the gateway information corresponding to the idle gateway in the client and the gateway providing message;
Receiving configured gateway information sent by the client, and updating a default gateway in the server according to the configured gateway information;
and distributing the default gateway information corresponding to the updated default gateway to the client so that the client establishes communication connection with the server according to the default gateway information.
13. A client, comprising:
a network filtering drive;
a memory for storing a program;
A processor for calling the program in the memory to execute:
receiving gateway providing information sent by a server;
acquiring gateway information corresponding to an idle gateway in the client;
configuring a gateway of the server according to gateway information corresponding to the idle gateway and the gateway providing information through the network filtering driver;
before the gateway information corresponding to the idle gateway in the client is acquired, the method further comprises:
Acquiring gateway information corresponding to all ports in the client to generate a gateway information list;
Determining gateway information corresponding to an idle gateway in the gateway information list;
The gateway information corresponding to the idle gateway is used as a global variable and stored into a shared cache area in the client;
The obtaining gateway information corresponding to the idle gateway in the client includes:
and acquiring gateway information corresponding to the idle gateway from the shared cache area in the client.
14. A server comprising a processor and a memory;
The memory is used for storing programs;
the processor is configured to execute the program and implement the gateway configuration method according to claim 12 when the program is executed.
15. A storage medium for readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement:
A gateway configuration method as claimed in any one of claims 1 to 11, or
The gateway configuration method of claim 12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010478554.8A CN113746653B (en) | 2020-05-29 | 2020-05-29 | Gateway configuration method, client, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010478554.8A CN113746653B (en) | 2020-05-29 | 2020-05-29 | Gateway configuration method, client, server and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113746653A CN113746653A (en) | 2021-12-03 |
CN113746653B true CN113746653B (en) | 2024-07-23 |
Family
ID=78724953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010478554.8A Active CN113746653B (en) | 2020-05-29 | 2020-05-29 | Gateway configuration method, client, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113746653B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101656763B (en) * | 2009-09-11 | 2013-03-13 | 华为技术有限公司 | IP address automatic distribution method, client and server |
WO2011029406A1 (en) * | 2009-09-11 | 2011-03-17 | 华为技术有限公司 | Ip address automatic assignment method, equipment and system |
CN101702718A (en) * | 2009-11-18 | 2010-05-05 | 中兴通讯股份有限公司 | Method and device for managing user terminal equipment |
CN105323120A (en) * | 2015-11-26 | 2016-02-10 | 上海斐讯数据通信技术有限公司 | Test method, test device and test terminal for DHCP service side |
CN105847464B (en) * | 2016-05-30 | 2019-11-29 | 上海斐讯数据通信技术有限公司 | IP address management method and DHCP client under a kind of more Dynamic Host Configuration Protocol server network environments |
-
2020
- 2020-05-29 CN CN202010478554.8A patent/CN113746653B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113746653A (en) | 2021-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111460460B (en) | Task access method, device, proxy server and machine-readable storage medium | |
US9999030B2 (en) | Resource provisioning method | |
CN108924268B (en) | Container cloud service system and pod creation method and device | |
CN104219127B (en) | A kind of creation method and equipment of virtual network example | |
EP3664420B1 (en) | Managing address spaces across network elements | |
CN111404753B (en) | Flat network configuration method, computer equipment and storage medium | |
CN110881007B (en) | Container cluster network access method and device | |
US9705741B2 (en) | Dynamically allocating network addresses | |
CN107210924B (en) | Method and apparatus for configuring a communication system | |
CN111092921B (en) | Data acquisition method, device and storage medium | |
US11403009B2 (en) | Storage system, and method and apparatus for allocating storage resources | |
CN114172905B (en) | Cluster network networking method, device, computer equipment and storage medium | |
CN107809495B (en) | Address management method and device | |
EP4068725B1 (en) | Topology-based load balancing for task allocation | |
CN110224917B (en) | Data transmission method, device and system and server | |
CN112637265B (en) | Equipment management method, device and storage medium | |
US10608942B1 (en) | Reducing routes based on network traffic utilization | |
CN110636149B (en) | Remote access method, device, router and storage medium | |
CN113746653B (en) | Gateway configuration method, client, server and storage medium | |
CN113904871B (en) | Access method of network slice, PCF entity, terminal and communication system | |
CN114448932B (en) | Address allocation method, device and electronic device | |
CN106330492A (en) | A method, device and system for configuring user equipment forwarding table | |
CN111988446B (en) | Message processing method and device, electronic equipment and storage medium | |
CN110365742B (en) | Multi-active load balancing application creation method and device, computer equipment and storage medium | |
CN114079586A (en) | Access control method and 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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20240624 Address after: 210012 No. 68 Bauhinia Road, Yuhuatai District, Jiangsu, Nanjing Applicant after: Nanjing Zhongxing New Software Co.,Ltd. Country or region after: China Address before: 518057 Zhongxing building, science and technology south road, Nanshan District hi tech Industrial Park, Guangdong, Shenzhen Applicant before: ZTE Corp. Country or region before: China |
|
GR01 | Patent grant | ||
GR01 | Patent grant |