OpenWRT router, ONU and gateway network self-checking method and system
Start the self-test module through the ubus command, automatically detect the key network items of the OpenWRT smart terminal and generate a self-test report, solving the problems of incomplete detection and low efficiency in the existing technology, achieving comprehensive and real-time network self-test, and Report security is ensured through encrypted transmission.
Patent Information
- Application Number
- CN202410765868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-27
AI Technical Summary
Existing technology cannot comprehensively and real-time detect network problems of OpenWRT smart terminals, such as network card wiring, negotiation rate, network address conflicts, etc., resulting in network performance degradation, especially in large network environments, manual detection is inefficient and error-prone.
Start the self-test module through the ubus command, automatically detect network card wiring, negotiated speed, WAN port configuration, DHCP dynamic address, network address conflicts and other network items, generate a self-test report and encrypt it and transmit it to the server to achieve automated and comprehensive network self-test.
It improves the comprehensiveness and real-time nature of the OpenWRT intelligent terminal network self-test, reduces the dependence on manual inspection, improves the timely discovery and resolution of network problems, and ensures the safe transmission of self-test reports through multiple encryption algorithms and SSL protocols.
Smart Images

Figure CN118714036A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gateway management, and in particular to an OpenWRT router, ONU, gateway network self-checking method and system. Background Art
[0002] With the rapid development of the Internet, the network has become an important part of people's daily life and work. In enterprise and home networks, the gateway plays an important role in connecting the internal network with the external network. The stability and performance of the gateway directly affect the operating efficiency and user experience of the entire network.
[0003] OpenWRT is an open source operating system based on Linux. It is flexible and customizable and is often used as an operating system for smart terminals (routers, ONUs, gateways). In actual applications, smart terminals running OpenWRT may encounter various problems, such as network card wiring problems, negotiation rate mismatch, network address conflicts, network loops, etc. If these problems are not discovered and resolved in a timely manner, network performance will be degraded and even affect the normal use of users. Therefore, it is necessary to detect the network of smart terminals.
[0004] Traditionally, network detection for OpenWRT smart terminals mainly relies on simple network testing tools for manual detection, which has the following disadvantages: 1. Most of them can only detect certain specific network parameters and cannot fully cover all aspects of the gateway. For example, some network testing tools can only detect network connectivity, but cannot detect network card wiring conditions or network address conflicts, making the detection incomplete; 2. Manual operation is inefficient and has poor real-time performance, and it is impossible to discover and solve network problems in a timely manner. Especially in large-scale network environments, the workload of manual detection is huge and prone to errors.
[0005] Therefore, how to provide an OpenWRT router, ONU, gateway network self-check method and system to improve the comprehensiveness and real-time performance of OpenWRT intelligent terminal network self-check has become a technical problem to be solved urgently. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an OpenWRT router, ONU, gateway network self-check method and system to improve the comprehensiveness and real-time performance of the OpenWRT intelligent terminal network self-check.
[0007] In a first aspect, the present invention provides an OpenWRT router, ONU, and gateway network self-check method, comprising the following steps:
[0008] Step S1, the OpenWRT intelligent terminal starts the self-test module through the ubus command based on the received network self-test instruction;
[0009] Step S2, after the self-check module is started, the network items of the OpenWRT intelligent terminal including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic are automatically self-checked;
[0010] Step S3, the OpenWRT intelligent terminal periodically calls the self-test module through the ubus command to obtain the self-test results of each network project, and generates a self-test report based on each of the self-test results;
[0011] Step S4, the OpenWRT intelligent terminal encrypts the self-test report into an encrypted report, and sends the encrypted report to the server through the SSL protocol;
[0012] Step S5: The server decrypts the received encrypted report to obtain a self-test report, and displays the self-test report.
[0013] Furthermore, the step S1 is specifically as follows:
[0014] The OpenWRT intelligent terminal receives a network self-check instruction, verifies the signature carried by the network self-check instruction, and then starts a self-check module through a ubus command; the OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
[0015] Furthermore, in step S2, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information;
[0016] The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card;
[0017] The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file;
[0018] The DHCP dynamic address is detected using the ifconfig command or the ip addr command;
[0019] The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet;
[0020] The loop is detected using the traceroute command or the mtr command;
[0021] The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal;
[0022] The IP address conflict is detected using the arp command;
[0023] The routing configuration is checked using the route command or by editing the routing configuration file;
[0024] The next hop connectivity is detected using the ping command;
[0025] The DNS configuration is detected using the cat command, etc command or resolv.conf command;
[0026] The number of IP sessions is detected using the netstat command;
[0027] The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold;
[0028] The network traffic is detected using a traffic monitoring tool.
[0029] Furthermore, in step S3, the self-test report carries at least the self-test result, the self-test time, the OpenWRT intelligent terminal serial number, the OpenWRT intelligent terminal installation location, the OpenWRT intelligent terminal software version number, and the OpenWRT intelligent terminal operation time.
[0030] Furthermore, the step S4 is specifically as follows:
[0031] The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol;
[0032] The step S5 is specifically as follows:
[0033] The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
[0034] In a second aspect, the present invention provides an OpenWRT router, ONU, and gateway network self-checking system, including the following modules:
[0035] Self-check startup module, used for OpenWRT intelligent terminal to start the self-check module through ubus command based on the received network self-check instruction;
[0036] A network self-check module is used to automatically perform a network self-check on the network items of the OpenWRT intelligent terminal, including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic after the self-check module is started;
[0037] A self-test report generation module, which is used for the OpenWRT intelligent terminal to periodically call the self-test module through the ubus command to obtain the self-test results of each network project, and generate a self-test report based on each of the self-test results;
[0038] A self-test report encryption upload module, used for the OpenWRT intelligent terminal to encrypt the self-test report into an encrypted report, and send the encrypted report to the server through the SSL protocol;
[0039] The encrypted report decryption module is used for the server to decrypt the received encrypted report to obtain a self-test report, and display the self-test report.
[0040] Furthermore, the self-check startup module is specifically used for:
[0041] The OpenWRT intelligent terminal receives a network self-check instruction, verifies the signature carried by the network self-check instruction, and then starts a self-check module through a ubus command; the OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
[0042] Furthermore, in the network self-check module, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information;
[0043] The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card;
[0044] The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file;
[0045] The DHCP dynamic address is detected using the ifconfig command or the ip addr command;
[0046] The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet;
[0047] The loop is detected using the traceroute command or the mtr command;
[0048] The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal;
[0049] The IP address conflict is detected using the arp command;
[0050] The routing configuration is checked using the route command or by editing the routing configuration file;
[0051] The next hop connectivity is detected using the ping command;
[0052] The DNS configuration is detected using the cat command, etc command or resolv.conf command;
[0053] The number of IP sessions is detected using the netstat command;
[0054] The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold;
[0055] The network traffic is detected using a traffic monitoring tool.
[0056] Furthermore, in the self-test report generating module, the self-test report carries at least the self-test result, the self-test time, the OpenWRT intelligent terminal serial number, the OpenWRT intelligent terminal installation location, the OpenWRT intelligent terminal software version number, and the OpenWRT intelligent terminal running time.
[0057] Furthermore, the self-test report encryption upload module is specifically used for:
[0058] The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol;
[0059] The encrypted report decryption module specifically includes:
[0060] The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
[0061] The advantages of the present invention are:
[0062] 1. Based on the received network self-check instruction, the OpenWRT intelligent terminal starts the self-check module through the ubus command. After the self-check module is started, it automatically performs network self-check on the network items of the OpenWRT intelligent terminal, including at least network card wiring, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, number of IP sessions, number of DHCP capacity, and network traffic. The self-check module is called periodically through the ubus command to obtain the self-check results of each network item, and a self-check report is generated based on each check result. The self-check report is added to the The encrypted report is sent to the server through the SSL protocol. The server decrypts the encrypted report to obtain the self-test report and displays it; that is, the self-test module is started through the ubus command to automatically perform network self-test on network items including at least network card wiring, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, number of IP sessions, DHCP capacity, and network traffic, and automatically generates a self-test report and uploads it to the server without relying on manual detection, thereby greatly improving the comprehensiveness and real-time performance of the OpenWRT intelligent terminal network self-test.
[0063] 2. By setting the self-test report to carry at least the self-test results, self-test time, OpenWRT smart terminal serial number, OpenWRT smart terminal installation location, OpenWRT smart terminal software version number, and OpenWRT smart terminal running time, it is convenient to quickly locate the problem when the gateway network has problems, and to operate and maintain the gateway with problems.
[0064] 3. Encrypt the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generate a string of a specified length, add the string to the specified position of the first-level encrypted data to obtain second-level encrypted data, encrypt the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divide the third-level encrypted data based on a preset division ratio and swap the order to obtain fourth-level encrypted data, map the fourth-level encrypted data by a preset mapping rule to obtain fifth-level encrypted data, encrypt the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and send the encrypted report to the server in real time through the SSL protocol; that is, the self-test report has been encrypted at level six, and if the corresponding encryption algorithm or transformation rule is not known, the encrypted report cannot be cracked, and the SSL protocol is a network security protocol, and at least nine security measures are taken before and after (RC2 algorithm, specified length, specified position, 3DES algorithm, division ratio, swap order, mapping rule, ECDSA algorithm, SSL protocol) to prevent the self-test report from being stolen and tampered with in plain text during transmission, which greatly improves the security of the self-test report transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0066] Figure 1 The invention discloses a flow chart of a network self-checking method for an OpenWRT router, an ONU and a gateway.
[0067] Figure 2 The invention discloses a structural diagram of an OpenWRT router, ONU and gateway network self-checking system. DETAILED DESCRIPTION
[0068] The technical solution in the embodiment of the present application has the following general idea: starting the self-test module through the ubus command to automatically perform network self-test on network items including at least network card wiring, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, number of IP sessions, number of DHCP capacity, and network traffic, and automatically generate a self-test report to upload to the server without relying on manual detection, so as to improve the comprehensiveness and real-time performance of the OpenWRT intelligent terminal network self-test.
[0069] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of an OpenWRT router, ONU, and gateway network self-checking method of the present invention comprises the following steps:
[0070] Step S1, the OpenWRT intelligent terminal starts the self-test module through the ubus command based on the received network self-test instruction;
[0071] Step S2, after the self-check module is started, the network items of the OpenWRT intelligent terminal including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic are automatically self-checked;
[0072] Step S3, the OpenWRT intelligent terminal periodically calls the self-test module through the ubus command to obtain the self-test results of each network project, and generates a self-test report based on each of the self-test results;
[0073] The code example for obtaining the self-test result is:
[0074] ubus call diagmng diag'{"user":"web","action":"status"}'
[0075] Among them, diag indicates the name of the self-test module registered in UBUS; status indicates the method provided by the self-test module in UBUS; user indicates the user who calls the self-test module; action indicates the self-test status;
[0076] The code example for returning the self-test result is:
[0077]
[0078]
[0079] Step S4, the OpenWRT intelligent terminal encrypts the self-test report into an encrypted report, and sends the encrypted report to the server through the SSL protocol;
[0080] Step S5: The server decrypts the received encrypted report to obtain a self-test report, and displays the self-test report.
[0081] The step S1 is specifically as follows:
[0082] The OpenWRT intelligent terminal receives a network self-check instruction, verifies the signature carried by the network self-check instruction, and then starts a self-check module through a ubus command; the OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
[0083] Ubus is the micro-system bus architecture of OpenWrt. It is a general framework for inter-process communication (IPC). It provides a simple RPC (remote procedure call) mechanism that allows communication between different background processes and applications. Successful execution returns a JSON object containing a response. The command example for starting the self-test module is:
[0084] ubus call diagmng diag'{"user":"web","action":"start"}'
[0085] Among them, diag indicates the name of the self-test module registered in UBUS; status indicates the method provided by the self-test module in UBUS; user indicates the user who calls the self-test module; the value of action is start or stop, start indicates starting self-test, and stop indicates stopping self-test.
[0086] In step S2, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information;
[0087] The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card;
[0088] The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file;
[0089] The DHCP dynamic address is detected using the ifconfig command or the ip addr command;
[0090] The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet;
[0091] The loop is detected using the traceroute command or the mtr command;
[0092] The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal;
[0093] The IP address conflict is detected using the arp command;
[0094] The routing configuration is checked using the route command or by editing the routing configuration file;
[0095] The next hop connectivity is detected using the ping command;
[0096] The DNS configuration is detected using the cat command, etc command or resolv.conf command;
[0097] The number of IP sessions is detected using the netstat command;
[0098] The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold;
[0099] The network traffic is detected using a traffic monitoring tool.
[0100] In step S3, the self-test report at least carries the self-test result, self-test time, OpenWRT intelligent terminal serial number, OpenWRT intelligent terminal installation location, OpenWRT intelligent terminal software version number, and OpenWRT intelligent terminal operation time.
[0101] By setting the self-check report to carry at least the self-check result, self-check time, OpenWRT smart terminal serial number, OpenWRT smart terminal installation location, OpenWRT smart terminal software version number, and OpenWRT smart terminal running time, it is convenient to quickly locate the problem when a problem occurs in the gateway network and to operate and maintain the gateway with the problem.
[0102] The step S4 is specifically as follows:
[0103] The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol;
[0104] The self-test report is encrypted by the RC2 algorithm to obtain the first-level encrypted data, a character string of a specified length is randomly generated, and the character string is added to the specified position of the first-level encrypted data to obtain the second-level encrypted data, the second-level encrypted data is encrypted by the 3DES algorithm to obtain the third-level encrypted data, the third-level encrypted data is divided based on a preset division ratio and the front and back order is exchanged to obtain the fourth-level encrypted data, the fourth-level encrypted data is mapped by a preset mapping rule to obtain the fifth-level encrypted data, the fifth-level encrypted data is encrypted by the ECDSA algorithm to obtain the encrypted report, and the encrypted report is sent to the server in real time through the SSL protocol; that is, the self-test report has been encrypted at level six, and if the corresponding encryption algorithm or transformation rule is not known, the encrypted report cannot be cracked, and the SSL protocol is a network security protocol, and at least nine security measures are taken before and after (RC2 algorithm, specified length, specified position, 3DES algorithm, division ratio, exchange front and back order, mapping rule, ECDSA algorithm, SSL protocol) to prevent the self-test report from being stolen and tampered with in plain text during transmission, which greatly improves the security of the self-test report transmission.
[0105] The step S5 is specifically as follows:
[0106] The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
[0107] A preferred embodiment of an OpenWRT router, ONU, and gateway network self-checking system of the present invention includes the following modules:
[0108] Self-check startup module, used for OpenWRT intelligent terminal to start the self-check module through ubus command based on the received network self-check instruction;
[0109] A network self-check module is used to automatically perform a network self-check on the network items of the OpenWRT intelligent terminal, including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic after the self-check module is started;
[0110] A self-test report generation module, which is used for the OpenWRT intelligent terminal to periodically call the self-test module through the ubus command to obtain the self-test results of each network project, and generate a self-test report based on each of the self-test results;
[0111] The code example for obtaining the self-test result is:
[0112] ubus call diagmng diag'{"user":"web","action":"status"}'
[0113] Among them, diag indicates the name of the self-test module registered in UBUS; status indicates the method provided by the self-test module in UBUS; user indicates the user who calls the self-test module; action indicates the self-test status;
[0114] The code example for returning the self-test result is:
[0115]
[0116]
[0117] A self-test report encryption upload module, used for the OpenWRT intelligent terminal to encrypt the self-test report into an encrypted report, and send the encrypted report to the server through the SSL protocol;
[0118] The encrypted report decryption module is used for the server to decrypt the received encrypted report to obtain a self-test report, and display the self-test report.
[0119] The self-check startup module is specifically used for:
[0120] The OpenWRT intelligent terminal receives a network self-check instruction, verifies the signature carried by the network self-check instruction, and then starts a self-check module through a ubus command; the OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
[0121] Ubus is the micro-system bus architecture of OpenWrt. It is a general framework for inter-process communication (IPC). It provides a simple RPC (remote procedure call) mechanism that allows communication between different background processes and applications. Successful execution returns a JSON object containing a response. The command example for starting the self-test module is:
[0122] ubus call diagmng diag'{"user":"web","action":"start"}'
[0123] Among them, diag indicates the name of the self-test module registered in UBUS; status indicates the method provided by the self-test module in UBUS; user indicates the user who calls the self-test module; the value of action is start or stop, start indicates starting self-test, and stop indicates stopping self-test.
[0124] In the network self-check module, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information;
[0125] The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card;
[0126] The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file;
[0127] The DHCP dynamic address is detected using the ifconfig command or the ip addr command;
[0128] The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet;
[0129] The loop is detected using the traceroute command or the mtr command;
[0130] The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal;
[0131] The IP address conflict is detected using the arp command;
[0132] The routing configuration is checked using the route command or by editing the routing configuration file;
[0133] The next hop connectivity is detected using the ping command;
[0134] The DNS configuration is detected using the cat command, etc command or resolv.conf command;
[0135] The number of IP sessions is detected using the netstat command;
[0136] The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold;
[0137] The network traffic is detected using a traffic monitoring tool.
[0138] In the self-test report generating module, the self-test report carries at least a self-test result, a self-test time, a serial number of the OpenWRT intelligent terminal, an installation location of the OpenWRT intelligent terminal, a software version number of the OpenWRT intelligent terminal, and a running time of the OpenWRT intelligent terminal.
[0139] By setting the self-check report to carry at least the self-check result, self-check time, OpenWRT smart terminal serial number, OpenWRT smart terminal installation location, OpenWRT smart terminal software version number, and OpenWRT smart terminal running time, it is convenient to quickly locate the problem when a problem occurs in the gateway network and to operate and maintain the gateway with the problem.
[0140] The self-test report encryption upload module is specifically used for:
[0141] The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol;
[0142] The self-test report is encrypted by the RC2 algorithm to obtain the first-level encrypted data, a character string of a specified length is randomly generated, and the character string is added to the specified position of the first-level encrypted data to obtain the second-level encrypted data, the second-level encrypted data is encrypted by the 3DES algorithm to obtain the third-level encrypted data, the third-level encrypted data is divided based on a preset division ratio and the front and back order is exchanged to obtain the fourth-level encrypted data, the fourth-level encrypted data is mapped by a preset mapping rule to obtain the fifth-level encrypted data, the fifth-level encrypted data is encrypted by the ECDSA algorithm to obtain the encrypted report, and the encrypted report is sent to the server in real time through the SSL protocol; that is, the self-test report has been encrypted at level six, and if the corresponding encryption algorithm or transformation rule is not known, the encrypted report cannot be cracked, and the SSL protocol is a network security protocol, and at least nine security measures are taken before and after (RC2 algorithm, specified length, specified position, 3DES algorithm, division ratio, exchange front and back order, mapping rule, ECDSA algorithm, SSL protocol) to prevent the self-test report from being stolen and tampered with in plain text during transmission, which greatly improves the security of the self-test report transmission.
[0143] The encrypted report decryption module specifically includes:
[0144] The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
[0145] In summary, the advantages of the present invention are:
[0146] 1. Based on the received network self-check instruction, the OpenWRT intelligent terminal starts the self-check module through the ubus command. After the self-check module is started, it automatically performs network self-check on the network items of the OpenWRT intelligent terminal, including at least network card wiring, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, number of IP sessions, number of DHCP capacity, and network traffic. The self-check module is called periodically through the ubus command to obtain the self-check results of each network item, and a self-check report is generated based on each check result. The self-check report is added to the The encrypted report is sent to the server through the SSL protocol. The server decrypts the encrypted report to obtain the self-test report and displays it; that is, the self-test module is started through the ubus command to automatically perform network self-test on network items including at least network card wiring, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, number of IP sessions, DHCP capacity, and network traffic, and automatically generates a self-test report and uploads it to the server without relying on manual detection, thereby greatly improving the comprehensiveness and real-time performance of the OpenWRT intelligent terminal network self-test.
[0147] 2. By setting the self-test report to carry at least the self-test results, self-test time, OpenWRT smart terminal serial number, OpenWRT smart terminal installation location, OpenWRT smart terminal software version number, and OpenWRT smart terminal running time, it is convenient to quickly locate the problem when the gateway network has problems, and to operate and maintain the gateway with problems.
[0148] 3. Encrypt the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generate a string of a specified length, add the string to the specified position of the first-level encrypted data to obtain second-level encrypted data, encrypt the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divide the third-level encrypted data based on a preset division ratio and swap the order to obtain fourth-level encrypted data, map the fourth-level encrypted data by a preset mapping rule to obtain fifth-level encrypted data, encrypt the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and send the encrypted report to the server in real time through the SSL protocol; that is, the self-test report has been encrypted at level six, and if the corresponding encryption algorithm or transformation rule is not known, the encrypted report cannot be cracked, and the SSL protocol is a network security protocol, and at least nine security measures are taken before and after (RC2 algorithm, specified length, specified position, 3DES algorithm, division ratio, swap order, mapping rule, ECDSA algorithm, SSL protocol) to prevent the self-test report from being stolen and tampered with in plain text during transmission, which greatly improves the security of the self-test report transmission.
[0149] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A network self-check method for OpenWRT routers, ONUs, and gateways, characterized in that: The steps include: Step S1, the OpenWRT intelligent terminal starts the self-test module through the ubus command based on the received network self-test instruction; Step S2, after the self-check module is started, the network items of the OpenWRT intelligent terminal including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic are automatically self-checked; Step S3, the OpenWRT intelligent terminal periodically calls the self-test module through the ubus command to obtain the self-test results of each network project, and generates a self-test report based on each of the self-test results; Step S4, the OpenWRT intelligent terminal encrypts the self-test report into an encrypted report, and sends the encrypted report to the server through the SSL protocol; Step S5: The server decrypts the received encrypted report to obtain a self-test report, and displays the self-test report.
2. A network self-check method for OpenWRT router, ONU, and gateway as claimed in claim 1, characterized in that: The step S1 is specifically as follows: The OpenWRT intelligent terminal receives the network self-check instruction, verifies the signature carried by the network self-check instruction, and starts the self-check module through the ubus command; The OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
3. A network self-check method for OpenWRT router, ONU, and gateway as claimed in claim 1, characterized in that: In step S2, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information; The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card; The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file; The DHCP dynamic address is detected using the ifconfig command or the ip addr command; The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet; The loop is detected using the traceroute command or the mtr command; The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal; The IP address conflict is detected using the arp command; The routing configuration is checked using the route command or by editing the routing configuration file; The next hop connectivity is detected using the ping command; The DNS configuration is detected using the cat command, etc command or resolv.conf command; The number of IP sessions is detected using the netstat command; The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold; The network traffic is detected using a traffic monitoring tool.
4. A network self-check method for OpenWRT router, ONU, and gateway as claimed in claim 1, characterized in that: In step S3, the self-test report at least carries the self-test result, self-test time, OpenWRT intelligent terminal serial number, OpenWRT intelligent terminal installation location, OpenWRT intelligent terminal software version number, and OpenWRT intelligent terminal operation time.
5. The method for self-checking an OpenWRT router, ONU or gateway network as claimed in claim 1, characterized in that: The step S4 is specifically as follows: The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol; The step S5 is specifically as follows: The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
6. An OpenWRT router, ONU, and gateway network self-checking system, characterized in that: Includes the following modules: Self-check startup module, used for OpenWRT intelligent terminal to start the self-check module through ubus command based on the received network self-check instruction; A network self-check module is used to automatically perform a network self-check on the network items of the OpenWRT intelligent terminal, including at least network card connection, negotiation rate, WAN port configuration, DHCP dynamic address, WAN and LAN network address conflict, loop, multiple DHCP server conflict, IP address conflict, routing configuration, next hop connectivity, DNS configuration, IP session number, DHCP capacity number, and network traffic after the self-check module is started; A self-test report generation module, which is used for the OpenWRT intelligent terminal to periodically call the self-test module through the ubus command to obtain the self-test results of each network project, and generate a self-test report based on each of the self-test results; A self-test report encryption upload module, used for the OpenWRT intelligent terminal to encrypt the self-test report into an encrypted report, and send the encrypted report to the server through the SSL protocol; The encrypted report decryption module is used for the server to decrypt the received encrypted report to obtain a self-test report, and display the self-test report.
7. An OpenWRT router, ONU, gateway network self-checking system as claimed in claim 6, characterized in that: The self-check startup module is specifically used for: The OpenWRT intelligent terminal receives a network self-check instruction, verifies the signature carried by the network self-check instruction, and then starts a self-check module through a ubus command; the OpenWRT intelligent terminal is an OpenWRT router, an OpenWRT ONU or an OpenWRT gateway.
8. An OpenWRT router, ONU, gateway network self-checking system as claimed in claim 6, characterized in that: In the network self-check module, the network card connection is detected using the ifconfig command, and whether the network card is connected is determined based on the returned information; The negotiation rate is detected using the ethtool command to display the current connection speed and duplex mode of the network card; The IP address, subnet mask, gateway, and DNS server configured for the WAN port can be checked using the uci command or by editing the configuration file; The DHCP dynamic address is detected using the ifconfig command or the ip addr command; The WAN and LAN network address conflicts are detected by checking the IP addresses of the WAN port and the LAN port through the ip addr command, and then comparing whether the IP addresses are in the same subnet; The loop is detected using the traceroute command or the mtr command; The multi-DHCP server conflict detection, i.e., detecting whether there are multiple DHCP servers providing IP address allocation services in the network, is detected through the DHCP server log running on the OpenWRT intelligent terminal; The IP address conflict is detected using the arp command; The routing configuration is checked using the route command or by editing the routing configuration file; The next hop connectivity is detected using the ping command; The DNS configuration is detected using the cat command, etc command or resolv.conf command; The number of IP sessions is detected using the netstat command; The DHCP capacity detection is to monitor the number of leases of the DHCP server and trigger an alarm when the number of leases approaches or exceeds a set threshold; The network traffic is detected using a traffic monitoring tool.
9. An OpenWRT router, ONU, gateway network self-checking system as claimed in claim 6, characterized in that: In the self-test report generating module, the self-test report carries at least a self-test result, a self-test time, a serial number of the OpenWRT intelligent terminal, an installation location of the OpenWRT intelligent terminal, a software version number of the OpenWRT intelligent terminal, and a running time of the OpenWRT intelligent terminal.
10. An OpenWRT router, ONU, gateway network self-checking system as claimed in claim 6, characterized in that: The self-test report encryption upload module is specifically used for: The OpenWRT intelligent terminal encrypts the self-test report by using the RC2 algorithm to obtain first-level encrypted data, randomly generates a string of a specified length, adds the string to a specified position of the first-level encrypted data to obtain second-level encrypted data, encrypts the second-level encrypted data by using the 3DES algorithm to obtain third-level encrypted data, divides the third-level encrypted data based on a preset division ratio and exchanges the order to obtain fourth-level encrypted data, maps the fourth-level encrypted data by using a preset mapping rule to obtain fifth-level encrypted data, encrypts the fifth-level encrypted data by using the ECDSA algorithm to obtain an encrypted report, and sends the encrypted report to the server in real time through the SSL protocol; The encrypted report decryption module specifically includes: The server receives the encryption report, decrypts the encryption report through the ECDSA algorithm to obtain level-five encrypted data, maps the level-five encrypted data through a preset mapping rule to obtain level-four encrypted data, divides the level-four encrypted data based on the inverse of a preset division ratio and swaps the order to obtain level-three encrypted data, decrypts the level-three encrypted data through the 3DES algorithm to obtain level-two encrypted data, locates a string in the level-two encrypted data based on a specified position and a specified length, removes the string from the level-two encrypted data to obtain level-one encrypted data, decrypts the level-one encrypted data through the RC2 algorithm to obtain a self-test report, displays the self-test report through a graphical interface, and stores and distributes the encrypted report.
Citation Information
Cited By
Self-checking router network communication system
CN121151262A
A self-checking router network communication system
CN121151262B
