Nothing Special   »   [go: up one dir, main page]

CN109618019B - Dynamic address allocation service configuration method, device, equipment and storage medium - Google Patents

Dynamic address allocation service configuration method, device, equipment and storage medium Download PDF

Info

Publication number
CN109618019B
CN109618019B CN201811587828.6A CN201811587828A CN109618019B CN 109618019 B CN109618019 B CN 109618019B CN 201811587828 A CN201811587828 A CN 201811587828A CN 109618019 B CN109618019 B CN 109618019B
Authority
CN
China
Prior art keywords
wireless router
state
dynamic address
wan port
address allocation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811587828.6A
Other languages
Chinese (zh)
Other versions
CN109618019A (en
Inventor
陈杰
宋文平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN201811587828.6A priority Critical patent/CN109618019B/en
Publication of CN109618019A publication Critical patent/CN109618019A/en
Application granted granted Critical
Publication of CN109618019B publication Critical patent/CN109618019B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for dynamic address allocation service configuration, wherein the method comprises the following steps: when the current wireless router is in a target working mode, detecting the WAN port state of the current wireless router; if the WAN port state is detected to be an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers; and if the current wireless router is detected to be in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in a closed state. The invention realizes that the internal node in the AP + WDS networking which is normal in WDS bridging connection automatically closes the dynamic address allocation service, thereby not needing to manually configure the dynamic address allocation service of the internal node in the AP + WDS networking and further solving the problem of abnormal access of the user terminal in the AP + WDS networking.

Description

Dynamic address allocation service configuration method, device, equipment and storage medium
Technical Field
The present invention relates to the field of wireless communications, and in particular, to a method, an apparatus, a device, and a storage medium for dynamic address allocation service configuration.
Background
The WDS (Wireless Distribution System) functions as a relay of a Wireless network, and by turning on the WDS function on a Wireless router, it can extend and expand Wireless signals, thereby covering a wider and wider range. If the wireless router supports the WDS function, the wireless router can work in an AP + WDS mode, not only can be used as a wireless Access Point (AP) to provide a common wireless routing function, but also can be used as a bridging device of the WDS, expands wireless signals and improves the coverage. When the wireless router is in an AP + WDS working mode, the dynamic address allocation service is started for facilitating the user to surf the internet and carry out configuration management, and the IP address is automatically allocated to the connected user terminal.
In the AP + WDS networking, there is one wireless router as an egress node to communicate with an external network, and the rest are internal nodes and bridge devices. Because each wireless router in the networking can provide a service of dynamic address allocation, if an IP address acquired by a user terminal is allocated by an internal node in the networking, the user terminal is abnormal to surf the internet, and therefore the dynamic address allocation service of the internal node needs to be closed, which is the dynamic address allocation service of the manually configured wireless router at present. The dynamic address allocation service of the wireless router in the AP + WDS networking is configured manually, so that certain requirements are met on the technical level of operators, the configuration difficulty is high, the configuration process is complex, and the networking flexibility is reduced.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for configuring dynamic address allocation service, and aims to solve the technical problems of high configuration difficulty, complex configuration process and high requirement on the technical level of operators in the conventional method for manually configuring the dynamic address allocation service of a wireless router in an AP + WDS networking.
In order to achieve the above object, the present invention provides a dynamic address allocation service configuration method, which includes the steps of:
when the current wireless router is in a target working mode, detecting the WAN port state of the current wireless router;
if the WAN port state is detected to be an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers;
and if the current wireless router is detected to be in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in a closed state.
Optionally, after the step of detecting the wide area network WAN port status of the current wireless router, the method further includes:
and if the WAN port state is detected to be the connected state, setting the dynamic address allocation service of the current wireless router to be in an open state.
Optionally, after the step of detecting whether the current wireless router is in bridge connection with other wireless routers if the WAN port state is detected to be the unconnected state, the method further includes:
and if detecting that the current wireless router is not in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in an open state.
Optionally, the step of detecting the wide area network WAN port status of the current wireless router includes:
detecting whether a WAN port of the current wireless router is inserted into a network cable or not;
if the WAN port is detected to be inserted into the network cable, determining that the current state of the WAN port of the wireless router is a connected state;
and if the WAN port is detected not to be inserted into the network cable, determining that the current state of the wireless router WAN port is an unconnected state.
Optionally, the step of detecting the wide area network WAN port status of the current wireless router includes:
detecting whether a current wireless router obtains an IP address through a WAN port;
if the IP address is obtained through the WAN port, determining that the current state of the WAN port of the wireless router is a connected state;
and if the condition that the IP address is not acquired through the WAN port is detected, determining that the current state of the WAN port of the wireless router is an unconnected state.
Optionally, the step of detecting the wide area network WAN port status of the current wireless router includes:
detecting whether the domain name resolution of the current wireless router is normal;
if the domain name is detected to be analyzed normally, determining that the WAN port state of the current wireless router is a connected state;
and if the domain name is detected to be abnormal, determining that the WAN port state of the current wireless router is an unconnected state.
Optionally, the step of detecting whether the current wireless router is in bridge connection with other wireless routers includes:
counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
if the number of beacon frames received in the preset time length is greater than the preset number of frames, determining that the current wireless router is in bridge connection with other wireless routers;
and if the number of beacon frame frames received in the preset time length is not greater than the preset frame number, determining that the current wireless router is not in bridge connection with other wireless routers.
In addition, to achieve the above object, the present invention further provides a dynamic address allocation service configuration device, including:
the detection module is used for detecting the WAN port state of the current wireless router when the current wireless router is in the target working mode;
the detection module is further used for detecting whether the current wireless router is in bridge connection with other wireless routers or not if the WAN port state is detected to be an unconnected state;
and the dynamic address allocation service configuration module is used for setting the dynamic address allocation service of the current wireless router to be in a closed state if the current wireless router is detected to be in bridge connection with other wireless routers.
In addition, to achieve the above object, the present invention further provides a dynamic address allocation service configuration device, which includes a memory, a processor and a dynamic address allocation service configuration program stored in the memory and operable on the processor, and when executed by the processor, the dynamic address allocation service configuration program implements the steps of the dynamic address allocation service configuration method described above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, having a dynamic address allocation service configuration program stored thereon, which when executed by a processor implements the steps of the dynamic address allocation service configuration method as described above.
The method detects the WAN port state of the current router when the current wireless router is in a target working mode; if the WAN port state is detected to be the unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers; if the bridge connection between the current wireless router and other wireless routers is detected, the dynamic address allocation service of the current router is set to be in a closed state, and the automatic closing of the dynamic address allocation service by the internal node with normal WDS bridge connection in the AP + WDS networking is realized, so that the dynamic address allocation service of the internal node in the AP + WDS networking does not need to be configured manually, and the problem of abnormal internet access of the user terminal in the AP + WDS networking is solved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a dynamic address assignment service configuration method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a dynamic address assignment service configuration method according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a solution for the technical problems that the dynamic address allocation service of a wireless router in an AP + WDS networking is manually configured at present, the configuration difficulty is high, the configuration process is complex, and the requirement on the technical level of operators is high; if the WAN port state is detected to be the unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers; if the bridge connection between the current wireless router and other wireless routers is detected, the dynamic address allocation service of the current router is set to be in a closed state, and the automatic closing of the dynamic address allocation service by the internal node with normal WDS bridge connection in the AP + WDS networking is realized, so that the dynamic address allocation service of the internal node in the AP + WDS networking does not need to be configured manually, and the problem of abnormal internet access of the user terminal in the AP + WDS networking is solved.
The invention provides a dynamic address allocation service configuration device, and referring to fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 1 is a schematic structural diagram of a hardware operating environment in which a device can be configured for a dynamic address assignment service. The dynamic address allocation service configuration device in the embodiment of the present invention may be a wireless access device having an AP + WDS operating mode, such as a wireless router and a wireless AP.
As shown in fig. 1, the dynamic address allocation service configuration apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the dynamic address assignment service configuration device architecture shown in fig. 1 does not constitute a limitation of the dynamic address assignment service configuration device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a dynamic address assignment service configuration program.
In the dynamic address allocation service configuration device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and communicating with the background server; the user interface 1003 is mainly used for connecting a client and communicating with the client; and the processor 1001 may be configured to invoke a dynamic address assignment service configuration program stored in the memory 1005 and perform the following operations:
when the current wireless router is in a target working mode, detecting the WAN port state of the current wireless router;
if the WAN port state is detected to be an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers;
and if the current wireless router is detected to be in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in a closed state.
Further, after the step of detecting the current WAN port status of the wireless router, the processor 1001 may be configured to invoke a dynamic address assignment service configuration program stored in the memory 1005, and further perform the following operations:
and if the WAN port state is detected to be the connected state, setting the dynamic address allocation service of the current wireless router to be in an open state.
Further, after the step of detecting whether the current wireless router is in bridge connection with another wireless router if the WAN port state is detected to be an unconnected state, the processor 1001 may be configured to invoke the dynamic address assignment service configuration program stored in the memory 1005, and further perform the following operations:
and if detecting that the current wireless router is not in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in an open state.
Further, the step of detecting the wide area network WAN port status of the current wireless router comprises:
detecting whether a WAN port of the current wireless router is inserted into a network cable or not;
if the WAN port is detected to be inserted into the network cable, determining that the current state of the WAN port of the wireless router is a connected state;
and if the WAN port is detected not to be inserted into the network cable, determining that the current state of the wireless router WAN port is an unconnected state.
Further, the step of detecting the wide area network WAN port status of the current wireless router comprises:
detecting whether a current wireless router obtains an IP address through a WAN port;
if the IP address is obtained through the WAN port, determining that the current state of the WAN port of the wireless router is a connected state;
and if the condition that the IP address is not acquired through the WAN port is detected, determining that the current state of the WAN port of the wireless router is an unconnected state.
Further, the step of detecting the wide area network WAN port status of the current wireless router comprises:
detecting whether the domain name resolution of the current wireless router is normal;
if the domain name is detected to be analyzed normally, determining that the WAN port state of the current wireless router is a connected state;
and if the domain name is detected to be abnormal, determining that the WAN port state of the current wireless router is an unconnected state.
Further, the step of detecting whether the current wireless router is in bridge connection with other wireless routers comprises:
counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
if the number of beacon frames received in the preset time length is greater than the preset number of frames, determining that the current wireless router is in bridge connection with other wireless routers;
and if the number of beacon frame frames received in the preset time length is not greater than the preset frame number, determining that the current wireless router is not in bridge connection with other wireless routers.
Based on the above hardware structure, the present invention provides various embodiments of the dynamic address allocation service configuration method.
Referring to fig. 2, a first embodiment of a dynamic address assignment service configuration method of the present invention provides a dynamic address assignment service configuration method, it being noted that although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than here. The dynamic address allocation service configuration method comprises the following steps:
step S1, when the current wireless router is in the target working mode, detecting the WAN port state of the current wireless router;
most of the existing wireless routers support the WDS function, and when the WDS function is started, the wireless router can be in bridge connection with other wireless routers which start the WDS function, so that wireless signals can be expanded. The AP + WDS mode of the wireless router means that the wireless router can be used as a wireless Access Point (AP) to provide a normal wireless routing function, and can also be used as a bridging device of a WDS (wireless distributed system), thereby expanding wireless signals and improving coverage. The dynamic address allocation service of the wireless router automatically allocates an IP address for the user terminal connected with the wireless router, so that the user terminal can surf the internet normally.
In the AP + WDS networking, a plurality of wireless routers are provided, wherein only one wireless router is used as an exit node to communicate with an external network, and the rest wireless routers are internal nodes and are bridging devices. The wireless router serving as the exit node needs to start a dynamic address allocation service to allocate an IP address to a connected user terminal, while the wireless router serving as the internal node cannot start the dynamic address allocation service, otherwise, when the IP address acquired by the user terminal is allocated by the internal node, the user terminal is abnormally on line. It should be guaranteed that the internal nodes in the AP + WDS network turn off the dynamic address allocation service when the WDS bridge connection is normal.
In order to implement that the wireless router as the internal node automatically turns off the dynamic address allocation service when the bridge connection is normal, in this embodiment, when the wireless router is in the target operating mode, the current wireless router starts to detect the WAN port state of the wide area network. The target operating mode may be an AP + WDS mode of the wireless router, or may be another operating mode equivalent to the AP + WDS mode. Since the egress node in the AP + WDS networking communicates with the external network through the WAN port, when the WAN port state of the wireless router is the connected state, it can be determined that the wireless router is used as the egress node in the networking. Therefore, when the wireless router detects that the WAN port state is connected, the current wireless router is determined to be the exit node, and at the moment, if the dynamic address allocation service of the current wireless router is in the closed state, the dynamic address allocation service of the current wireless router can be started.
Step S2, if the WAN port state is detected to be an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers;
and if the current wireless router detects that the WAN port state is an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers. If the current wireless router detects that the WAN port state is the unconnected state, the current wireless router is not an exit node which directly communicates with an external network but an internal node, and at the moment, the current wireless router detects whether the current wireless router is in bridge connection with other wireless routers or not so as to determine whether the current wireless router can surf the internet through other wireless routers or not.
Step S3, if it is detected that the current wireless router is connected to another wireless router in a bridge manner, the dynamic address allocation service of the current wireless router is set to be in a closed state.
And if the current wireless router detects that the WAN port state is an unconnected state and the current wireless router detects that the wireless router is in bridge connection with other wireless routers, setting the dynamic address allocation service of the current router to be in a closed state. Specifically, if the dynamic address allocation service of the current wireless router is originally in the closed state, the closed state is maintained, and if the dynamic address allocation service of the current wireless router is originally in the open state, the dynamic address allocation service is closed. It should be noted that, the WAN port of the wireless router is not connected, but is connected to another wireless router in a bridging manner, which indicates that the wireless router is an internal node that can surf the internet through another wireless router, and at this time, the dynamic address allocation service of the wireless router should be turned off, so as to ensure that the user terminal does not surf the internet abnormally due to acquiring the IP address allocated by the wireless router. Specifically, the wireless router may turn off the dynamic address assignment service by turning off the udhcpd process, but may also turn off the dynamic address assignment service by other feasible manners.
Further, if the current wireless router is not in bridge connection with other wireless routers even when detecting that the WAN port is not connected, the wireless router may set the dynamic address allocation service to be in an on state at this time.
In the embodiment, when the current wireless router is in the target working mode, the current state of the router WAN port is detected; if the WAN port state is detected to be the unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers; if the bridge connection between the current wireless router and other wireless routers is detected, the dynamic address allocation service of the current router is set to be in a closed state, and the automatic closing of the dynamic address allocation service by the internal node with normal WDS bridge connection in the AP + WDS networking is realized, so that the dynamic address allocation service of the internal node in the AP + WDS networking does not need to be configured manually, and the problem of abnormal internet access of the user terminal in the AP + WDS networking is solved.
Further, referring to fig. 3, based on the first embodiment, a second embodiment of the dynamic address allocation service configuration method of the present invention provides a dynamic address allocation service configuration method. In this embodiment, after step S1, the method further includes:
step S4, if it is detected that the WAN port state is the connected state, setting the dynamic address allocation service of the current wireless router to an open state.
The current wireless router detects the state of the WAN port of the current wireless router, and if the WAN port is detected to be connected, the dynamic address allocation service of the current wireless router is set to be in an open state. If the WAN port of the wireless router is connected, it indicates that the wireless router is an egress node for communicating with an external network, and at this time, the dynamic address allocation service of the wireless router should be started, and the router allocates IP addresses to the user terminal and the internal node. The wireless router may initiate the dynamic address assignment service by initiating the udhcpd process, or may initiate the dynamic address assignment service by other feasible means. Specifically, after the wireless router is started, if the wireless router is in a target working mode, the state of a WAN port starts to be detected, if the state of the WAN port is detected to be unconnected, whether the current router starts a dynamic address allocation service is detected, if the current router is not started, the dynamic address allocation service is started, and if the dynamic address allocation service is originally in a started state, the start state of the dynamic address allocation service is maintained. If the wireless router detects that the WAN port state is connected to the non-connected state, the WDS connection state is detected, if the WDS connection is detected to be normal, whether the dynamic address allocation service is started or not is detected, if the WDS connection is not started, the closing state of the dynamic address allocation service is continuously kept, and if the dynamic address allocation service is started, the dynamic address allocation service is closed.
In this embodiment, when the wireless router detects that the WAN port is connected, the dynamic address allocation service of the current wireless router is set to the on state, so that the egress node in the AP + WDS networking automatically turns on the dynamic address allocation service, and thus the dynamic address allocation service of the egress node in the AP + WDS networking does not need to be manually configured.
Further, based on the first or second embodiment, a third embodiment of the dynamic address allocation service configuration method of the present invention provides a dynamic address allocation service configuration method. In this embodiment, after step S2, the method further includes:
step S5, if it is detected that the current wireless router is not in bridge connection with another wireless router, the dynamic address allocation service of the current wireless router is set to be in an open state.
And if the current wireless router detects that the WAN port state is not connected and detects that the wireless router is not in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in an open state. When the wireless router detects that the state of the WAN port of the wireless router is not connected and is not in bridge connection with other wireless routers, the wireless router can not communicate with an external network and can not surf the internet through other wireless routers, and at the moment, the wireless router can start dynamic address allocation service so that a user terminal connected with the wireless router can perform network configuration on the wireless router. It should be noted that, when detecting that the WAN port is disconnected, the wireless router detects whether the dynamic address allocation service is turned on if detecting that the wireless router is successfully connected to another wireless router in a bridge connection manner, and if so, turns off the dynamic address allocation service, and if not, maintains the turned-off state of the dynamic address allocation service. Under the condition that the wireless router detects that the WAN port state is not connected, if the wireless router detects that the wireless router is not successfully in bridge connection with other wireless routers, whether the dynamic address allocation service is started or not is detected, if the wireless router is started, the starting state of the dynamic address allocation service is kept, and if the wireless router is not started, the dynamic address allocation service is started.
Further, based on the first, second or third embodiments, a fourth embodiment of the dynamic address allocation service configuration method of the present invention provides a dynamic address allocation service configuration method. In the present embodiment, step S1 includes:
step S101, detecting whether a WAN port of a current wireless router is inserted into a network cable;
when the wireless router is in the AP + WDS mode, the state of the WAN port of the current wireless router is detected, and the detection method can be realized by detecting whether the WAN port is plugged into a network cable or not.
Step S102, if the WAN port is detected to be inserted into a network cable, determining that the current state of the WAN port of the wireless router is a connected state;
the wireless router is provided with a WAN physical interface inserted into the network cable, if the wireless router detects that the WAN port is inserted into the network cable, the wireless router is used as an exit node for communicating with an external network, and at the moment, the wireless router determines that the WAN port is connected. At this time, the wireless router is used as an egress node for communicating with an external network, and if the dynamic address assignment service is in an off state, the dynamic address assignment service is set to an on state.
And step S103, if the WAN port is detected not to be plugged into a network cable, determining that the current state of the WAN port of the wireless router is an unconnected state.
If the wireless router detects that the WAN port is not plugged into the network cable, the wireless router can not communicate with the external network through the network cable, and if the wireless router can only communicate with the external network by plugging the network cable, the wireless router can determine that the state of the WAN port is in an unconnected state, namely if the wireless router detects that the WAN port is not plugged into the network cable, the wireless router is determined not to be an exit node for communicating with the external network. At this time, the wireless router, as an internal node, detects whether to bridge with other wireless routers, and determines whether to start a dynamic address allocation service according to the detection result.
Further, step S1 includes:
step S111, detecting whether the current wireless router obtains an IP address through a WAN port;
if the wireless router can communicate with the external network in a wireless relay mode, that is, the wireless router does not necessarily communicate with the external network in a mode of inserting a network cable into the WAN physical interface, the WAN port state can be detected by detecting whether the IP address is acquired through the WAN port. The wireless router can acquire the IP address through a WAN port in a wireless relay mode or a network cable insertion mode through a WAN physical interface.
Step S112, if the IP address is acquired through the WAN port, determining that the WAN port is normally connected;
if the wireless router detects that the correct IP address is obtained from the external network through the WAN port, the wireless router can be determined to normally communicate with the external network, and the state of the WAN port is connected. At this point the wireless router is determined to be an egress node.
Step S113, if it is detected that the IP address is not acquired through the WAN port, it is determined that the WAN port is not connected.
And if the IP address is detected not to be acquired through the WAN port, determining that the state of the WAN port is unconnected. The above-described method of determining the WAN port state by detecting whether the WAN port is plugged in a network cable and the method of determining the WAN port state by detecting whether the IP address is acquired through the WAN port may be applied either selectively or in combination. The combined application mode may be that after the wireless router detects that the IP address is obtained through the WAN port, the state of the WAN port is determined to be connected, if it is detected that the IP address is not obtained through the WAN port, it may be detected whether the WAN port is plugged in the network cable, if the network cable is plugged in, it may be determined that the state of the WAN port is connected, and if the network cable is not plugged in, it may be determined that the state of the WAN port is unconnected.
Further, step S1 includes:
step S121, detecting whether the domain name resolution of the current wireless router is normal;
because the wireless router may not normally communicate with the external network even if the WAN port is plugged into the network or acquires the IP address, normal communication with the external network may be used as a premise for determining that the wireless router is an egress node, that is, if the wireless router normally communicates with the external network, it is determined that the WAN port state of the wireless router is connected, it is determined that the wireless router is the egress node, and if the wireless router cannot normally communicate with the external network, it is determined that the WAN port state of the wireless router is unconnected. And whether the wireless router normally communicates with an external network is judged by detecting whether the domain name resolution of the current wireless router is normal.
Step S122, if the domain name resolution is detected to be normal, determining that the WAN port state of the current wireless router is a connected state;
if the wireless router detects that the DNS domain name resolution is normal, the wireless router can normally communicate with an external network, and the wireless router determines that the WAN port state is connected.
Step S123, if the domain name resolution is detected to be abnormal, determining that the current WAN port state of the wireless router is an unconnected state.
If the wireless router detects that the DNS domain name resolution is abnormal, the wireless router can not normally communicate with an external network, and the wireless router determines that the WAN port state is unconnected. It should be noted that, the method of determining the WAN port state by detecting whether DNS domain name resolution is normal, the method of determining the WAN port state by detecting whether a WAN port is plugged in a network cable, and the method of determining the WAN port state by detecting whether an IP address is acquired through the WAN port may be applied either selectively or in combination. The mode of combined application can be as follows: when the wireless router detects that DNS domain name resolution is normal, the WAN port connection can be determined to be normal; if the DNS domain name resolution is detected to be abnormal, after the IP address is detected to be obtained through the WAN port, the WAN port can be determined to be normally connected, if the IP address is detected not to be obtained through the WAN port, whether a network cable is inserted into the WAN port or not can be detected, if the network cable is inserted, the WAN port can be determined to be normally connected, and if the network cable is not inserted, the WAN port is determined to be not connected.
Further, based on the first, second, third or fourth embodiments, a fifth embodiment of the dynamic address allocation service configuration method according to the present invention provides a dynamic address allocation service configuration method. In this embodiment, the step of detecting the WDS connection status includes:
step S201, counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
and under the condition that the wireless router detects that the WAN port is not connected, detecting whether the current wireless router is in bridge connection with other wireless routers. The wireless router can determine whether to bridge with other wireless routers by counting the number of frames of beacon frames sent by other wireless routers received within a preset time period. The wireless router broadcasts a Beacon frame (Beacon frame) to other wireless routers in the AP + WDS mesh, and the Beacon frame has its own MAC address (hardware address) written therein. The wireless router counts the number of frames of beacon frames sent by other wireless routers received within a preset time, wherein the preset time can be set according to specific needs, and if the preset time is set to 10 seconds, the wireless router counts every 10 seconds. The wireless router obtains the MAC address by analyzing the beacon frame, and can determine which other wireless router sends the beacon frame. And the wireless routers respectively count beacon frames sent from different other wireless routers within a preset time length. If the wireless router 1 counts that 10 frames of beacon frames written with the MAC address of the router 2 are received within 10 seconds, 2 frames of beacon frames written with the MAC address of the router 3 are received.
Step S202, if the number of beacon frames sent by the other wireless routers received within the preset time length is greater than a preset frame number, determining that the WDS connection is normal;
and if the number of beacon frame frames sent by other wireless routers and received by the wireless router in the preset time duration is greater than the preset frame number, determining the bridging connection. The preset frame number can be set according to specific conditions. If the wireless router is set to receive 1 beacon frame sent by other wireless routers within 10 seconds, the wireless router is determined to be in bridge connection with other wireless routers. As a specific example, it is counted that the router 1 receives 10 frames of beacon frames written with the MAC address of the router 2 within 10 seconds, and does not receive beacon frames written with the MAC address of the router 3 and beacon frames written with the MAC address of the router 4, then the router 1 determines that the router 1 is in bridge connection with the router 2, but is not connected with the routers 3 and 4, and at this time, it is determined that the router 1 is in bridge connection with other routers in the AP + WDS network.
Step S203, if the number of beacon frames sent by the other wireless routers received in the preset time period is not greater than the preset number of frames, determining that the WDS is not connected.
And if the number of beacon frame frames sent by other wireless routers and received by the wireless router in the preset time duration is not more than the preset frame number, the wireless router is not in bridge connection with other wireless routers. And if the wireless router does not receive 1 beacon frame from other wireless routers within the preset time, determining that the wireless router is not in bridge connection with other wireless routers.
Further, whether the wireless router is in bridge connection with other wireless routers can also be determined by counting the data packets received by the wireless router, or by other feasible ways.
In this embodiment, the WDS connection state of the wireless router is determined by counting the number of beacon frames sent by other wireless routers received within a preset time period, and then the WDS connection state configures a dynamic address allocation service, so that the function of automatically configuring the dynamic address allocation service for the wireless router in the AP + WDS network is achieved.
In addition, an embodiment of the present invention further provides a dynamic address allocation service configuration device, where the dynamic address allocation service configuration device includes:
the detection module is used for detecting the WAN port state of the current wireless router when the current wireless router is in the target working mode;
the detection module is further used for detecting whether the current wireless router is in bridge connection with other wireless routers or not if the WAN port state is detected to be an unconnected state;
and the dynamic address allocation service configuration module is used for setting the dynamic address allocation service of the current wireless router to be in a closed state if the current wireless router is detected to be in bridge connection with other wireless routers.
Further, the dynamic address allocation service configuration module is further configured to set the dynamic address allocation service of the current wireless router to an open state if it is detected that the WAN port state is the connected state.
Further, the dynamic address allocation service configuration module is further configured to set the dynamic address allocation service of the current wireless router to an open state if it is detected that the current wireless router is not in bridge connection with another wireless router.
Further, the detection module is further configured to:
detecting whether a WAN port of the current wireless router is inserted into a network cable or not;
if the WAN port is detected to be inserted into the network cable, determining that the current state of the WAN port of the wireless router is a connected state;
and if the WAN port is detected not to be inserted into the network cable, determining that the current state of the wireless router WAN port is an unconnected state.
Further, the detection module is further configured to:
detecting whether a current wireless router obtains an IP address through a WAN port;
if the IP address is obtained through the WAN port, determining that the current state of the WAN port of the wireless router is a connected state;
and if the condition that the IP address is not acquired through the WAN port is detected, determining that the current state of the WAN port of the wireless router is an unconnected state.
Further, the detection module is further configured to:
detecting whether the domain name resolution of the current wireless router is normal;
if the domain name is detected to be analyzed normally, determining that the WAN port state of the current wireless router is a connected state;
and if the domain name is detected to be abnormal, determining that the WAN port state of the current wireless router is an unconnected state.
Further, the detection module is further configured to:
counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
if the number of beacon frames received in the preset time length is greater than the preset number of frames, determining that the current wireless router is in bridge connection with other wireless routers;
and if the number of beacon frame frames received in the preset time length is not greater than the preset frame number, determining that the current wireless router is not in bridge connection with other wireless routers.
The specific implementation of the dynamic address allocation service configuration apparatus of the present invention is basically the same as the above-mentioned embodiments of the dynamic address allocation service configuration method, and is not described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a dynamic address allocation service configuration program is stored on the computer-readable storage medium, and when being executed by a processor, the dynamic address allocation service configuration program implements the steps of the dynamic address allocation service configuration method described above. The specific implementation of the computer-readable storage medium of the present invention is basically the same as the embodiments of the dynamic address allocation service configuration method, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A dynamic address allocation service configuration method is characterized in that the dynamic address allocation service configuration method comprises the following steps:
when a current wireless router is in a target working mode, detecting the state of a Wide Area Network (WAN) port of the current wireless router, wherein the target working mode is an AP + WDS mode of the wireless router;
if the WAN port state is detected to be an unconnected state, detecting whether the current wireless router is in bridge connection with other wireless routers;
if the current wireless router is detected to be in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in a closed state;
if the WAN port state is detected to be a connected state, setting the dynamic address allocation service of the current wireless router to be in an open state;
after the step of detecting whether the current wireless router is in bridge connection with other wireless routers if the WAN port state is detected to be the unconnected state, the method further includes:
if the current wireless router is detected not to be in bridge connection with other wireless routers, setting the dynamic address allocation service of the current wireless router to be in an open state;
the step of detecting whether the current wireless router is in bridge connection with other wireless routers comprises the following steps:
counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
if the number of beacon frames received in the preset time length is greater than the preset number of frames, determining that the current wireless router is in bridge connection with other wireless routers;
and if the number of beacon frame frames received in the preset time length is not greater than the preset frame number, determining that the current wireless router is not in bridge connection with other wireless routers.
2. The dynamic address assignment service configuration method of claim 1, wherein the step of detecting a Wide Area Network (WAN) port status of a current wireless router comprises:
detecting whether a WAN port of the current wireless router is inserted into a network cable or not;
if the WAN port is detected to be inserted into the network cable, determining that the current state of the WAN port of the wireless router is a connected state;
and if the WAN port is detected not to be inserted into the network cable, determining that the current state of the wireless router WAN port is an unconnected state.
3. The dynamic address assignment service configuration method of claim 1, wherein the step of detecting a Wide Area Network (WAN) port status of a current wireless router comprises:
detecting whether a current wireless router obtains an IP address through a WAN port;
if the IP address is obtained through the WAN port, determining that the current state of the WAN port of the wireless router is a connected state;
and if the condition that the IP address is not acquired through the WAN port is detected, determining that the current state of the WAN port of the wireless router is an unconnected state.
4. The dynamic address assignment service configuration method of claim 1, wherein the step of detecting a Wide Area Network (WAN) port status of a current wireless router comprises:
detecting whether the domain name resolution of the current wireless router is normal;
if the domain name is detected to be analyzed normally, determining that the WAN port state of the current wireless router is a connected state;
and if the domain name is detected to be abnormal, determining that the WAN port state of the current wireless router is an unconnected state.
5. A dynamic address assignment service configuration apparatus, wherein the dynamic address assignment service configuration apparatus comprises:
the detection module is used for detecting the WAN port state of the current wireless router when the current wireless router is in a target working mode, wherein the target working mode is an AP + WDS mode of the wireless router;
the detection module is further used for detecting whether the current wireless router is in bridge connection with other wireless routers or not if the WAN port state is detected to be an unconnected state;
the dynamic address allocation service configuration module is used for setting the dynamic address allocation service of the current wireless router to be in a closed state if the fact that the current wireless router is in bridge connection with other wireless routers is detected;
the dynamic address allocation service configuration module is further configured to set a dynamic address allocation service of a current wireless router to an open state if the WAN port state is detected to be a connected state;
the dynamic address allocation service configuration module is further used for setting the dynamic address allocation service of the current wireless router to be in an open state if the current wireless router is detected not to be in bridge connection with other wireless routers;
the detection module is further configured to:
counting the number of frames of beacon frames sent by other wireless routers and received within a preset time;
if the number of beacon frames received in the preset time length is greater than the preset number of frames, determining that the current wireless router is in bridge connection with other wireless routers;
and if the number of beacon frame frames received in the preset time length is not greater than the preset frame number, determining that the current wireless router is not in bridge connection with other wireless routers.
6. A dynamic address allocation service configuration device, characterized in that the dynamic address allocation service configuration device comprises a memory, a processor and a dynamic address allocation service configuration program stored on the memory and executable on the processor, which dynamic address allocation service configuration program, when executed by the processor, implements the steps of the dynamic address allocation service configuration method according to any one of claims 1 to 4.
7. A computer-readable storage medium, having a dynamic address assignment service configuration program stored thereon, which when executed by a processor implements the steps of the dynamic address assignment service configuration method of any of claims 1 to 4.
CN201811587828.6A 2018-12-25 2018-12-25 Dynamic address allocation service configuration method, device, equipment and storage medium Active CN109618019B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811587828.6A CN109618019B (en) 2018-12-25 2018-12-25 Dynamic address allocation service configuration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811587828.6A CN109618019B (en) 2018-12-25 2018-12-25 Dynamic address allocation service configuration method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109618019A CN109618019A (en) 2019-04-12
CN109618019B true CN109618019B (en) 2021-10-22

Family

ID=66012181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811587828.6A Active CN109618019B (en) 2018-12-25 2018-12-25 Dynamic address allocation service configuration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109618019B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213079A (en) * 2019-04-24 2019-09-06 北京奇虎科技有限公司 A kind of router drop off-line configuration method, device and computer equipment
CN110098968A (en) * 2019-05-20 2019-08-06 李德鱼 A kind of wired bridge joint of router realizes the automatic setting method of radio roaming
CN111404779B (en) * 2020-03-12 2022-02-25 深圳市吉祥腾达科技有限公司 Method, device and system for testing role switching of router nodes
CN113452560A (en) * 2021-06-24 2021-09-28 博为科技有限公司 Mesh networking method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411212A (en) * 2002-08-22 2003-04-16 华为技术有限公司 Message receiving and transmitting method of combined bridge connection function and routing function
CN203378053U (en) * 2013-07-17 2014-01-01 浩利源电子(深圳)有限公司 An intelligent wireless router
CN103746908A (en) * 2013-12-31 2014-04-23 上海斐讯数据通信技术有限公司 Wireless gateway equipment and work pattern selection method thereof
CN105472485A (en) * 2015-11-20 2016-04-06 烽火通信科技股份有限公司 Method and system for controlling ONU to distribute IP automatically
CN107453945A (en) * 2017-07-14 2017-12-08 上海斐讯数据通信技术有限公司 Because router netting twine disconnects the solution method and system for causing network not connect
CN108989114A (en) * 2018-07-25 2018-12-11 新华三技术有限公司 A kind of method and device configuring router

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7280547B2 (en) * 2002-12-16 2007-10-09 Microsoft Corporation Dynamic WAN port detection
CN101286909B (en) * 2008-06-10 2010-10-13 华中科技大学 Method of automatically constructing wireless distributed system
EP3035728A1 (en) * 2014-12-16 2016-06-22 Thomson Licensing Method of selectively enabling a wireless access point or repeater

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411212A (en) * 2002-08-22 2003-04-16 华为技术有限公司 Message receiving and transmitting method of combined bridge connection function and routing function
CN203378053U (en) * 2013-07-17 2014-01-01 浩利源电子(深圳)有限公司 An intelligent wireless router
CN103746908A (en) * 2013-12-31 2014-04-23 上海斐讯数据通信技术有限公司 Wireless gateway equipment and work pattern selection method thereof
CN105472485A (en) * 2015-11-20 2016-04-06 烽火通信科技股份有限公司 Method and system for controlling ONU to distribute IP automatically
CN107453945A (en) * 2017-07-14 2017-12-08 上海斐讯数据通信技术有限公司 Because router netting twine disconnects the solution method and system for causing network not connect
CN108989114A (en) * 2018-07-25 2018-12-11 新华三技术有限公司 A kind of method and device configuring router

Also Published As

Publication number Publication date
CN109618019A (en) 2019-04-12

Similar Documents

Publication Publication Date Title
CN109618019B (en) Dynamic address allocation service configuration method, device, equipment and storage medium
US10122679B2 (en) Method, relay agent, and system for acquiring internet protocol address in network
US8108496B2 (en) Method and apparatus for selecting forwarding modes
US6810420B1 (en) Allocation of IP address by proxy to device in a local area network
CN104378455B (en) IP address distribution method and device
CN107113892B (en) Method and device for automatically networking gateway equipment
EP2169877A1 (en) Processing method and device for qinq termination configuration
CN102594944B (en) A kind of method of automatic configuration and the network equipment
CN110752975B (en) Network sharing method and device
CN104754070A (en) Method and device for learning address resolution protocol table entries and network device
US20220311733A1 (en) Communication device and communication system
CN113098722A (en) Multi-network card management method, device and computer readable storage medium
WO2016086544A1 (en) Network interface configuration method and apparatus for network device and storage medium
CN103051739A (en) Network terminal and IP (Internet Protocol) address configuration method thereof
CN113347287B (en) Host discovery and addition method, device, equipment and medium in data center
CN105188047A (en) Wifi wireless roaming Internet access method and mobile terminal
EP3182762A1 (en) Near field communication discovery method, apparatus and system
CN110505187B (en) Security rule management method, system, server and storage medium in hybrid cloud
CN108848033B (en) Method, device and storage medium for avoiding route conflict
CN109561170B (en) Address pool creating method and device, address pool management system and storage medium
CN106302838B (en) Domain name system DNS resolution processing method and device
CN104283982B (en) A kind of method that DMZ host automatically points to, system and gateway
CN112217917A (en) IP obtaining method and device for mounting terminal in bridge mode
CN113079036A (en) Method and device for determining management VLAN (virtual local area network) of access point equipment and access point equipment
CN112714202A (en) Equipment configuration 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
GR01 Patent grant
GR01 Patent grant