Network device connection method and related products
By repeatedly selecting the physical interface to be configured in the network device and configuring the connection parameters, the problem of installers entering the configuration parameters multiple times and verifying the physical interface is solved, improving the connection efficiency.
Patent Information
- Application Number
- CN202010470261.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-28
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2040-05-28
AI Technical Summary
In the prior art, when a network device is connected to a network management device, the installer needs to enter configuration parameters and verify the physical interface multiple times, resulting in large workload and low efficiency.
By obtaining the connection parameters, repeatedly select the physical interface to be configured for the network device, and configure the connection parameters to the physical interface until the connection with the network management device is successful or there is no physical interface to be configured.
Reduces the number of times the installer enters configuration parameters and wiring operations, reduces the workload and improves work efficiency.
Smart Images

Figure CN113747459B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a method for connecting network devices and related products. Background Art
[0002] The network device establishes a connection with the network management device to access the working network to which the network management device belongs. The network device needs to configure a connection interface connected to the network management device and establish a connection with the network management device through the connection interface. The configuration parameters of the connection interface are input by the installer of the network device. The configuration parameters include connection parameters and interface identifiers, and the interface identifier is used to distinguish the connection interface from multiple physical interfaces of the network device. After obtaining the configuration parameters, the network device configures the connection parameters on the physical interface specified by the interface identifier, and uses the physical interface specified by the interface identifier to establish a connection with the network management device.
[0003] To configure the connection interface of the network device, the installer is also required to distinguish the physical interface in the network device that is connected to the network management device. If the physical interface indicated by the interface identifier is not the physical interface connected to the network management device, the network device cannot be successfully connected to the network management device. If the network device cannot be successfully connected to the network management device, the installer is required to re-enter the configuration parameters until the network device and the network management device are connected. In addition, if the network device and the network management device are connected by a cable, the installer will perform repeated wiring operations to ensure that the cable is connected to the physical interface indicated by the interface identifier. This method requires a large workload for the installer and has low work efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method for connecting network devices and related products, which can reduce the workload of installers and improve work efficiency.
[0005] In a first aspect, an embodiment of the present application provides a connection method for a network device, the method comprising: obtaining connection parameters, the connection parameters being used to establish a connection with a network management device; selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface, the physical interface to be configured being a physical interface that has not been configured with the connection parameters after the connection parameters are obtained, and the first physical interface being used to establish a connection with the network management device; configuring the connection parameters on the first physical interface; if the first physical interface is successfully connected to the network management device, determining that the connection parameters are successfully configured; if the first physical interface fails to connect to the network management device, reselecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface, until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device.
[0006] The physical interface to be configured is used as the first physical interface. After failing to connect to the network management device, the physical interface to be configured becomes a configured physical interface.
[0007] In an embodiment of the present application, after obtaining the connection parameters, the physical interface to be configured of the network device can be repeatedly selected as the first physical interface, and the connection parameters can be configured to the first physical interface until the first physical interface is successfully connected to the network management device or the network device does not have a physical interface to be configured, thereby reducing the number of times the installer enters the configuration parameters and also reducing the wiring operations performed by the installer to verify the physical interface, thereby reducing the installer's workload and improving work efficiency.
[0008] In an optional implementation, the obtaining of the connection parameters includes: obtaining the connection parameters when it is detected that an installer of the network device inputs the connection parameters.
[0009] In this implementation, the trigger condition for configuring the connection parameters is to detect that the installer of the network device inputs the connection parameters, and the connection parameters are input by the installer during the process of installing the network device. In the case where the installer of the network device inputs the connection parameters, the connection parameters are repeatedly configured to the physical interface to be configured of the network device until the first physical interface of the network device is successfully connected to the network management device or the network device does not have a physical interface to be configured, thereby reducing the number of times the installer inputs the connection parameters when installing the network device, thereby reducing the workload of the installer when installing the network device.
[0010] In an optional implementation, the connection parameters are input by the installer through a graphical user interface GUI.
[0011] In an implementation, the installation personnel can easily input connection parameters through a GUI.
[0012] In an optional implementation, the connection parameters are input by the installer through a command line.
[0013] In an implementation, the installer can also input connection parameters through a command line, thereby diversifying the input method of connection parameters.
[0014] In an optional implementation, selecting a physical interface to be configured from the physical interfaces of the network device includes: selecting a physical interface to be configured from the physical interfaces of the network device according to a first configuration order, wherein the first configuration order is the configuration order of the physical interfaces of the network device when the connection parameters have not yet been configured.
[0015] In this implementation, by selecting the physical interface to be configured from the physical interfaces of the network device as the first physical interface according to the first configuration sequence, the connection parameters can be configured to the physical interfaces of the network device in an orderly manner, thereby improving the configuration efficiency.
[0016] In an optional implementation, before selecting a physical interface to be configured from the physical interfaces of the network device according to the first configuration order, the method further includes: obtaining an interface identification sequence input by the installer, and taking the order of the physical interfaces in the interface identification sequence as the first configuration order.
[0017] In this implementation, the first configuration sequence is input by the installer, and the physical interface to be configured is selected according to the first configuration sequence determined by the installer, thereby improving the configuration efficiency of the physical interface.
[0018] In an optional implementation, the method further includes: determining the first configuration order according to priority information of the physical interface, and the priority information is stored in a local storage module.
[0019] In this implementation, the first configuration order is determined according to preset priority information, which is conducive to quickly configuring the physical interface of the network device.
[0020] Among them, in some embodiments, the first configuration order may be the order in which the physical interfaces are arranged according to the interface type. For example, the interface type is divided according to the interface rate, and the first configuration order is the order in which the physical interfaces are arranged from fast to slow according to the interface rate. In other embodiments, the first configuration order may be the order in which the physical interfaces are arranged according to the physical interface numbers. In still other embodiments, the first configuration order may be the order in which the physical interfaces are arranged in sequence according to the interface type and the physical interface numbers. In this embodiment, the network device includes multiple physical interfaces of the same interface type, and the physical interfaces of the same interface type are arranged according to the physical interface numbers.
[0021] In an optional implementation, the selecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface includes: when the locally stored priority information is the interface identifier of the second physical interface, selecting the second physical interface from the physical interfaces to be configured of the network device as the first physical interface.
[0022] In this implementation, the priority information stored locally is only the interface identifier of the second physical interface, and the second physical interface has the highest priority in configuring the connection parameters. Giving priority to configuring the connection parameters to the second physical interface can improve the efficiency of configuring the physical interface.
[0023] In an optional implementation, the method also includes: obtaining the interface identifier of the second physical interface input by the installer; selecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface, including: selecting the second physical interface from the physical interfaces to be configured of the network device as the first physical interface according to the interface identifier of the second physical interface.
[0024] In this implementation, the connection parameters input by the installer include an interface identifier, which is used to indicate that the connection parameters are preferentially configured to the second physical interface indicated by the interface identifier. Preferentially configuring the connection parameters to the second physical interface specified by the installer can improve the efficiency of configuring the physical interface.
[0025] In an optional implementation, reselecting one of the physical interfaces to be configured from the physical interfaces of the network device as the first physical interface includes: reselecting one of the physical interfaces to be configured from the physical interfaces of the network device as the first physical interface according to a second configuration order, wherein the second configuration order is the configuration order of the physical interfaces of the network device other than the second physical interface when the interface identifier is obtained.
[0026] In this implementation, when the second physical interface serving as the first physical interface fails to connect to the network management device, the physical interface to be configured is selected as the first physical interface according to the second configuration sequence, so that the connection parameters can be configured to the physical interface of the network device in an orderly manner, thereby improving configuration efficiency.
[0027] In an optional implementation, the method further includes: determining the second configuration order according to locally stored priority information, wherein the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
[0028] In this implementation, the second configuration order is determined according to preset priority information, which is conducive to quickly configuring the physical interface of the network device.
[0029] In an optional implementation, the obtaining of connection parameters includes: upon detecting that the third physical interface is disconnected from the network management device, obtaining the connection parameters configured on the third physical interface, wherein the third physical interface is a physical interface on which the network device has been successfully connected to the network management device before the disconnection.
[0030] In this implementation method, the connection parameters configured on the third physical interface are configured to other physical interfaces of the network device, so that when the third physical interface is disconnected from the network management device, other physical interfaces that can establish a connection with the network management device can be found, thereby improving the reliability of the connection between the network device and the network management device.
[0031] In an optional implementation, selecting a physical interface to be configured from the physical interfaces of the network device includes: selecting a physical interface to be configured from the physical interfaces of the network device according to a third configuration order, and the third configuration order is the configuration order of the physical interfaces of the network device other than the third physical interface when the third physical interface is disconnected from the network management device.
[0032] In this implementation, when the third physical interface is disconnected from the network management device, the physical interface to be configured is selected as the first physical interface according to the third configuration sequence, so that the connection parameters can be configured to the physical interface of the network device in an orderly manner, thereby improving configuration efficiency.
[0033] In an optional implementation, the third configuration order is input by the installer or determined according to priority information stored locally, where the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
[0034] In this implementation, the third configuration sequence may be input by an installer, or may be determined by the network device according to priority information of the physical interface, which is beneficial to improving the configuration efficiency of the physical interface.
[0035] In the implementation of this application, the priority information may be only the interface identifier of the second physical interface, the second physical interface is the highest priority physical interface of the network device, and the network device preferentially selects the physical interface as the first physical interface. The priority information may also include the priority identifiers of all physical interfaces of the network device, and the network device may determine the first configuration order, the second configuration order, or the third configuration order according to the priority information.
[0036] In an optional implementation, when the first physical interface fails to connect to the network management device, before reselecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface, the method further includes: clearing the connection parameters configured in the first physical interface.
[0037] In this implementation, when the first physical interface fails to connect to the network management device, the connection parameters configured on the first physical interface are cleared to avoid configuring the connection parameters on multiple physical interfaces, thereby preventing the network device from being unable to establish a connection with the network management device due to a physical interface configuration conflict.
[0038] In an optional implementation, the method further includes: when the first physical interface fails to connect to the network management device and the network device does not have the physical interface to be configured, determining that the connection parameter configuration fails.
[0039] In this implementation, when all physical interfaces to be configured of the network device are used as the first physical interface and all physical interfaces to be configured fail to connect to the network management device, it is determined that the connection parameter configuration fails, and prompt information of the configuration failure can be further output.
[0040] In a second aspect, an embodiment of the present application provides a network device, comprising: an acquisition unit, used to acquire connection parameters, wherein the connection parameters are used to establish a connection with a network management device; a selection unit, used to select a physical interface to be configured from the physical interfaces of the network device as a first physical interface, the physical interface to be configured being a physical interface that has not been configured with the connection parameters after the connection parameters are acquired; a configuration unit, used to configure the connection parameters on the first physical interface; a determination unit, used to determine that the connection parameters are successfully configured when the first physical interface is successfully connected to the network management device; the selection unit is also used to reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface when the first physical interface fails to connect to the network management device, until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device.
[0041] In an optional implementation, the acquisition unit is specifically configured to: acquire the connection parameter when it is detected that an installer of the network device inputs the connection parameter.
[0042] In an optional implementation, the selection unit is specifically used to: select a physical interface to be configured from the physical interfaces of the network device according to a first configuration order, wherein the first configuration order is the configuration order of the physical interfaces of the network device when the connection parameters have not been configured.
[0043] In an optional implementation, the acquisition unit is further used to: acquire an interface identification sequence input by the installer, and use the order of the physical interfaces in the interface identification sequence as the first configuration order.
[0044] In an optional implementation, the determination unit is further used to: determine the first configuration order according to locally stored priority information, where the priority information includes the priority levels of the connection parameters configured by all physical interfaces of the network device.
[0045] In an optional implementation, the selection unit is specifically used to: when the locally stored priority information is an interface identifier of the second physical interface, select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface.
[0046] In an optional implementation, the acquisition unit is also used to obtain the interface identifier of the second physical interface input by the installer; the selection unit is specifically used to: select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface according to the interface identifier of the second physical interface.
[0047] In an optional implementation, the selection unit is further specifically used to: reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface according to a second configuration order, and the second configuration order is the configuration order of the physical interfaces of the network device other than the second physical interface when the interface identifier is obtained.
[0048] In an optional implementation, the determination unit is further used to: determine the second configuration order according to locally stored priority information, where the priority information includes the priority levels of the connection parameters configured by all physical interfaces of the network device.
[0049] In an optional implementation, the acquisition unit is specifically used to: when it is detected that the third physical interface is disconnected from the network management device, obtain the connection parameters configured on the third physical interface, and the third physical interface is the physical interface that the network device has successfully connected to the network management device before the disconnection.
[0050] In an optional implementation, the selection unit is specifically used to: select a physical interface to be configured from the physical interfaces of the network device according to a third configuration order, and the third configuration order is the configuration order of the physical interfaces of the network device except the third physical interface when the third physical interface is disconnected from the network management device.
[0051] In an optional implementation, the third configuration order is input by the installer or determined according to priority information stored locally, where the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
[0052] In an optional implementation, the priority information includes a priority identifier of at least one physical interface, and the priority identifier is used to indicate a priority of the physical interface configuration.
[0053] In an optional implementation, the network device further includes: a clearing unit, configured to clear the connection parameters configured on the first physical interface.
[0054] In an optional implementation, the determination unit is further configured to determine that the connection parameter configuration fails when the first physical interface fails to connect to the network management device and the network device does not have the physical interface to be configured.
[0055] In a third aspect, an embodiment of the present application provides another network device, wherein the electronic device includes a processor and a memory, wherein the memory is used to store programs; the processor is used to execute the programs stored in the memory, and when the program is executed, the processor is used to execute the method as described in the first aspect and the optional implementation method in the first aspect.
[0056] In a fourth aspect, an embodiment of the present application provides another network device, wherein the electronic device includes a processor and an interface circuit, wherein the interface circuit is used to receive code instructions and transmit them to the processor; the processor runs the code instructions to execute the method as described in the first aspect and the optional implementation method in the first aspect.
[0057] In a fifth aspect, an embodiment of the present application provides a readable storage medium, which is used to store instructions. When the instructions are executed, the method of the above-mentioned first aspect and the optional implementation method in the above-mentioned first aspect are implemented.
[0058] In a sixth aspect, an embodiment of the present application provides a network system, which includes a network device and a network management device, and the network device is used to execute the method of the above-mentioned first aspect and the optional implementation method of the above-mentioned first aspect.
[0059] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed, enables the methods of the above-mentioned first aspect to the above-mentioned first aspect and the optional implementation methods in the above-mentioned first aspect to be implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0061] Figure 1 It is a schematic diagram of a network architecture disclosed in an embodiment of the present application;
[0062] Figure 2 An application scenario diagram provided for an embodiment of the present application;
[0063] Figure 3A A schematic diagram of a method for connecting a network device provided in an embodiment of the present application;
[0064] Figure 3BA schematic diagram of a connection parameter configuration interface provided in an embodiment of the present application;
[0065] Figure 4 A schematic diagram of another method for connecting network devices provided in an embodiment of the present application;
[0066] Figure 5A A schematic diagram of another method for connecting network devices provided in an embodiment of the present application;
[0067] Figure 5B A schematic diagram of another connection parameter configuration interface provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of another method for connecting network devices provided in an embodiment of the present application;
[0069] Figure 7 A schematic diagram of another method for connecting network devices provided in an embodiment of the present application;
[0070] Figure 8 A schematic diagram of a network device structure provided in an embodiment of the present application;
[0071] Fig. 9 A schematic diagram of the structure of another network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The terms "first", "second", and "third" in the specification embodiments and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0073] The embodiment of the present application discloses a method for connecting a network device and related products, by sequentially configuring connection parameters to the physical interfaces of the network device until one physical interface of the network device is successfully configured or all physical interfaces of the network device fail to be configured. In order to better understand the method for connecting a network device and related products disclosed in the embodiment of the present application, the network architecture applicable to the embodiment of the present application is described below. The method disclosed in the embodiment of the present application can be applied to the following. Figure 1 In the network architecture shown.
[0074] First, for ease of understanding, let's combine Figure 1 , briefly introduce the application environment of the embodiment of the present application. Figure 1As shown, the network architecture includes a network management device 101 and multiple network devices: network device 102, network device 103 and network device 104, and the network management device 101 is connected to each network device respectively. Network devices 102, network devices 103 and network devices 104 are connected to the network to which the network management device 101 belongs by establishing a connection with the network management device 101. The network devices in the embodiment of the present application include but are not limited to the following devices: gateway devices, wireless access points (access points, AP) devices or optical network units (optical network units, ONU) devices. The network management device is an uplink device of the network device. The uplink device is an upper layer device of the network device in the network topology structure, and the network device accesses the network to which the uplink device belongs by connecting to the uplink device, for example, an uplink device of the convergence layer device is a core network device. The downlink device is a lower layer device of the network device in the network topology structure, for example, a downlink device of the convergence layer device is an access layer device. The uplink link of the network device is a link connecting the uplink device, and the downlink link is a link connecting the downlink device. The network management devices in the embodiments of the present application include but are not limited to the following devices: a controller, a log server, an Internet Group Management Protocol (IGMP) server or an optical line terminal (OLT). The controller may be a software defined network (SDN) controller, and the gateway device may be a network address translation (NAT) gateway.
[0075] When deploying network equipment, network equipment installers, such as network installation engineers or network maintenance engineers, usually need to perform a variety of tedious parameter configurations on the physical interfaces of network equipment in order to connect the network equipment to work. The process of configuring network equipment parameters to connect to the network is called "entry" or "deployment".
[0076] The physical interface is the hardware interface between different devices and components in the system. The types of physical interfaces include but are not limited to Ethernet interface, E1 interface, synchronous / asynchronous (SA) interface, digital subscriber line (DSL) interface, asynchronous transfer mode (ATM) interface, and wireless interface.
[0077] Among them, the Ethernet interface is the port for network data connection in Ethernet. Commonly used Ethernet interfaces include square connector (SC) fiber optic interface, registered jack 45 (RJ-45) interface, fiber distributed data interface (FDDI) interface, control (console) interface, etc. E1 is a digital transmission system primary group standard formulated by the International Telecommunication Union Telecommunication Standardization Sector (ITU-T) and named by the European Posts and Telecommunications Association European Posts and Telecommunications Conference (CEPT). The physical and electrical characteristics of the E1 interface conform to the G.703 standard of the International Telegraph and Telephone Consultative Committee (CCITT). ATM technology is a broadband technology for transmitting voice, video images and data on a local area network (LAN) or a wide area network (WAN). ATM interface network cards are used in ATM fiber optic networks or ATM twisted pair networks. SA interface, also known as synchronous / asynchronous serial, supports point-to-point protocol (PPP) connection mode. DSL technology uses copper telephone lines as physical media to provide high-speed data transmission technology, including asymmetric digital subscriber line (ADSL), high-data-rate digital subscriber line (HDSL), single-pair high-speed digital subscriber line (SHDSL), very-high-speed digital subscriber line (VDSL) and other different types.The wireless interface is used to establish a wireless connection according to different network protocols, for example, the wireless interface is a wireless local area network (WLAN) interface, a long-term evolution (LTE) interface, and a third generation (3G) mobile communication technology interface.
[0078] In order to reduce the workload of the installers, a network management device is set up in the network. The network management device is responsible for monitoring and managing the network devices in the network. Figure 2 In the application scenario shown, the network device is a gateway device and the network management device is a controller. The installer of the gateway device no longer needs to perform complex configuration on the gateway device. They only need to input some configuration parameters that allow the gateway device to access the controller, and the gateway will apply to the controller for the complete configuration parameters. Since the installer does not need to configure the service functions of the network device in this process, the process of configuring the network device to access the configuration parameters of the controller to access the network is called "zero configuration entry" or "zero configuration start".
[0079] At present, in the process of "zero configuration entry", the configuration parameters input by the installer include connection parameters and interface identifiers, and the interface identifier is used to indicate a physical interface of the network device. When the physical interface is connected to the network management device, if the network device configures the connection parameters on the physical interface, the network device can establish a connection with the network management device through the physical interface. When the physical interface is not connected to the network management device, if the network device configures the connection parameters to the physical interface, the network device cannot establish a connection with the network management device through the physical interface. In order for the network device to configure the physical interface again to establish a connection with the network management device, the installer needs to input the configuration parameters again to instruct the network device to configure the physical interface again. If the physical interface indicated by the interface identifier is not the physical interface connected to the network management device, the installer needs to check the interface identifier and input the configuration parameters multiple times, which increases the workload of the installer.
[0080] Figure 3A is a flow chart showing a method for connecting network devices according to an exemplary embodiment. Figure 3A The method shown is applied to Figure 1 The network device shown, the method comprises the following steps:
[0081] 301. Obtain connection parameters, where the connection parameters are used to establish a connection with a network management device.
[0082] The network device obtains connection parameters, which are used to establish a connection between the network device and the network management device. The connection parameters are the part of the above configuration parameters except the interface identifier.
[0083] Optionally, the connection parameters include the address of the network management device, the port number of the network management device, the connection method between the physical interface and the network management device, and the parameters required for the connection method. The address of the network management device is the Internet Protocol (IP) address of the network management device. Figure 3B In the connection parameter configuration interface shown, the address of the network management device is "1.1.1.1"; the port number of the network management device is "10020", the connection method is based on the point-to-point protocol over Ethernet (PPPoE), and the parameters required for the connection method include the PPPoE user name and the PPPoE user password. The above connection parameters are entered by the installer of the network device, and the installer can also view the connection parameters through the configuration interface after the connection parameters are successfully configured.
[0084] The network device may obtain the connection parameters input by the installer after detecting that the installer of the network device inputs the connection parameters. The connection parameters may be input by the installer through a graphical user interface (GUI), such as Figure 3B The connection parameter configuration interface shown is an example GUI. The connection parameter can also be input by the installer to the network device through a command line, for example, the connection method in the connection parameter is input through the command line "ip address ppp-negotiate" to make the connection method of the physical interface PPPoE. In some embodiments, the network device can also obtain the connection parameter from the storage medium of the network device. In some other embodiments, when the third physical interface that has established a connection with the network management device is disconnected, the network device obtains the connection parameter configured on the third physical interface.
[0085] 302. Select a physical interface to be configured from the physical interfaces of the network device as a first physical interface.
[0086] The network device selects a physical interface to be configured from the physical interfaces of the network device as the first physical interface. The physical interface to be configured is a physical interface that has not been configured with the connection parameters after the connection parameters are acquired by the network device. The first physical interface is a physical interface used to establish a connection with the network management device.
[0087] The network device may select a physical interface to be configured from the physical interfaces of the network device as the first physical interface according to different configuration orders. The network device may also randomly select a physical interface to be configured from the physical interfaces of the network device. In some embodiments, when the connection parameters have not been configured by the network device, the network device selects a physical interface to be configured from the physical interfaces of the network device according to the first configuration order as the first physical interface, and the first configuration order is the configuration order of the physical interfaces of the network device when the connection parameters have not been configured. In other embodiments, when the installer also inputs the interface identifier of the second physical interface, the network device selects the second physical interface of the network device from the physical interfaces to be configured of the network device according to the interface identifier as the first physical interface. The configuration priority of the second physical interface indicated by the interface identifier is higher than the configuration priority of other physical interfaces to be configured, and the interface identifier is used to indicate that the network device configures the connection parameters to the second physical interface of the network device first. In some other embodiments, when the third physical interface of the network device is disconnected from the network management device, the network device selects a physical interface to be configured from the physical interfaces of the network device according to the third configuration order as the first physical interface. The second configuration order is the configuration order of the physical interfaces of the network device except the third physical interface.
[0088] Optionally, the physical interface of the network device includes at least one of the following interfaces: Ethernet interface, E1 interface, SA interface, DSL interface, ATM interface, wireless interface. The physical interface of the network device can be connected to the network management device by wired connection or by wireless connection.
[0089] 303. Configure the connection parameter on the first physical interface.
[0090] The network device configures the connection parameters to the first physical interface of the network device. Specifically, the network device configures the connection mode between the first physical interface and the network management device and the parameters required for the connection mode according to the connection parameters. The network device then attempts to send a connection request to the network management device using the first physical interface through the address and interface identifier of the network management device in the connection parameters.
[0091] 304. When the first physical interface is successfully connected to the network management device, determine that the connection parameter configuration is successful.
[0092] The network device determines that the connection parameter configuration is successful when the first physical interface is successfully connected to the network management device. The first physical interface is successfully connected to the network management device, specifically, the network device successfully sends a connection request to the network management device through the first physical interface.
[0093] Optionally, after the connection parameters are successfully configured, the network device outputs an indication of successful configuration, so that the installer can determine that the connection parameters are successfully configured to the physical interface of the network device. In some embodiments, the indication of successful configuration also includes an interface identifier of the first physical interface. For example, the network device successfully configures the connection parameters to the first physical interface of the network device, and the interface identifier of the first physical interface is "GigabitEthernet0 / 0 / 1", then the network device displays the indication of successful configuration and the interface identifier "GigabitEthernet0 / 0 / 1" in the configuration interface, and the interface identifier is used to indicate that the first physical interface is a Gigabit Ethernet port numbered 0 / 0 / 1, wherein the numbers in the number 0 / 0 / 1 of the Ethernet interface represent the slot number, module number and port number of the physical interface in the network device in sequence. By displaying the indication of successful configuration, the network device informs the installer that the connection parameters are successfully configured and distinguishes the first physical interface that establishes a connection with the network management device from the multiple physical interfaces of the network device.
[0094] 305. When the first physical interface fails to connect to the network management device, reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface until the first physical interface connects to the network management device successfully or there is no physical interface to be configured in the physical interfaces of the network device.
[0095] It is understandable that, in the case where the first physical interface fails to connect to the network management device, the physical interface serving as the first physical interface changes from the physical interface to be configured to the configured physical interface. For example, the physical interfaces to be configured of the network device are two SA interfaces: physical interface "Serial0 / 1 / 1" and physical interface "Serial0 / 1 / 2". In the case where the physical interface "Serial0 / 1 / 1" serves as the first physical interface and fails to connect to the network management device, the physical interface "Serial0 / 1 / 1" becomes the configured physical interface, and the physical interface to be configured of the network device changes to physical interface "Serial0 / 1 / 2".
[0096] Specifically, when the first physical interface of the network device fails to connect to the network management device, the network device checks whether there are any physical interfaces to be configured on the network device. If there are any physical interfaces to be configured on the network device, the network device selects a physical interface from the physical interfaces to be configured as the updated first physical interface, and configures the connection parameters on the updated first physical interface until the first physical interface is successfully connected to the network management device or there are no physical interfaces to be configured on the network device.
[0097] In an optional implementation, when the first physical interface fails to connect to the network management device, before the network device reselects a physical interface to be configured from the physical interfaces of the network device as the first physical interface, the network device clears the connection parameters configured in the first physical interface, so that the configuration of the physical interface as the first physical interface is cleared, and the connection parameters are avoided from being configured in multiple physical interfaces. Because the same configuration of multiple physical interfaces will cause configuration conflicts, the connection parameters configured in the first physical interface are cleared to prevent the network device from being unable to establish a connection with the network management device due to physical interface configuration conflicts.
[0098] Optionally, when the first physical interface fails to connect to the network management device and the network device does not have a physical interface to be configured, the network device determines that the connection parameter configuration has failed. Optionally, after the connection parameter configuration fails, the network device outputs an indication of the configuration failure, so that the installer determines that the connection parameter has failed and then verifies the connection parameters or verifies whether the physical interface is correctly connected.
[0099] In this embodiment, after obtaining the connection parameters, the network device repeatedly selects a physical interface from the physical interfaces to be configured as the first physical interface for establishing a connection with the network management device, and configures the connection parameters on the first physical interface until the first physical interface is successfully connected to the network management device or the network device does not have a physical interface to be configured. This eliminates the need for the installer of the network device to input connection parameters and interface identifiers multiple times, thereby reducing the installer's workload.
[0100] Figure 4 Another method for connecting a network device provided in an embodiment of the present application is applied to a scenario in which an installer installs a network device. In this scenario, the installer inputs connection parameters into the network device. The method may include:
[0101] 401. When it is detected that the installer inputs a connection parameter, the connection parameter is obtained.
[0102] After the network device detects that the installer inputs the connection parameters, it obtains the connection parameters. The network device detects that the installer inputs the connection parameters, which may be the network device receiving a connection parameter input request, such as receiving an instruction from the installer to request a connection parameter configuration page, or detecting that the installer submits a request for the connection parameters, such as detecting that the installer clicks a submit button. The network device obtains the connection parameters input by the installer. The connection parameters input by the installer are connection parameters that have never been configured and can be configured to all physical interfaces of the network device.
[0103] 402. Select a physical interface to be configured from the physical interfaces of the network device according to a first configuration sequence as a first physical interface.
[0104] The network device selects a physical interface to be configured from the physical interfaces of the network device according to the first configuration sequence as the first physical interface. The first configuration sequence is the configuration sequence of the physical interfaces of the network device when the connection parameters have not been configured. The first configuration sequence can be a preset configuration sequence, or it can be determined by the network device through the priority information of the physical interface. It is understandable that the connection parameters input by the installer are connection parameters that have never been configured and have not been configured to any physical interface by the network device.
[0105] Optionally, the network device determines the first configuration order according to the priority information of the physical interface, and the priority information is stored in the local storage module of the network device and the priority information includes the priority identifiers of all physical interfaces. The network device arranges the physical interfaces in order from high to low priority according to the priority identifiers of the physical interfaces to obtain the first configuration order. The priorities of the physical interfaces are divided according to the interface types of the physical interfaces or the numbers of the physical interfaces, for example, the priority of the wired interface is higher than the priority of the wireless interface, or the priority of the physical interface with a smaller number is higher than the priority of the physical interface with a larger number.
[0106] Among them, the first configuration order is the order in which all physical interfaces of the network device are arranged according to the interface type or the label of the physical interface. In some embodiments, the interface type is classified according to the maximum interface rate of the physical interface, for example, the interface type includes an E1 interface with an interface rate of 2 megabits per second, a standard Ethernet interface with an interface rate of 10 megabits per second, a fast Ethernet interface with an interface rate of 100 megabits per second, and a gigabit Ethernet interface with an interface rate of 1000 megabits per second. The first configuration order is the order in which all physical interfaces of the network device are arranged from fast to slow according to the interface rate. Since the rate of the uplink of the network device is usually greater than the rate of the downlink of the network device, the network management device, as the uplink device of the network device, will preferentially connect to the high-speed physical interface of the network device. According to the first configuration order, the high-speed physical interface is preferentially configured, which is conducive to improving the efficiency of the configuration. When the network device contains multiple physical interfaces with the same interface rate, the multiple physical interfaces are sorted according to the label, which can be in the order of the port number in the label from small to large, or in the order of the port number in the label from large to small. For example, the network device includes two Fast Ethernet interfaces: physical interface "FastEthernet0 / 0 / 1" and physical interface "FastEthernet0 / 0 / 2", and two Gigabit Ethernet interfaces: physical interface "GigabitEthernet0 / 1 / 1" and physical interface "GigabitEthernet0 / 1 / 2", then the first configuration order is physical interface "GigabitEthernet0 / 1 / 1", physical interface "GigabitEthernet0 / 1 / 2", physical interface "FastEthernet0 / 0 / 1" and physical interface "FastEthernet0 / 0 / 2". In the case that all physical interfaces of the network device have not been configured with the connection parameters, the network device preferentially selects physical interface "GigabitEthernet0 / 1 / 1" as the first physical interface. In other embodiments, the interface type includes a wired interface and a wireless interface, and the first configuration order is the order in which all physical interfaces of the network device are arranged from wired interface to wireless interface. When the network device includes multiple wired interfaces or wireless interfaces, the wired interfaces or wireless interfaces are sorted according to the labels, which can be in the order of the port numbers in the labels from small to large, or in the order of the port numbers in the labels from large to small. For example, in the first configuration sequence, the configuration sequence of the two wireless WLAN interfaces is the physical interface "Wlan-Radio1 / 0 / 1" and the physical interface "Wlan-Radio1 / 0 / 2".In some other embodiments, the first configuration order is the order in which all physical interfaces of the network device are arranged in sequence according to the labels. For example, the physical interfaces included in the network device are: physical interface "FastEthernet0 / 0 / 1", physical interface "FastEthernet0 / 0 / 2", physical interface "GigabitEthernet0 / 1 / 1" and physical interface "GigabitEthernet0 / 1 / 2", then the first configuration order is physical interface "FastEthernet0 / 0 / 1", physical interface "FastEthernet0 / 0 / 2", physical interface "GigabitEthernet0 / 1 / 1" and physical interface "GigabitEthernet0 / 1 / 2".
[0107] 403. Configure the connection parameter on the first physical interface.
[0108] The network device configures the connection parameter to a first physical interface of the network device, and attempts to establish a connection with the network management device using the first physical interface.
[0109] 404. When the first physical interface is successfully connected to the network management device, determine that the connection parameter configuration is successful.
[0110] The network device determines that the connection parameter configuration is successful when the first physical interface is successfully connected to the network management device.
[0111] Step 404 is similar to step 304 and will not be described again here.
[0112] 405. When the first physical interface fails to connect to the network management device, reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface until the first physical interface successfully connects to the network management device or there is no physical interface to be configured in the physical interfaces of the network device.
[0113] Optionally, in the case where the first physical interface fails to connect to the network management device, the network device reselects a physical interface to be configured from the physical interfaces of the network device according to the first configuration sequence as the updated first physical interface, and configures the connection parameters on the updated first physical interface until the first physical interface is successfully connected to the network management device or the network device does not have a physical interface to be configured. The network device reselects the physical interface to be configured that is arranged in the front of the first configuration sequence as the first physical interface according to the first configuration sequence. Specifically, in the case where the first physical interface fails to connect to the network management device, the network device checks whether there are still physical interfaces to be configured in the physical interfaces in the first configuration sequence. If there are still physical interfaces to be configured in the physical interfaces in the first configuration sequence, the network device selects the physical interface to be configured that is arranged in the front of the first configuration sequence as the first physical interface, as the updated first physical interface, and configures the connection parameters on the updated first physical interface until the first physical interface is successfully connected to the network management device or the network device does not have a physical interface to be configured. For example, the first configuration order is physical interface "GigabitEthernet0 / 1 / 1", physical interface "GigabitEthernet0 / 1 / 2", physical interface "FastEthernet0 / 0 / 1" and physical interface "FastEthernet0 / 0 / 2". When physical interface "GigabitEthernet0 / 1 / 1" fails to connect to the network management device as the first physical interface, the network device selects physical interface "GigabitEthernet0 / 1 / 2", physical interface "FastEthernet0 / 0 / 1" and physical interface "FastEthernet0 / 0 / 2" in sequence as the updated first physical interface, and configures the connection parameters on the updated first physical interface until the first physical interface is successfully connected to the network management device or physical interface "FastEthernet0 / 0 / 2" fails to connect to the network management device.
[0114] In this embodiment, after detecting that the installer has input connection parameters, the network device repeatedly selects a physical interface from the physical interfaces to be configured in a first configuration order as the first physical interface for establishing a connection with the network management device, and configures the connection parameters on the first physical interface until the first physical interface is successfully connected to the network management device or the network device does not have a physical interface to be configured. After detecting that the installer has input connection parameters, this embodiment can repeatedly configure the connection parameters to the physical interface of the network device in the first configuration order until the connection parameters are successfully configured, thereby reducing the workload of the installer and improving the configuration efficiency of the connection parameters.
[0115] Figure 5AAnother method for connecting a network device provided in an embodiment of the present application may include:
[0116] 501. When it is detected that the installer inputs connection parameters, the connection parameters and the interface identifier of the second physical interface are obtained.
[0117] The network device obtains connection parameters and an interface identifier of a second physical interface. The second physical interface is the highest priority physical interface of the network device, and the network device can configure the connection parameters preferentially on the second physical interface according to the interface identifier. In one optional implementation, the network device obtains the interface identifier input by the installer, and the second physical interface is a physical interface determined by the installer to be successfully connected to the network management device by wired or wireless means, for example, the installer of the network device determines that the second physical interface is connected to the network management device by a cable, or the installer of the network device determines that the second physical interface is a wireless interface that can be successfully connected to the network management device, such as an LTE interface or a WLAN interface. In another optional implementation, the network device obtains the interface identifier from the priority information stored locally, and the second physical interface is the physical interface with the highest priority specified in the network protocol. If the network device is connected to the network management device by a cable, the installer will preferentially connect the cable to the second physical interface.
[0118] like Figure 5B The connection parameter configuration interface shown is another example of a GUI. The network device can set connection interface options or input items in the connection parameter configuration interface. The connection interface options or input items are used by the installer of the network device to input the interface identifier. Figure 5B The interface identifier shown is "GigabitEthernet0 / 0 / 4", which indicates that the second physical interface is the physical interface "GigabitEthernet0 / 0 / 4". After obtaining the interface identifier, the network device preferentially configures the connection parameters to the physical interface "GigabitEthernet0 / 0 / 4".
[0119] 502. Select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface.
[0120] The network device may select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface according to the identifier of the second physical interface input by the installer. The network device may also select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface according to the interface identifier of the second physical interface when the priority information stored locally is the interface identifier of the second physical interface. For example, if the interface identifier is "FastEthernet0 / 0 / 1", the second physical interface is the physical interface "FastEthernet0 / 0 / 1", and the network device selects the Fast Ethernet port numbered 0 / 0 / 1 indicated by the interface identifier from all the physical interfaces to be configured. The network device configures the connection parameters to the second physical interface preferentially, which is conducive to reducing the number of configuration times of the connection parameters and improving the efficiency of the network device in configuring the connection parameters.
[0121] 503. Configure the connection parameters on the first physical interface.
[0122] 504. When the first physical interface is successfully connected to the network management device, determine that the connection parameter configuration is successful.
[0123] Steps 503-504 are similar to the above steps 303-304 and will not be described again here.
[0124] 505. When the first physical interface fails to connect to the network management device, reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured in the physical interfaces of the network device.
[0125] When the network device uses the second physical interface as the first physical interface and the second physical interface that serves as the first physical interface fails to connect to the network management device, the network device reselects a physical interface to be configured from the physical interfaces of the network device as the updated first physical interface until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device.
[0126] Optionally, when the network device uses the second physical interface as the first physical interface and the second physical interface as the first physical interface fails to connect to the network management device, if the locally stored priority information includes the priority levels of all physical interfaces, the network device reselects a physical interface from the physical interfaces to be configured of the network device according to the second configuration order as the updated first physical interface until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device. The second configuration order is used to indicate the configuration order of the physical interfaces of the network device except the second physical interface.
[0127] Among them, the second configuration order is determined by the network device according to the priority information stored locally. The network device determines the configuration order of the physical interfaces other than the second physical interface according to the priority identifier of the physical interface other than the second physical interface in the priority information, and obtains the second configuration order. The priority of the physical interface is divided according to the interface type or the label of the physical interface, so that the second configuration order is the order in which the physical interfaces other than the second physical interface are arranged according to the interface type or the label of the physical interface. In some embodiments, the interface type is classified according to the interface rate of the physical interface. For example, the interface type includes a standard Ethernet interface, a fast Ethernet interface, and a Gigabit Ethernet interface. The second configuration order is the order in which the physical interfaces of the network device other than the second physical interface are arranged from fast to slow according to the interface rate. Since the rate of the uplink link of the network device is usually greater than the rate of the downlink link of the network device, the network management device, as the uplink device of the network device, will give priority to connecting to the high-speed physical interface of the network device, which is conducive to improving the efficiency of configuring connection parameters. When the network device includes multiple physical interfaces of the same interface rate, the multiple physical interfaces are sorted according to the labels, which can be in the order of the port numbers in the labels from small to large, or in the order of the port numbers in the labels from large to small. For example, the network device includes the following physical interfaces: physical interface "FastEthernet0 / 0 / 1", physical interface "FastEthernet0 / 0 / 2", physical interface "GigabitEthernet0 / 1 / 1" and physical interface "GigabitEthernet0 / 1 / 2", and the second physical interface is the physical interface "GigabitEthernet0 / 1 / 2", then the second configuration order is the physical interface "GigabitEthernet0 / 1 / 1", the physical interface "FastEthernet0 / 0 / 1" and the physical interface "FastEthernet0 / 0 / 2". In some other embodiments, the interface type includes a wired interface and a wireless interface, and in other embodiments, the interface type includes a wired interface and a wireless interface, and the second configuration order is the order in which the physical interfaces of the network device other than the second physical interface are arranged from the wired interface to the wireless interface. When a network device includes multiple wired interfaces or wireless interfaces, the wired interfaces or wireless interfaces are sorted according to the labels, which can be in the order of the port numbers in the labels from small to large, or in the order of the port numbers in the labels from large to small. The network device usually gives priority to using the wired interface to establish a connection with the network management device, and the network device gives priority to configuring the connection parameters to the wired interface of the network device, which is conducive to improving the efficiency of configuring the connection parameters.In some other embodiments, the second configuration order is the order in which the physical interfaces of the network device except the second physical interface are arranged in sequence according to the labels, for example: the second physical interface is the physical interface "GigabitEthernet0 / 1 / 2", and the second configuration order is the physical interface "FastEthernet0 / 0 / 1", the physical interface "FastEthernet0 / 0 / 2" and the physical interface "GigabitEthernet0 / 1 / 1".
[0128] In this embodiment, the network device obtains the interface identifier input by the installer in addition to the connection parameters, and the network device preferentially configures the connection parameters to the second physical interface indicated by the interface identifier, which is conducive to improving the efficiency of configuring the connection parameters. In addition, if the second physical interface fails to connect to the network management device, the connection parameters are repeatedly configured to the physical interface of the network device in the second configuration order until the connection parameters are successfully configured or the network device does not have a physical interface to be configured, which reduces the workload of the installer and is conducive to orderly or rapid configuration of the connection parameters.
[0129] Figure 6 Another method for connecting a network device provided in an embodiment of the present application is applied to a scenario in which an installer installs a network device. The method may include:
[0130] 601. When it is detected that the installer inputs connection parameters, the connection parameters and the interface identification sequence input by the installer are obtained, and the order of the physical interfaces in the interface identification sequence is used as a first configuration order.
[0131] When the network device detects that the installer inputs the connection parameters, it obtains the connection parameters and the interface identification sequence input by the installer, and uses the order of the physical interfaces in the interface identification sequence as the first configuration order. The interface identification sequence input by the installer is used to instruct the network device to configure the connection parameters to the physical interfaces in the interface identification sequence in sequence according to the order of the physical interfaces in the interface identification sequence. For example, if the interface identification sequence is: "Ethernet0 / 0 / 1", "Ethernet0 / 0 / 2" and "FastEthernet0 / 1 / 1", the first configuration order is the physical interface "Ethernet0 / 0 / 1", the physical interface "Ethernet0 / 0 / 2" and the physical interface "FastEthernet0 / 1 / 1". The installer determines the possibility of each physical interface being connected to the network management device according to the wiring conditions of the physical interfaces of the network device, and thus determines the interface identification sequence according to the order of the possibility from large to small. The network device uses the order of the physical interfaces in the interface identification sequence as the first configuration order, which is conducive to quickly configuring the connection parameters to the physical interfaces connected to the network management device, thereby improving the configuration efficiency.
[0132] 602. Select a physical interface to be configured from the physical interfaces of the network device according to a first configuration sequence as a first physical interface.
[0133] After the network device uses the order of the physical interfaces in the interface identification sequence as the first configuration order, it selects a physical interface to be configured from the physical interfaces of the network device according to the first configuration order as the first physical interface. Specifically, the network device preferentially uses the physical interface to be configured that is arranged first in the interface identification sequence as the first physical interface. In the case that all physical interfaces indicated by the interface identification sequence have not been configured with connection parameters, the network device preferentially uses the physical interface indicated by the first interface identification in the interface identification sequence as the first physical interface.
[0134] 603. Configure the connection parameter on the first physical interface.
[0135] 604. When the first physical interface is successfully connected to the network management device, determine that the connection parameter configuration is successful.
[0136] 605. When the first physical interface fails to connect to the network management device, a physical interface to be configured is reselected from the physical interfaces of the network device according to the first configuration sequence as the first physical interface, until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured among the physical interfaces of the network device.
[0137] In this embodiment, in addition to the connection parameters, the network device also obtains the interface identification sequence input by the installer, and uses the interface identification sequence as the first configuration sequence. The physical interface of the network device is configured according to the first configuration sequence until the connection parameters are successfully configured or there is no physical interface to be configured on the network device. The first configuration sequence is determined by the possibility of the physical interface being connected to the network management device, which is conducive to quickly configuring the connection parameters to the physical interface connected to the network management device, thereby improving configuration efficiency.
[0138] Figure 7 Another method for connecting a network device provided in an embodiment of the present application is applied in a scenario where a third physical interface of the network device has established a connection with a network management device. The method may include:
[0139] 701. When it is detected that the third physical interface is disconnected from the network management device, obtain connection parameters configured on the third physical interface.
[0140] When the network device detects that the third physical interface is disconnected from the network management device, it obtains the connection parameters configured on the third physical interface. It is understandable that before the third physical interface of the network device is disconnected from the network management device, the third physical interface has established a connection with the network management device.
[0141] Among them, the network device can detect that the third physical interface is disconnected from the network management device through an interrupt message of the third physical interface, and the interrupt message is used to indicate that the third physical interface is disconnected from the network management device. For example, in the case where the network device is a router, the third physical interface is a WAN interface of the router. If the third physical interface is disconnected, an interrupt message of the WAN interface will be generated in the system log of the network device, such as "[SYSTEM]: WAN interface physical connection interrupted". The network device determines in a timely and effective manner that the third physical interface is disconnected from the network management device through the interrupt message of the third physical interface. The network device can also determine whether the third physical interface is disconnected from the network management device by periodically querying the connection status of the third physical interface to ensure that the disconnection of the third physical interface from the network management device is detected when the third physical interface is disconnected.
[0142] 702. Select a physical interface to be configured from the physical interfaces of the network device according to a third configuration sequence as a first physical interface.
[0143] The network device selects a physical interface to be configured from the physical interfaces of the network device according to the third configuration sequence as the first physical interface. It is understandable that the physical interfaces to be configured of the network device do not include the third physical interface. The third configuration sequence is the configuration sequence of the physical interfaces of the network device other than the third physical interface when the third physical interface is disconnected from the network management device.
[0144] The third configuration order is determined by the network device according to local priority information, or is input by the installer. The installer can input the third configuration order after the configuration of the third physical interface is completed, or can input the third configuration order when the third physical interface is disconnected from the network management device. The third configuration order is the order in which the physical interfaces other than the third physical interface are arranged according to the interface type or the label of the physical interface. In the case where the third configuration order is determined by the network device according to local priority information, the priority information includes the priority levels of all physical interfaces of the network device. The network device sorts the physical interfaces other than the third physical interface according to the priority levels of the physical interfaces other than the third physical interface to obtain the third configuration order. The specific implementation principle of the third configuration order is described above. Figure 5A The implementation principle and description of arranging the physical interfaces other than the second physical interface according to the interface type or the label of the physical interface shown in step 504 of the embodiment are the same. The second configuration order is the configuration order of the physical interfaces after excluding the second physical interface, and the third configuration order is the configuration order of the physical interfaces after excluding the third physical interface. The specific description of the third configuration order is not repeated here.
[0145] 703. Configure the connection parameter to a first physical interface of the network device.
[0146] The network device configures the connection parameter to the first physical interface of the network device. It should be noted that, in this embodiment, the first physical interface is a physical interface of the network device other than the third physical interface.
[0147] 704. When the first physical interface is successfully connected to the network management device, determine that the connection parameter configuration is successful.
[0148] 705. When the first physical interface fails to connect to the network management device, reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured in the physical interfaces of the network device.
[0149] Optionally, when the network device fails to connect to the network management device through the first physical interface, the network device reselects a physical interface from the physical interfaces to be configured of the network device as the updated first physical interface according to the third configuration sequence, until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured among the physical interfaces of the network device. The third configuration sequence is used to indicate the configuration sequence of the physical interfaces of the network device except the third physical interface. Selecting the physical interface to be configured from the physical interfaces of the network device according to the third configuration sequence as the updated first physical interface is conducive to orderly configuration of connection parameters.
[0150] In this embodiment, when the third physical interface that has established a connection with the network management device is disconnected, the network device obtains the connection parameters configured on the third physical interface, and repeatedly configures the connection parameters to the physical interfaces of the network device other than the third physical interface until the connection parameters are successfully configured or the network device has no physical interfaces to be configured. In this way, when the third physical interface is disconnected, the network device searches for other physical interfaces to connect to the network management device. When the third physical interface is disconnected, the installer does not need to participate in the connection parameter configuration process, further reducing the installer's workload.
[0151] Figure 8 A network device is provided in an embodiment of the present application. The network device corresponds to the above Figure 3A , Figure 4 , Figure 5A , Figure 6 or Figure 7 Network devices in. Figure 8 As shown, the network device includes:
[0152] The acquisition unit 801 is used to acquire connection parameters, which are used to establish a connection with the network management device. For specific implementation methods, please refer to the above Figure 3A A detailed description of step 301 in the illustrated embodiment, Figure 4 A detailed description of step 401 in the illustrated embodiment, Figure 5A A detailed description of step 501 in the illustrated embodiment, Figure 6 A detailed description of step 601 in the illustrated embodiment or Figure 7 The detailed description of step 701 in the embodiment is not repeated here.
[0153] The selection unit 802 is used to select a physical interface to be configured from the physical interfaces of the network device as the first physical interface, and the physical interface to be configured is a physical interface that has not been configured with the connection parameters after the connection parameters are obtained; please refer to the above for specific implementation methods Figure 3A A detailed description of step 302 in the illustrated embodiment, Figure 4 A detailed description of step 402 in the illustrated embodiment, Figure 5A A detailed description of step 502 in the illustrated embodiment, Figure 6 A detailed description of step 602 in the illustrated embodiment or Figure 7 The detailed description of step 702 in the embodiment is not repeated here.
[0154] Configuration unit 803, used to configure the connection parameters on the first physical interface, the specific implementation method is referred to above Figure 3A The detailed description of step 303 in the illustrated embodiment, Figure 4 A detailed description of step 403 in the illustrated embodiment, Figure 5A A detailed description of step 503 in the illustrated embodiment, Figure 6 A detailed description of step 603 in the illustrated embodiment or Figure 7 The detailed description of step 703 in the embodiment is not repeated here.
[0155] The determining unit 804 is used to determine that the connection parameter configuration is successful when the first physical interface is successfully connected to the network management device. For specific implementation methods, please refer to the above Figure 3A A detailed description of step 304 in the illustrated embodiment, Figure 4 A detailed description of step 404 in the illustrated embodiment, Figure 5A A detailed description of step 504 in the illustrated embodiment, Figure 6 A detailed description of step 604 in the illustrated embodiment or Figure 7 The detailed description of step 704 in the embodiment is not repeated here.
[0156] The selection unit 802 is also used to reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface when the first physical interface fails to connect to the network management device, until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured in the physical interfaces of the network device. For specific implementation methods, please refer to the above Figure 3A A detailed description of step 305 in the illustrated embodiment, Figure 4 A detailed description of step 405 in the illustrated embodiment, Figure 5A A detailed description of step 505 in the illustrated embodiment, Figure 6 A detailed description of step 605 in the illustrated embodiment or Figure 7 The detailed description of step 705 in the embodiment is not repeated here.
[0157] In an optional implementation, the acquisition unit 801 is specifically configured to: acquire the connection parameter when it is detected that the installer of the network device inputs the connection parameter. Figure 4 A detailed description of step 401 in the illustrated embodiment, Figure 5A A detailed description of step 501 in the illustrated embodiment, or Figure 6 The detailed description of step 601 in the illustrated embodiment will not be repeated here.
[0158] In an optional implementation, the selection unit 802 is specifically configured to: select a physical interface to be configured from the physical interfaces of the network device according to a first configuration sequence, wherein the first configuration sequence is a configuration sequence of the physical interfaces of the network device when the connection parameters have not been configured. Figure 4 A detailed description of step 402 in the illustrated embodiment, or Figure 6 The detailed description of step 602 in the embodiment is not repeated here.
[0159] In an optional implementation, the acquisition unit 801 is further used to: acquire the interface identification sequence input by the installer, and use the order of the physical interfaces in the interface identification sequence as the first configuration order. Figure 6 The detailed description of step 601 in the embodiment is not repeated here.
[0160] The acquisition unit is further used for: the determination unit 804 is further used for: determining the first configuration order according to the priority information of the physical interface, and the priority information is stored in the local storage module. For specific implementation methods, please refer to the above Figure 4 The detailed description of step 402 in the embodiment is not repeated here.
[0161] In an optional implementation, the selection unit 802 is specifically configured to: when the locally stored priority information is the interface identifier of the second physical interface, select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface. Figure 5A The detailed description of step 502 in the illustrated embodiment will not be repeated here.
[0162] In an optional implementation, the acquisition unit is further used to acquire the interface identifier of the second physical interface input by the installer. For a specific implementation, please refer to the above Figure 5A The detailed description of step 501 in the embodiment shown is not repeated here. The selection unit 802 is specifically used to: select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface according to the interface identifier of the second physical interface. For specific implementation methods, please refer to the above Figure 5A The detailed description of step 502 in the illustrated embodiment will not be repeated here.
[0163] In an optional implementation, the selection unit 802 is further specifically used to: reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface according to the second configuration sequence, and the second configuration sequence is the configuration sequence of the physical interfaces of the network device other than the second physical interface when the connection parameters include the interface identifier. For specific implementation, please refer to the above Figure 5A The detailed description of step 505 in the illustrated embodiment will not be repeated here.
[0164] In an optional implementation, the acquisition unit 801 is specifically used to: when detecting that the third physical interface is disconnected from the network management device, acquire the connection parameters configured on the third physical interface, where the third physical interface is a physical interface that the network device has successfully connected to the network management device. For a specific implementation, please refer to the above Figure 7 The detailed description of step 701 in the embodiment is not repeated here.
[0165] In an optional implementation, the selection unit 802 is specifically used to: select a physical interface to be configured from the physical interfaces of the network device according to a third configuration sequence, and the third configuration sequence is the configuration sequence of the physical interfaces of the network device other than the third physical interface when the third physical interface is disconnected from the network management device. For specific implementation, please refer to the above Figure 6 The detailed description of step 602 in the embodiment is not repeated here.
[0166] In an optional implementation, the third configuration order is input by the installer or determined according to the priority information of the physical interface, and the priority information is stored in the local storage module. Figure 7 The detailed description of step 702 in the embodiment is not repeated here.
[0167] In an optional implementation, the network device further includes: a clearing unit 805, configured to clear the connection parameters configured on the first physical interface. Figure 3A The detailed description of step 305 in the embodiment is not repeated here.
[0168] In an optional implementation, the determining unit 804 is further configured to determine that the connection parameter configuration fails when the first physical interface fails to connect to the network management device and the network device does not have a physical interface to be configured. Figure 3A The detailed description of step 305 in the embodiment is not repeated here.
[0169] Fig. 9 A schematic diagram of the structure of a network device provided in an embodiment of the present application. Fig. 9 As shown, the network device 90 includes a processor 901, a memory 902 and a communication interface 903; the processor 901, the memory 902 and the communication interface 903 are interconnected via a bus. Fig. 9 The network devices in can be Figure 3A , Figure 4 , Figure 5A , Figure 6 or Figure 7 Network devices in.
[0170] The memory 902 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CDROM), and is used for related instructions and data. The communication interface 903 is used to receive and send data.
[0171] The processor 901 may be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC) or one or more integrated circuits for executing relevant programs to implement the aforementioned Figure 3A , Figure 4 , Figure 5A , Figure 6 or Figure 7 The illustrated embodiment provides a connection method for any network device.
[0172] The processor is used to execute the program in the memory, prompting the network device to perform the following processing:
[0173] Get connection parameters, which are used to establish a connection with a network management device;
[0174] Selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface, the physical interface to be configured being a physical interface for which connection parameters have not been configured after the connection parameters are acquired, and the first physical interface is used to establish a connection with the network management device;
[0175] configuring connection parameters on the first physical interface;
[0176] In the case where the first physical interface is successfully connected to the network management device, determining that the connection parameter configuration is successful;
[0177] When the first physical interface fails to connect to the network management device, a physical interface to be configured is reselected from the physical interfaces of the network device as the first physical interface until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured in the physical interfaces of the network device.
[0178] For the specific process of implementing the above processing, please refer to Figure 3A In the illustrated embodiment, steps 301-305 are Figure 4 In the illustrated embodiment, steps 401-405, Figure 5A In the illustrated embodiment, steps 501-505 are Figure 6 Steps 601-605 and Figure 7 The detailed description of steps 701-705 in the embodiment is not repeated here.
[0179] In addition, in the above Figure 8In the illustrated embodiment, each unit, such as the acquisition unit 801, the selection unit 802, the configuration unit 803, the determination unit 804, and the clearing unit 805 is a software module. The memory 902 stores these software modules, and the processor 901 executes these software modules to implement the above Figure 3A , Figure 4 , Figure 5A , Figure 6 or Figure 7 Functions and steps of the network devices in the illustrated embodiment.
[0180] The processor 901 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the connection method of the network device of the present application may be completed by an integrated logic circuit of hardware or software instructions in the processor 901. The above-mentioned processor 901 may also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 902, and the processor 901 reads the information in the memory 902 and completes the network device connection method provided in the embodiment of the present application in combination with its hardware.
[0181] The communication interface 903 uses a transceiver such as, but not limited to, a transceiver to implement communication between the electronic device 90 and other devices or a communication network. The bus 904 may include a path for transmitting information between various components of the electronic device 90 (e.g., the memory 902, the processor 901, and the communication interface 903).
[0182] The processor 901 in the electronic device 90 is used to read the program code stored in the memory 902 to implement the network device connection method provided in the above embodiment.
[0183] In an embodiment of the present application, a readable storage medium is provided, and the computer-readable storage medium stores a computer program, which, when executed by a processor, implements: obtaining connection parameters, the connection parameters are used to establish a connection with a network management device; selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface, the physical interface to be configured is a physical interface that has not been configured with the connection parameters after the connection parameters are obtained; configuring the connection parameters on the first physical interface; determining that the connection parameters are successfully configured if the first physical interface is successfully connected to the network management device; and reselecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface if the first physical interface fails to connect to the network management device, until the first physical interface is successfully connected to the network management device or there is no physical interface to be configured among the physical interfaces of the network device.
[0184] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for connecting a network device, characterized in that: include: Acquire connection parameters, where the connection parameters are used to establish a connection with a network management device; Selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface, the physical interface to be configured being a physical interface that has not been configured with the connection parameters after the connection parameters are acquired, and the first physical interface is used to establish a connection with the network management device; configuring the connection parameters on the first physical interface; In the case where the first physical interface is successfully connected to the network management device, determining that the connection parameter configuration is successful; In the event that the first physical interface fails to connect to the network management device, a physical interface to be configured is reselected from the physical interfaces of the network device as the first physical interface until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device.
2. The method according to claim 1, characterized in that: The obtaining of connection parameters includes: In the case where it is detected that an installer of the network device inputs the connection parameter, the connection parameter is acquired.
3. The method according to claim 2, characterized in that: The step of selecting a physical interface to be configured from the physical interfaces of the network device comprises: A physical interface to be configured is selected from the physical interfaces of the network device according to a first configuration sequence, wherein the first configuration sequence is a configuration sequence of the physical interfaces of the network device when the connection parameters have not been configured.
4. The method according to claim 3, characterized in that: Before selecting a physical interface to be configured from the physical interfaces of the network device according to the first configuration order, the method further includes: The interface identification sequence input by the installer is obtained, and the order of the physical interfaces in the interface identification sequence is used as the first configuration order.
5. The method according to claim 3, characterized in that: The method further comprises: The first configuration order is determined according to locally stored priority information, where the priority information includes priority levels for configuring the connection parameters on all physical interfaces of the network device.
6. The method according to claim 2, characterized in that: The step of selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface includes: In a case where the locally stored priority information is the interface identifier of the second physical interface, the second physical interface is selected from the physical interfaces to be configured of the network device as the first physical interface.
7. The method according to claim 2, characterized in that: The method further comprises: Obtaining an interface identifier of a second physical interface input by the installer; The step of selecting a physical interface to be configured from the physical interfaces of the network device as a first physical interface includes: According to the interface identifier of the second physical interface, the second physical interface is selected from the physical interfaces to be configured of the network device as the first physical interface.
8. The method according to claim 7, characterized in that: The reselecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface includes: According to the second configuration order, a physical interface to be configured is reselected from the physical interfaces of the network device as the first physical interface. The second configuration order is the configuration order of the physical interfaces of the network device except the second physical interface when the interface identifier is obtained.
9. The method according to claim 8, characterized in that: The method further comprises: The second configuration order is determined according to locally stored priority information, wherein the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
10. The method according to claim 1, characterized in that: The obtaining of connection parameters includes: When it is detected that the third physical interface of the network device is disconnected from the network management device, the connection parameters configured on the third physical interface are obtained, and the third physical interface is a physical interface that the network device has successfully connected to the network management device before the disconnection.
11. The method according to claim 10, characterized in that: The step of selecting a physical interface to be configured from the physical interfaces of the network device comprises: A physical interface to be configured is selected from the physical interfaces of the network device according to a third configuration sequence, wherein the third configuration sequence is the configuration sequence of the physical interfaces of the network device except the third physical interface when the third physical interface is disconnected from the network management device.
12. The method according to claim 11, characterized in that: The third configuration sequence is input by an installer or determined based on priority information stored locally, wherein the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
13. The method according to claim 1, characterized in that: In the case where the first physical interface fails to connect to the network management device, before reselecting a physical interface to be configured from the physical interfaces of the network device as the first physical interface, the method further includes: The connection parameters configured on the first physical interface are cleared.
14. The method according to any one of claims 1 to 13, characterized in that The method further comprises: When the first physical interface fails to connect to the network management device and the network device does not have the physical interface to be configured, it is determined that the connection parameter configuration fails.
15. A network device, characterized in that: include: An acquisition unit, used to acquire connection parameters, where the connection parameters are used to establish a connection with a network management device; A selection unit, configured to select a physical interface to be configured from the physical interfaces of the network device as a first physical interface, wherein the physical interface to be configured is a physical interface for which the connection parameters have not been configured after the connection parameters are acquired; a configuration unit, configured to configure the connection parameters on the first physical interface; a determining unit, configured to determine that the connection parameter configuration is successful when the first physical interface is successfully connected to the network management device; The selection unit is also used to reselect a physical interface to be configured from the physical interfaces of the network device as the first physical interface when the first physical interface fails to connect to the network management device, until the first physical interface is successfully connected to the network management device or the physical interface to be configured does not exist in the physical interfaces of the network device.
16. The network device according to claim 15, characterized in that: The acquisition unit is specifically used for: In the case where it is detected that an installer of the network device inputs the connection parameter, the connection parameter is acquired.
17. The network device according to claim 16, characterized in that: The selection unit is specifically used for: A physical interface to be configured is selected from the physical interfaces of the network device according to a first configuration sequence, wherein the first configuration sequence is a configuration sequence of the physical interfaces of the network device when the connection parameters have not been configured.
18. The network device according to claim 17, characterized in that: The acquisition unit is further used to: acquire an interface identification sequence input by the installer, and use the order of the physical interfaces in the interface identification sequence as the first configuration order.
19. The network device according to claim 17, characterized in that: The determining unit is further used to: determine the first configuration order according to priority information of the physical interface, and the priority information is stored in the local storage module.
20. The network device according to claim 16, characterized in that: The selection unit is specifically configured to: when the priority information stored locally is the interface identifier of the second physical interface, select the second physical interface from the physical interfaces to be configured of the network device as the first physical interface.
21. The network device according to claim 16, characterized in that: The acquisition unit is further used to acquire an interface identifier input by the installer, where the interface identifier is used to indicate a second physical interface of the network device; The selection unit is specifically configured to select, according to the interface identifier, the second physical interface from the physical interfaces to be configured of the network device as the first physical interface.
22. The network device according to claim 21, characterized in that: The selection unit is further specifically used for: According to the second configuration order, a physical interface to be configured is reselected from the physical interfaces of the network device as the first physical interface. The second configuration order is the configuration order of the physical interfaces of the network device except the second physical interface when the interface identifier is obtained.
23. The network device according to claim 22, characterized in that: The determining unit is further used to determine the second configuration order according to locally stored priority information, wherein the priority information includes priority levels of all physical interfaces of the network device for configuring the connection parameters.
24. The network device according to claim 15, characterized in that: The acquisition unit is specifically used for: When it is detected that the third physical interface is disconnected from the network management device, the connection parameters configured on the third physical interface are obtained, and the third physical interface is a physical interface that the network device has successfully connected to the network management device before the disconnection.
25. The network device according to claim 24, characterized in that: The selection unit is specifically used for: A physical interface to be configured is selected from the physical interfaces of the network device according to a third configuration sequence, wherein the third configuration sequence is the configuration sequence of the physical interfaces of the network device except the third physical interface when the third physical interface is disconnected from the network management device.
26. The network device according to claim 25, characterized in that: The third configuration sequence is input by an installer or determined based on priority information stored locally, wherein the priority information includes priority levels for configuring the connection parameters of all physical interfaces of the network device.
27. The network device according to claim 15, characterized in that: The network device also includes: The clearing unit is used to clear the connection parameters configured on the first physical interface.
28. The network device according to any one of claims 15 to 27, characterized in that: The determining unit is further configured to determine that the connection parameter configuration fails when the first physical interface fails to connect to the network management device and the network device does not have the physical interface to be configured.
29. A network device, characterized in that: It comprises a memory and a processor; the memory is used to store a program; the processor is used to execute the program stored in the memory, and when the program is executed, the network device executes the method according to any one of claims 1 to 14.
30. A network system, characterized in that: It comprises a network device and a network management device; the network device is used to execute the method according to any one of claims 1 to 14.
31. A readable storage medium, characterized in that: Used to store instructions, when the instructions are executed, the method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Port configuration method of interface expansion equipment and apparatus thereof
CN107645391A
Internet access location method and network device applying same
CN109120440A