Disclosure of Invention
Based on this, it is necessary to provide a method, an apparatus, a router and a storage medium for configuring networking parameters of a router, aiming at the problem of inefficient replacement of the router.
A method of configuring networking parameters of a router, the method comprising:
locally configuring a first router as a networked authentication server;
the local area network port of the first router is connected with the wide area network port of the second router;
receiving a networking verification request of the second router by taking the networking verification server as a destination end;
extracting networking parameters from the networking authentication request;
and carrying out local networking configuration according to the networking parameters.
In one embodiment, the locally configuring the first router as a networked authentication server includes:
acquiring a prestored starting parameter for starting a networking verification service process;
starting a networking verification service process according to the starting parameters;
and locally configuring the first router as a networking authentication server through the networking authentication service process.
In one embodiment, the connecting with the wan port of the second router through the lan port local to the first router includes:
receiving a discovery request broadcast by a second router through a wide area network port of the second router through a local area network port of a first router;
sending, by a locally configured networked authentication server, response information to the wide area network port in response to the discovery request;
receiving a connection request sent by the second router through the wide area network port according to the response information;
and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
In one embodiment, the method further comprises:
and after the networking parameters are extracted from the networking verification request, sending a networking verification result indicating that the networking verification fails to the wide area network port of the second router, and removing the connection link.
In one embodiment, the method further comprises:
connecting a modem through a local wide area network port;
initiating a networking authentication request carrying the networking parameters to an operator networking authentication server through the modem by a locally configured networking client;
receiving a networking verification result fed back by the operator networking verification server according to the initiated networking verification request;
and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
An apparatus for configuring networking parameters of a router, the apparatus comprising:
the network authentication server configuration module is used for locally configuring the first router as a network authentication server;
the port connection module is used for connecting a local area network port of the first router with a wide area network port of the second router;
a networking verification request receiving module, configured to receive a networking verification request of the second router with the networking verification server as a destination;
the networking parameter extraction module is used for extracting networking parameters from the networking verification request;
and the networking configuration module is used for carrying out local networking configuration according to the networking parameters.
In one embodiment, the networked authentication server configuration module is further configured to start a parameter acquisition module; acquiring a prestored starting parameter for starting a networking verification service process; starting a networking verification service process according to the starting parameters; and locally configuring the first router as a networking authentication server through the networking authentication service process.
In one embodiment, the port connection module is further configured to receive, through a local area network port local to the first router, a discovery request broadcast by the second router through a wide area network port of the second router; sending, by a locally configured networked authentication server, response information to the wide area network port in response to the discovery request; receiving a connection request sent by the second router through the wide area network port according to the response information; and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
In one embodiment, the apparatus further comprises:
and the connection link removal module is used for sending a networking verification result indicating that the networking verification fails to the wide area network port of the second router after the networking parameters are extracted from the networking verification request, and removing the connection link.
In one embodiment, the apparatus further comprises:
the modem connection module is used for connecting the modem through a local wide area network port; initiating a networking authentication request carrying the networking parameters to an operator networking authentication server through the modem by a locally configured networking client; receiving a networking verification result fed back by the operator networking verification server according to the initiated networking verification request; and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
A router comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
locally configuring a first router as a networked authentication server;
the local area network port of the first router is connected with the wide area network port of the second router;
receiving a networking verification request of the second router by taking the networking verification server as a destination end;
extracting networking parameters from the networking authentication request;
and carrying out local networking configuration according to the networking parameters.
A storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
locally configuring a first router as a networked authentication server;
the local area network port of the first router is connected with the wide area network port of the second router;
receiving a networking verification request of the second router by taking the networking verification server as a destination end;
extracting networking parameters from the networking authentication request;
and carrying out local networking configuration according to the networking parameters.
According to the networking parameter configuration method, the networking parameter configuration device, the router and the storage medium of the router, the first router is locally configured as the networking verification server, and the local area network port of the first router is connected with the wide area network port of the second router, so that the first router can receive the networking verification request initiated by the second router, and the networking parameter is extracted from the networking verification request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is a diagram of an application environment of a method for configuring networking parameters of a router in one embodiment. Referring to fig. 1, the application environment includes a first router 110, a second router 120, a modem 130, and a carrier networking authentication server 140. The first router 110 and the second router 120 are connected by a network cable. The first router 110 and the modem 130 are connected by a network cable. The modem 130 is connected to the carrier networking authentication server 140 through a network. Routers, also known as gateway devices, are used to connect multiple logically separate networks. The terms "first" and "second" as used herein are used herein to describe routers, but routers are not limited by these terms. These terms are only used to distinguish the first router 110 from another router. For example, a first router may be referred to as a second router, and similarly, a second router may be referred to as a first router, without departing from the scope of the present invention. Both the first router 110 and the second router 120 are routers, but they are not the same router. Modem 130 is computer hardware that translates a computer's digital signals into analog signals that can be transmitted over a conventional telephone line, received by another modem on the other end of the line, and translated into a computer-understandable language. The operator networked authentication server 140 may be a stand-alone server or a cluster of servers, either physical servers or virtual servers.
Fig. 2 is a schematic diagram of an internal structure of a router according to an embodiment. The router may be the first router 110 in fig. 1. The router includes a processor, a memory, and a network interface connected by a system bus. The memory may include, among other things, a non-volatile storage medium and an internal memory. The processor is used for providing calculation and control capacity and supporting the operation of the whole router. The router has a memory in which a computer program is stored, which, when executed by a processor, causes the processor to perform a method of configuring networking parameters of the router. The network interface is used for connecting a network for communication.
Those skilled in the art will appreciate that the architecture shown in fig. 2 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the routers to which the subject application applies, and that a particular router may include more or fewer components than shown, or some components in combination, or have a different arrangement of components.
As shown in fig. 3, in one embodiment, a method for configuring networking parameters of a router is provided. This embodiment is mainly illustrated by applying this method to the router in fig. 2. Referring to fig. 3, the method for configuring networking parameters of a router specifically includes the following steps:
s302, the first router is locally configured to be a networking authentication server.
Wherein the first router is a new router to replace an old router. The old router is the second router. After the second router is powered on, the PPPoE automatic dialing process can be started spontaneously. The networking verification server may be used to verify the correctness of the received networking parameters or simply to obtain the networking parameters. For example, the networking verification server can be used as a PPPoE dial-up networking server to realize the negotiation authentication of PPPoE dial-up networking.
S304, the local area network port of the first router is connected with the wide area network port of the second router.
Fig. 4 is a schematic diagram illustrating the connection between the first router interface and the second router interface. The local LAN port is a LAN interface of the router, is mainly used for connecting the router and the LAN, and can be used for connecting a switch, a hub, a Personal Computer (PC), and the like in a home network. The WAN port is a WAN port of a router, and is mainly used for connecting to an external network, and can be used for connecting to a modem, a home network line, or a higher-level network.
S306, receiving the networking verification request of the second router with the networking verification server as the destination.
The networking authentication request is used for an authentication request of networking parameters sent to the server, such as: PPPoE dial-up networking request. PPPoE is an abbreviation for Point to Point Protocol over Ethernet, a Point-to-Point Protocol over Ethernet. Through PPPoE protocol, the remote access equipment can realize the control and charging of each access user. Compared with the traditional access mode, PPPoE has higher cost performance, is widely applied to a series of applications including cell networking construction and the like, and uses the PPPoE protocol in the current popular broadband access mode ADSL.
In one embodiment, the WAN port of the second router and the LAN port of the first router are connected through a network cable, and the second router automatically sends a PPPoE dial-up networking request to the first router after being powered on.
S308, extracting networking parameters from the networking verification request.
The networking parameters may be an internet account and a password. The internet account and the password are obtained by applying to an operator when the broadband is installed for the first time and are used for inputting the internet account and the password of the configuration management interface of the router, and a user cannot modify the internet account and the password randomly.
And S310, performing local networking configuration according to the networking parameters.
In one embodiment, the first router decrypts the encrypted internet account and password obtained from the networking verification request sent by the second router, and configures the first router locally as a networking client according to networking parameters such as the internet account and the password.
According to the networking parameter configuration method of the router, the first router is locally configured as the networking verification server, and the local area network port of the first router is connected with the wide area network port of the second router, so that the first router can receive the networking verification request initiated by the second router, and the networking parameters are extracted from the networking verification request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
In one embodiment, S302 includes: acquiring a prestored starting parameter for starting a networking verification service process; starting a networking verification service process according to the starting parameters; the first router is locally configured as a networked authentication server by a networked authentication service process.
The starting parameters comprise Max MTU, Max MRU, keepalive-timeout, one-session-per-host, Max-sessions, Interface and other parameters. Max MTU (Maximum Transfer Unit) Maximum Transfer Unit, whose set value is less than 1500, and default value is 1480. Max MTU (Maximum Receive Unit) Maximum acceptance Unit, default 1480. keepalive-timeout: a defined time period (e.g., seconds) is defined when a router sends a keepalive packet every second after a connection is initiated. If there is no transmission and no keepalive response within a set period of time, the client will be considered to be disconnected. The keepalive-timeout value is typically set to 10. If the setting is 0, the router will not disconnect the client side until the internet account is cancelled or the router restarts the internet account. one-session-per-host default is no, allowing only one host session connection at a time, if the host will try to establish a new session connection, the old one will be closed. max-sessions: indicating the maximum number of clients that can be served, and the default value is 0, without limitation. An Interface: a network card interface representing the client connection.
In the above embodiment, the first router configures the pre-stored parameter for starting the networking authentication service process as the networking authentication server, which provides a possibility for the first router to obtain the networking parameter from the second router serving as the client in a later stage.
In one embodiment, S304 includes: receiving a discovery request broadcast by a second router through a wide area network port of the second router through a local area network port of a first router; sending, by a locally configured networked authentication server, response information in response to the discovery request to the wide area network port; receiving a connection request sent by the second router through the wide area network port according to the response information; and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
In one embodiment, after the second router is powered on, the second router serves as a PPPoE client to send a PADI (PPPoE Active Discovery initiation) packet to the first router in a broadcast manner at the WAN port, and the PADI packet includes a service requested by the client. After the first router is powered on and used as a PPPoE server to receive a PADI packet, whether the service can be provided is judged. If the service can be provided, the first router sends a PADO (PPPoE Active Discovery offer) data packet to the second router for response. The PADO packet includes the name of the first router and the same service name as in the PADI packet. The second router sends a PADR (pppoe Active Discovery request) packet to the first router, the PADR packet including the service requested by the second router. The first router creates a unique PPPoE session unique identification (session ID) after receiving the PADR data packet, and sends a PADS (PPPoE Active Discovery configuration) data packet as a response to the second router. The first router acquires a Session identifier (Session ID) and a MAC address of the second router, and the second router acquires the Session identifier (Session ID) and the MAC address of the first router. And after the PPP negotiation is passed, the second router sends authentication information carrying an internet account and a password to the first router.
In the above embodiment, the second router establishes a connection link with the first router after being powered on, and a channel is provided for the first router to obtain the networking parameters from the second router.
In one embodiment, the method for configuring networking parameters of a router further comprises: and after the networking parameters are extracted from the networking verification request, sending a networking verification result indicating that the networking verification fails to the wide area network port of the second router, and removing the connection link.
In one embodiment, the first router acquires the encrypted internet account number and the encrypted password from the networking authentication request, and sends a networking authentication result indicating that the networking authentication fails to be performed to the WAN port of the second router. The first router and the second router do not negotiate the IP, DNS, WINS and the like in the IPCP stage of the session stage of PPPoE dial-up networking, and the first router directly sends a PADT (PPPoE Active Discovery terminal) data packet to the second router to inform the second router to remove the connection link.
In an embodiment, after the first router obtains the encrypted internet account and the encrypted password from the networking verification request, the second router sends a padt (pppoe Active Discovery termination) packet to the LAN port of the first router to notify the first router to tear down the connection link.
In the above embodiment, the connection link is removed after the first router obtains the networking parameters from the second router, which saves time and unnecessary resource waste.
In one embodiment, the method for configuring networking parameters of a router further comprises: connecting a modem through a local wide area network port; initiating a networking authentication request carrying networking parameters to an operator networking authentication server through a modem by a locally configured networking client; receiving a networking verification result fed back by an operator networking verification server according to the initiated networking verification request; and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
The modem is a short term for a Modulator (Modulator) and a Demodulator (Demodulator).
In one embodiment, the first router decrypts the encrypted internet account and password obtained from the authentication information sent by the second router, and configures the first router as a networked client according to networking parameters such as the internet account and the password. The first router is connected with the optical modem through a WAN interface and sends a networking verification request carrying networking parameters to an operator networking verification server. And the operator networking authentication server sends a networking authentication result of successful networking authentication to the first router, so that the first router is connected with the Internet through a modem.
In one embodiment, the first router acquires networking parameters such as an internet account and a password from the authentication information sent by the second router, and configures the first router into a PPPoE client according to the networking parameters such as the internet account and the password. The first router is connected with the optical modem through a WAN interface and sends a networking verification request carrying networking parameters such as an internet account number, a password and the like to an operator networking verification server. After the first router and the operator networking verification server negotiate and authenticate the internet account and the password through a discovery stage and a session stage, the first router is connected with the internet through a modem.
In the above embodiment, the first router is automatically configured to the networking client for dial-up networking after acquiring the networking parameters, and manual setting is not needed, so that labor and time costs are saved.
According to the networking parameter configuration method of the router, the first router is locally configured as the networking verification server, and the local area network port of the first router is connected with the wide area network port of the second router, so that the first router can receive the networking verification request initiated by the second router, and the networking parameters are extracted from the networking verification request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
As shown in fig. 5, in a specific embodiment, the method for configuring networking parameters of a router specifically includes the following steps:
s502, the first router configures the first router locally as a networking authentication server.
S504, the first router connects the local LAN port of the first router with the WAN port of the second router.
S506, the first router receives the networking verification request of the second router with the networking verification server as the destination end.
S508, the first router extracts the networking parameters from the networking verification request.
S510, after the first router extracts the networking parameters from the networking verification request, the first router sends a networking verification result indicating that the networking verification fails to the WAN port of the second router, and the connection link is removed.
S512, the first router decrypts networking parameters such as the internet account number and the password, and configures the first router as a networking client locally.
According to the networking parameter configuration method of the router, the first router is locally configured as the networking authentication server, and the local LAN port of the first router is connected with the WAN port of the second router, so that the first router can receive the networking authentication request initiated by the second router, and the networking account and the password are extracted from the networking authentication request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
As shown in fig. 6, a networking parameter configuration apparatus 600 of a router, the apparatus 600 includes: a networking authentication server configuration module 601, a port connection module 602, a networking authentication request receiving module 603, a networking parameter extraction module 604, and a networking configuration module 605.
A networked authentication server configuration module 601, configured to configure the first router locally as a networked authentication server.
A port connection module 602, configured to connect to a wan port of a second router through a local lan port of a first router.
A networking authentication request receiving module 603, configured to receive a networking authentication request from the second router using the networking authentication server as a destination.
A networking parameter extracting module 604, configured to extract the networking parameter from the networking authentication request.
A networking configuration module 605, configured to perform local networking configuration according to the networking parameters.
In one embodiment, the networked authentication server configuration module 601 is further configured to obtain a pre-stored starting parameter for starting the networked authentication service process; the system comprises a network authentication service process, a starting parameter and a starting parameter, wherein the network authentication service process is used for starting the network authentication service process according to the starting parameter; the first router is locally configured as a networked authentication server by a networked authentication service process.
In one embodiment, the port connection module 602 is further configured to receive, through a local area network port local to the first router, a discovery request broadcast by the second router through a wide area network port of the second router; sending, by a locally configured networked authentication server, response information in response to the discovery request to the wide area network port; receiving a connection request sent by the second router through the wide area network port according to the response information; and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
As shown in fig. 7, in one embodiment, the networking parameter configuration apparatus 600 of the router further includes: a link tear down module 606.
And a connection link removal module 606, configured to send a networking verification result indicating that the networking verification fails to be performed to the wan port of the second router after the networking parameters are extracted from the networking verification request, and remove the connection link.
As shown in fig. 8, in one embodiment, the networking parameter configuration apparatus 600 of the router further includes: a connection module 607 of the modem.
A modem connection module 607 for connecting the modem via the local wan port; initiating a networking authentication request carrying networking parameters to an operator networking authentication server through a modem by a locally configured networking client; receiving a networking verification result fed back by an operator networking verification server according to the initiated networking verification request; and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
According to the networking parameter configuration device of the router, the first router is locally configured as the networking verification server, and the local area network port of the first router is connected with the wide area network port of the second router, so that the first router can receive the networking verification request initiated by the second router, and the networking parameter is extracted from the networking verification request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
A router comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of: locally configuring a first router as a networked authentication server; the local area network port of the first router is connected with the wide area network port of the second router; receiving a networking verification request of a second router by taking a networking verification server as a destination end; extracting networking parameters from the networking verification request; and carrying out networking configuration locally according to the networking parameters.
In one embodiment, the step of locally configuring the first router as a networked authentication server comprises: acquiring a prestored starting parameter for starting a networking verification service process; starting a networking verification service process according to the starting parameters; the first router is locally configured as a networked authentication server by a networked authentication service process.
In one embodiment, the step of connecting to the wide area network port of the second router through the local area network port local to the first router comprises: receiving a discovery request broadcast by a second router through a wide area network port of the second router through a local area network port of a first router; sending, by a locally configured networked authentication server, response information in response to the discovery request to the wide area network port; receiving a connection request sent by the second router through the wide area network port according to the response information; and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
In one embodiment, the computer program, when executed by a processor, causes the processor to perform the steps of: and after the networking parameters are extracted from the networking verification request, sending a networking verification result indicating that the networking verification fails to the wide area network port of the second router, and removing the connection link.
In one embodiment, the computer program, when executed by a processor, causes the processor to perform the steps of: connecting a modem through a local wide area network port; initiating a networking authentication request carrying networking parameters to an operator networking authentication server through a modem by a locally configured networking client; receiving a networking verification result fed back by an operator networking verification server according to the initiated networking verification request; and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
The router enables the first router to receive a networking verification request initiated by the second router and extracts networking parameters from the networking verification request for networking configuration by locally configuring the first router as a networking verification server and connecting a local area network port of the first router with a wide area network port of the second router. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
A storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of: locally configuring a first router as a networked authentication server; the local area network port of the first router is connected with the wide area network port of the second router; receiving a networking verification request of a second router by taking a networking verification server as a destination end; extracting networking parameters from the networking verification request; and carrying out networking configuration locally according to the networking parameters.
In one embodiment, the step of locally configuring the first router as a networked authentication server comprises: acquiring a prestored starting parameter for starting a networking verification service process; starting a networking verification service process according to the starting parameters; the first router is locally configured as a networked authentication server by a networked authentication service process.
In one embodiment, the step of connecting to the wide area network port of the second router through the local area network port local to the first router comprises: receiving a discovery request broadcast by a second router through a wide area network port of the second router through a local area network port of a first router; sending, by a locally configured networked authentication server, response information in response to the discovery request to the wide area network port; receiving a connection request sent by the second router through the wide area network port according to the response information; and establishing a connection link between the local area network port and the wide area network port of the second router according to the connection request.
In one embodiment, the computer program, when executed by a processor, causes the processor to perform the steps of: and after the networking parameters are extracted from the networking verification request, sending a networking verification result indicating that the networking verification fails to the wide area network port of the second router, and removing the connection link.
In one embodiment, the computer program, when executed by a processor, causes the processor to perform the steps of: connecting a modem through a local wide area network port; initiating a networking authentication request carrying networking parameters to an operator networking authentication server through a modem by a locally configured networking client; receiving a networking verification result fed back by an operator networking verification server according to the initiated networking verification request; and when the networking verification result indicates that the networking verification is successful, connecting to the Internet through the modem.
The storage medium locally configures the first router as a networking authentication server and connects the local area network port of the first router with the wide area network port of the second router, so that the first router can receive a networking authentication request initiated by the second router and extract networking parameters from the networking authentication request for networking configuration. Therefore, the networking parameters can be automatically known and set in a networking mode without the user remembering the networking parameters or obtaining the networking parameters through other ways, and the replacement efficiency of the router is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.