Router port identification method and device, electronic equipment and storage medium

By sending DHCP messages through the router's wired port and parsing the option43 field, the router automatically identifies the LAN and WAN ports, solving the problem of users accidentally plugging in the wrong ports and improving the ease of use of the router.

CN116582607BActive Publication Date: 2025-11-25HANGZHOU EZVIZ SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310577646.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-11-25
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

Traditional routers have fixed LAN and WAN ports at the factory, which may cause users to plug in the wrong ports, resulting in the inability to access the Internet and increasing the difficulty of use.

Method used

Send a DHCP Discovery message through the router's wired port, parse the option43 field in the DHCP Offer message, and automatically identify the LAN and WAN ports based on its content.

Benefits of technology

It enables automatic identification of router ports, reducing the difficulty of use and improving ease of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116582607B_ABST
    Figure CN116582607B_ABST
Patent Text Reader

Abstract

The application provides a router port identification method and device, electronic equipment and storage medium. The method comprises the following steps: in the case that the router does not have a determined WAN port, sending a DHCP Discovery message through each wired port of the router; in the case that a DHCP Offer message is received through any wired port of the router, analyzing the DHCP Offer message; in the case that an option43 field is carried in the DHCP Offer message, and the content in the option43 field is specified private content, determining that the router is a wireless mesh network MESH sub-node; in the case that the option43 field is not carried in the DHCP Offer message, or the option43 field is carried in the DHCP Offer message, but the content in the option43 field is not the specified private content, determining that the wired port is a WAN port. The method can realize automatic identification of the router port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a router port identification method, device, electronic device, and storage medium. Background Technology

[0002] A router is a hardware device that connects two or more networks. It acts as a gateway between networks and is a dedicated intelligent network device that reads the address in each data packet and then decides how to transmit it.

[0003] Traditional routers are factory-configured with LAN (Local Area Network) and WAN (Wide Area Network) ports. Inexperienced users may accidentally plug the WAN cable into a LAN port while using the router, resulting in the inability to access the internet. Summary of the Invention

[0004] In view of this, this application provides a router port identification method, apparatus, electronic device, and machine-readable storage medium.

[0005] Specifically, this application is implemented through the following technical solution:

[0006] According to a first aspect of the embodiments of this application, a router port identification method is provided, applied to a router, wherein the router is initially not configured with a wide area network (WAN) port, the method comprising:

[0007] If the router does not have a known WAN port, Dynamic Host Configuration Protocol (DHCP) Discovery messages are sent through each wired port of the router.

[0008] If a DHCP Offer message is received through any wired port of the router, the DHCP Offer message is parsed.

[0009] If the DHCP Offer message carries an option43 field, and the content of the option43 field specifies private content, then the router is determined to be a wireless mesh network MESH sub-node; wherein, each wired port of the router acting as a MESH sub-node is a local area network LAN port;

[0010] If the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field is not the specified private content, then the wired port is determined to be a WAN port.

[0011] According to a second aspect of the embodiments of this application, a router port identification device is provided, deployed on a router, wherein the router does not initially have a WAN port configured, the device comprising:

[0012] The communication unit is used to send Dynamic Host Configuration Protocol (DHCP) Discovery messages through each wired port of the router when the router does not have a known WAN port.

[0013] The parsing unit is used to parse the DHCP Offer message when the communication unit receives the DHCP Offer message through any wired port of the router.

[0014] The identification unit is used to determine that the router is a wireless mesh network MESH sub-node when the DHCP Offer message carries the option43 field and the content of the option43 field is specified private content; wherein, each wired port of the router as a MESH sub-node is a local area network LAN port;

[0015] The identification unit is further configured to determine that the wired port is a WAN port if the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field is not the specified private content.

[0016] According to a third aspect of the present application, an electronic device is provided, including a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor being configured to execute the machine-executable instructions to implement the method provided in the first aspect.

[0017] According to a fourth aspect of the embodiments of this application, a storage medium is provided, wherein machine-executable instructions are stored therein, and when the machine-executable instructions are executed by a processor, the method provided in the first aspect is implemented.

[0018] The technical solution provided in this application can bring at least the following beneficial effects:

[0019] For routers that do not have a WAN port initially, if the router does not have a confirmed WAN port, DHCP Discovery messages are sent through each of the router's wired ports. If a DHCP Offer message is received through any of the router's wired ports, the DHCP Offer message is parsed. If the DHCP Offer message carries an option43 field and the content of the option43 field specifies private information, the router is determined to be a MESH child node, meaning that each of the router's wired ports is a LAN port. If the DHCP Offer message does not carry an option43 field, or if the DHCP Offer message carries an option43 field but the content of the option43 field does not specify private information, the wired port is determined to be a WAN port. This achieves automatic identification of router ports, reduces the difficulty of using the router, and improves the convenience of using the router. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating an exemplary embodiment of a router port identification method according to this application;

[0021] Figure 2 This is a flowchart illustrating a default router port identification method according to an exemplary embodiment of this application;

[0022] Figure 3 This is a flowchart illustrating an exemplary embodiment of the present application of a router port identification method when a router has a known WAN port;

[0023] Figure 4 This is a schematic diagram illustrating the structure of a router port identification device according to an exemplary embodiment of this application;

[0024] Figure 5 This is a schematic diagram illustrating the structure of another router port identification device according to an exemplary embodiment of this application;

[0025] Figure 6 This is a schematic diagram of the hardware structure of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation

[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0027] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0028] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0029] Please see Figure 1 This is a flowchart illustrating a router port identification method provided in an embodiment of this application. The router port identification method can be applied to routers, such as... Figure 1 As shown, the router port identification method may include the following steps:

[0030] Step S100: If the router does not have a known WAN port, send DHCP Discovery messages through each wired port of the router.

[0031] In this embodiment of the application, in order to lower the threshold for using the router, the router may not have a WAN port set in its initial state (such as the factory state). That is, the router does not have a fixed WAN port, but a specific wired port on the router can be determined as the WAN port according to the user's actual usage.

[0032] In this embodiment of the application, when the router does not have a known WAN port, for example, when the router is in its initial state (such as factory default state), DHCP (Dynamic Host Configuration Protocol) Discovery messages can be sent through each wired port of the router.

[0033] For example, a router can send DHCP Discovery messages through its wired ports at fixed time intervals (which may be referred to as the first time interval).

[0034] For example, to improve the efficiency of sending DHCP Discovery messages, each wired port of the router can be added to the LAN port's bridge virtual interface. Thus, the router can send a DHCP Discovery message once using the bridge virtual interface, and then send DHCP Discovery messages through each wired port separately.

[0035] Step S110: If a DHCP Offer message is received through any wired port of the router, the DHCP Offer message is parsed.

[0036] In this embodiment of the application, considering that the router may also act as a MESH (wireless mesh network) sub-node when a network cable is plugged into the router's wired port, for example, the router may act as a switch or a bridge. In this case, the wired port of the router with the network cable plugged in will not be used as a WAN port.

[0037] To address the above situation, when replying to a DHCP Offer message, the wired port of a router acting as a MESH child node can carry the option 43 field in the DHCP Offer message and set the content of this field to the specified private content.

[0038] Accordingly, when a DHCP Offer message is received through any wired port of the router, the router can parse the received DHCP Offer message to determine whether the DHCP Offer message carries an option43 field, and if it does, whether the content of the option43 field is specified private content.

[0039] It should be noted that when a router receives DHCP Offer messages through multiple wired ports, the router can use the first DHCP Offer message received as the parsing object and identify the port based on the parsing result.

[0040] Step S120: If the DHCP Offer message carries an option43 field and the content of the option43 field is specified private content, then the router is determined to be a MESH child node; wherein, each wired port of the router as a MESH child node is a LAN port.

[0041] In this embodiment of the application, if the router determines that the DHCP Offer message carries an option43 field and that the content of the option43 field is specified private content, the router can determine that the wired port that received the DHCP Offer message is connected to the MESH master node. In this case, the router can set its own role as a MESH child node.

[0042] For example, a router acting as a MESH child node does not need a WAN port; that is, all wired ports on the router are LAN ports.

[0043] Since a router acting as a MESH child node does not require a WAN port, once the router has determined its role as a MESH child node, it does not need to perform WAN port identification again until its role changes (e.g., the router is restored to its factory state). In other words, it does not need to send DHCP Discovery messages through the wired port again as described in step S100.

[0044] Step S130: If the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field does not specify private content, then determine that the wired port is a WAN port.

[0045] In this embodiment, if the router determines that the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the value of the option43 field does not specify private content, the router can determine that the wired port receiving the DHCP Offer message is the WAN port. In this case, the router can set its own role as a MESH master node.

[0046] It can be seen that, in Figure 1 In the illustrated method, for a router without a WAN port initially configured, if the router does not have a confirmed WAN port, DHCP Discovery messages are sent through each wired port of the router. If a DHCP Offer message is received through any wired port of the router, the DHCP Offer message is parsed. If the DHCP Offer message carries an option43 field and the content of the option43 field specifies private content, the router is determined to be a MESH child node, meaning that each wired port of the router is a LAN port. If the DHCP Offer message does not carry an option43 field, or if the DHCP Offer message carries an option43 field but the content of the option43 field does not specify private content, the wired port is determined to be a WAN port. This achieves automatic identification of router ports, reduces the difficulty of using the router, and improves the ease of use of the router.

[0047] In some embodiments, the router port identification method provided in this application may further include:

[0048] If the router has a known WAN port, send DHCP Discovery messages through the other wired ports of the router, excluding the WAN port.

[0049] If a DHCP Offer message is received through any wired port of the router, determine whether a network cable is plugged into the WAN port that the router has identified.

[0050] If no network cable is plugged into the router's designated WAN port, update the router's designated WAN port to a LAN port, and designate the wired port that received the DHCP Offer message as the new WAN port.

[0051] For example, considering the case where the router has already determined the WAN port, for instance, according to... Figure 1 The method shown identifies the WAN port. However, there may be situations where the WAN port cable is accidentally plugged into another wired port after being unplugged, or where the identified WAN port malfunctions, necessitating a WAN port switch.

[0052] Accordingly, if the router has already identified the WAN port, the router can also send DHCP Discovery messages through the other wired ports of the router besides the WAN port.

[0053] For example, the router can send DHCP Discovery messages through the remaining wired ports of the router, excluding the WAN port, at preset time intervals (which may be referred to as the second time interval).

[0054] The first time interval and the second time interval can be the same or different.

[0055] For example, once the router's role (MESH master node or MESH child node) is determined, the router's role will not change unless it is reset (e.g., restored to factory settings). However, if the router is reset, its WAN port will also be reset, meaning the router will revert to a state where the previously determined WAN port does not exist. Therefore, when the router has a determined WAN port, its role is that of a MESH master node.

[0056] Accordingly, when a DHCP Offer message is received through any wired port of the router (any wired port other than the WAN port mentioned above), it is not necessary to parse the content of the DHCP Offer message (i.e., it is not necessary to determine whether it carries the option43 field, and whether the content of the option43 field is specified private content). In this case, the router can determine whether the WAN port is plugged in with a network cable.

[0057] If no network cable is plugged into the designated WAN port, the router can perform WAN port switching, that is, update the router's designated WAN port to a LAN port, and designate the wired port that received the DHCP Offer message as the new WAN port.

[0058] In one example, the router port identification method provided in this application embodiment may further include:

[0059] If a network cable is plugged into the WAN port of the router, check whether the WAN port can connect to the external network.

[0060] If it is determined that the WAN port cannot connect to the external network, update the router's already identified WAN port to a LAN port, and designate the wired port that received the DHCP Offer message as the new WAN port.

[0061] For example, considering that even if a network cable is plugged into the WAN port of the router, it may still fail to connect to the external network due to reasons such as plugging in the wrong network cable (i.e., the network cable plugged in is not the one that connects to the external network) or port failure, the router can detect whether the WAN port can connect to the external network when it receives a DHCP Offer message through any wired port and the router has confirmed that a network cable is plugged into the WAN port.

[0062] For example, a router can use the ping (Packet Internet Groper, Packet InternetGroper) command to determine whether its WAN port can connect to the external network.

[0063] In one example, to improve the accuracy of whether the WAN port can connect to the external network, the router can detect whether the WAN port can connect to the external network at fixed time intervals (which can be called the third time interval). If the number of times the WAN port cannot connect to the external network reaches a preset number, or if the duration of the detection that the WAN port cannot connect to the external network reaches a preset duration, then the router determines that the WAN port cannot connect to the external network.

[0064] If it is determined that the router's designated WAN port cannot connect to the external network, the router's WAN port can be switched. This involves updating the router's designated WAN port to a LAN port and designating the wired port that received the DHCP Offer message as the new WAN port.

[0065] In one example, if the router determines that the identified WAN port can connect to the external network, it can refuse to switch WAN ports.

[0066] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below in conjunction with specific embodiments.

[0067] In this embodiment, in order to achieve router port identification (also known as router blind plugging), the router does not have a WAN port in its initial state.

[0068] like Figure 2 As shown, during the port identification process, if there is no known WAN port, all wired ports can be added to the LAN port bridge. The router can send DHCP Discovery messages on the LAN port bridge at fixed time intervals, such as the first time interval mentioned above.

[0069] If a DHCP Offer message is received through any wired port, the DHCP Offer message can be parsed to determine whether the DHCP Offer message contains an option43 field, and if the DHCP Offer message contains an option43 field, to further determine whether the content of the option43 field is specified private content.

[0070] If the DHCP Offer message contains an option43 field, and the content of option43 field specifies private information, the router can determine that the wired port receiving the DHCP Offer message is connected to the MESH master node, and the router is a MESH child node. Since MESH child nodes do not need WAN ports, the router can determine that all wired ports are LAN ports.

[0071] In this case, if the router determines that it is a MESH child node, it does not need to perform the above port identification process (or blind insertion process) again.

[0072] If the DHCP Offer message does not contain the option43 field, or if the option43 field exists but its content does not specify private information, the router can identify the wired port that received the DHCP Offer message as the WAN port and determine its own role as the MESH master node.

[0073] like Figure 3 As shown, when the router has a known WAN port, the router port identification process can be as follows:

[0074] The router can send DHCP Discovery messages at fixed time intervals, such as the second time interval mentioned above, through the LAN port bridge (i.e., the wired ports other than the WAN port).

[0075] If a DHCP Offer message is received through any wired port of the router, it can be determined whether a network cable is plugged into the router's designated WAN port.

[0076] If no network cable is plugged into the designated WAN port, the router can switch the WAN port to a LAN port and set the wired port that received the DCHP Offer message as the new WAN port.

[0077] With a network cable plugged into the WAN port, the router can check whether the WAN port can connect to the external network at fixed time intervals, such as the third time interval mentioned above.

[0078] If the number of times the WAN port fails to connect to the external network reaches a preset number, or if the duration of the WAN port's inability to connect to the external network reaches a preset duration, it is determined that the WAN port cannot connect to the external network. In this case, the router can perform WAN port switching, updating the determined WAN port to a LAN port, and setting the wired port that received the DCHP Offer message as the new WAN port.

[0079] Otherwise, if the router is certain that the WAN port can connect to the external network, it can refuse to switch the WAN port.

[0080] The method provided in this application has been described above. The apparatus provided in this application is described below:

[0081] Please see Figure 4 This is a schematic diagram of a router port identification device provided in an embodiment of this application. The router port identification device can be deployed on a router, which initially does not have a WAN port. Figure 4 As shown, the router port identification device may include:

[0082] The communication unit 410 is used to send Dynamic Host Configuration Protocol (DHCP) Discovery messages through each wired port of the router when the router does not have a known WAN port.

[0083] The parsing unit 420 is used to parse the DHCP Offer message when the communication unit receives the DHCP Offer message through any wired port of the router;

[0084] The identification unit 430 is used to determine that the router is a wireless mesh network MESH sub-node when the DHCP Offer message carries an option43 field and the content of the option43 field is specified private content; wherein, each wired port of the router as a MESH sub-node is a local area network LAN port;

[0085] The identification unit 430 is further configured to determine that the wired port is a WAN port if the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field is not the specified private content.

[0086] In some embodiments, the communication unit 410 is further configured to send DHCPDiscovery messages through the remaining wired ports of the router other than the WAN port, when the router has a known WAN port.

[0087] The identification unit 430 is further configured to, when a DHCP Offer message is received through any wired port of the router, determine whether a network cable is plugged into the WAN port already identified by the router; and when a network cable is not plugged into the WAN port already identified by the router, update the WAN port already identified by the router to a LAN port, and identify the wired port that received the DHCP Offer message as the new WAN port.

[0088] In some embodiments, such as Figure 5 As shown, the device further includes:

[0089] The detection unit 440 is used to detect whether the WAN port of the router can connect to the external network when the WAN port of the router is known to be connected to a network cable.

[0090] The identification unit 430 is further configured to, when it is determined that the WAN port cannot connect to the external network, update the WAN port already identified by the router to a LAN port, and identify the wired port that received the DHCP Offer message as the new WAN port.

[0091] In some embodiments, the detection unit 440 detects whether the WAN port can connect to the external network, including:

[0092] The WAN port is checked at fixed time intervals to see if it can connect to the external network.

[0093] The detection unit 440 determines that the WAN port cannot connect to the external network, including:

[0094] If the number of times the WAN port is continuously unable to connect to the external network reaches a preset number, or if the duration of the WAN port being unable to connect to the external network reaches a preset duration, then the WAN port is determined to be unable to connect to the external network.

[0095] In some embodiments, the identification unit 430 is further configured to refuse to switch WAN ports if a network cable is plugged into a WAN port that the router has identified, and the WAN port is determined to be able to connect to the external network.

[0096] This application provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the router port identification method described above.

[0097] Please see Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 601 and a memory 602 storing machine-executable instructions. The processor 601 and the memory 602 can communicate via a system bus 603. Furthermore, by reading and executing the machine-executable instructions in the memory 602 corresponding to the router port identification logic, the processor 601 can execute the router port identification method described above.

[0098] The memory 602 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0099] In some embodiments, a storage medium, such as Figure 6 The memory 602 in the memory can be a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are executed by a processor, they implement the router port identification method described above. For example, the storage medium can be ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0100] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0101] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A router port identification method, applied to a router, characterized in that, The router is not configured with a WAN port in its initial state, and the method includes: If the router does not have a known WAN port, add each wired port of the router to the bridge virtual interface of the LAN port, and use the bridge virtual interface to send a Dynamic Host Configuration Protocol (DHCP) Discovery message once, so that DHCP Discovery messages can be sent through each wired port respectively. If a DHCP Offer message is received through any wired port of the router, the DHCP Offer message is parsed. If the DHCP Offer message carries an option43 field, and the content of the option43 field specifies private content, then the router is determined to be a wireless mesh network MESH sub-node; wherein, each wired port of the router acting as a MESH sub-node is a local area network LAN port; If the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field is not the specified private content, then the wired port is determined to be a WAN port.

2. The method according to claim 1, characterized in that, The method further includes: If the router has a known WAN port, send a DHCP Discovery message through the other wired ports of the router besides the WAN port. If a DHCP Offer message is received through any wired port of the router, determine whether the WAN port of the router has a network cable plugged in. If no network cable is plugged into the WAN port of the router, update the WAN port of the router to a LAN port, and designate the wired port that received the DHCP Offer message as the new WAN port.

3. The method according to claim 2, characterized in that, The method further includes: If a network cable is plugged into the WAN port of the router, check whether the WAN port can connect to the external network. If it is determined that the WAN port cannot connect to the external network, the router's previously identified WAN port will be updated to a LAN port, and the wired port that received the DHCP Offer message will be designated as the new WAN port.

4. The method according to claim 3, characterized in that, The detection of whether the WAN port can connect to the external network includes: The WAN port is checked at fixed time intervals to see if it can connect to the external network. The determination that the WAN port cannot connect to the external network includes: If the number of times the WAN port is continuously unable to connect to the external network reaches a preset number, or if the duration of the WAN port being unable to connect to the external network reaches a preset duration, then the WAN port is determined to be unable to connect to the external network.

5. The method according to claim 3 or 4, characterized in that, The method further includes: If a network cable is plugged into a WAN port on the router and it is confirmed that the WAN port can connect to the external network, then WAN port switching will be refused.

6. A router port identification device, deployed on a router, characterized in that, The router is not configured with a WAN port in its initial state. The device includes: The communication unit is used to add each wired port of the router to the bridge virtual interface of the LAN port when the router does not have a known WAN port, and use the bridge virtual interface to send a Dynamic Host Configuration Protocol (DHCP) Discovery message once, so as to send DHCP Discovery messages through each wired port respectively. The parsing unit is used to parse the DHCP Offer message when the communication unit receives the DHCP Offer message through any wired port of the router. The identification unit is used to determine that the router is a wireless mesh network MESH sub-node when the DHCP Offer message carries the option43 field and the content of the option43 field is specified private content; wherein, each wired port of the router as a MESH sub-node is a local area network LAN port; The identification unit is further configured to determine that the wired port is a WAN port if the DHCP Offer message does not carry the option43 field, or if the DHCP Offer message carries the option43 field but the content of the option43 field is not the specified private content.

7. The apparatus according to claim 6, characterized in that, The communication unit is also used to send DHCP Discovery messages through the remaining wired ports of the router other than the WAN port when the router has a known WAN port. The identification unit is further configured to, when a DHCP Offer message is received through any wired port of the router, determine whether a network cable is plugged into the WAN port already identified by the router; and, when a network cable is not plugged into the WAN port already identified by the router, update the WAN port already identified by the router to a LAN port, and identify the wired port that received the DHCP Offer message as the new WAN port.

8. The apparatus according to claim 7, characterized in that, The device further includes: The detection unit is used to detect whether the WAN port of the router can connect to the external network when a network cable is plugged into the WAN port of the router. The identification unit is also used to update the WAN port that the router has identified to a LAN port when it is determined that the WAN port cannot connect to the external network, and to identify the wired port that received the DHCP Offer message as the new WAN port. The detection unit detects whether the WAN port can connect to the external network, including: The WAN port is checked at fixed time intervals to see if it can connect to the external network. The detection unit determines that the WAN port cannot connect to the external network, including: If the number of times the WAN port is continuously detected as unable to connect to the external network reaches a preset number, or if the duration of the WAN port being unable to connect to the external network reaches a preset duration, then the WAN port is determined to be unable to connect to the external network. The identification unit is also used to refuse to switch WAN ports if it is determined that the WAN port can connect to the external network.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method as described in any one of claims 1-5.

10. A storage medium, characterized in that, The storage medium stores machine-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Startup mode setting method, electronic device and computer readable storage medium

    CN113127090A