CN109819059B - Method, device, equipment and storage medium for managing network equipment - Google Patents
Method, device, equipment and storage medium for managing network equipment Download PDFInfo
- Publication number
- CN109819059B CN109819059B CN201711162908.2A CN201711162908A CN109819059B CN 109819059 B CN109819059 B CN 109819059B CN 201711162908 A CN201711162908 A CN 201711162908A CN 109819059 B CN109819059 B CN 109819059B
- Authority
- CN
- China
- Prior art keywords
- address
- network device
- domain name
- network
- management
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
提供了一种管理网络设备的方法、装置、设备及存储介质。所述方法包括:管理设备探测地址池中的至少一个网际协议IP地址以确定已被使用的IP地址;所述管理设备基于所述已被使用的IP地址,用管理协议从使用所述已被使用的IP地址的网络设备获取所述网络设备的域名;所述管理设备根据所述域名,管理所述网络设备。本公开中网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,管理设备基于已被使用的IP地址获取该网络设备的域名,并根据域名而不是IP地址管理网络设备。由于网络设备的域名不变,管理设备对网络设备的管理不受网络设备的IP地址变化的影响。
Provided are a method, apparatus, device and storage medium for managing network equipment. The method includes: a management device probes at least one Internet Protocol IP address in the address pool to determine an IP address that has been used; the management device uses a management protocol from using the used IP address based on the used IP address The network device using the IP address obtains the domain name of the network device; the management device manages the network device according to the domain name. In the present disclosure, after the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the management device acquires the domain name of the network device based on the IP address that has been used, and manages the network device based on the domain name instead of the IP address. Since the domain name of the network device remains unchanged, the management of the network device by the management device is not affected by the change of the IP address of the network device.
Description
技术领域technical field
本公开涉及无线通信技术领域,特别涉及一种管理网络设备的方法、装置、设备及存储介质。The present disclosure relates to the field of wireless communication technologies, and in particular, to a method, apparatus, device, and storage medium for managing network devices.
背景技术Background technique
在传统的网络管理系统中,网络管理系统中的网络设备的网际协议(英文:Internet Protocol,IP)地址是静态分配的,并且用户在管理设备中手动添加网络设备的静态IP地址。管理设备通过该网络设备的IP地址对该网络设备进行管理。然而随着技术的发展,逐渐兴起了云管理系统,云管理系统中的动态主机配置协议(英文:Dynamic HostConfiguration Protocol,DHCP)服务器为云管理系统中的网络设备动态分配IP地址。由于现有传统网络设备存量较大,而云管理属于新的网络管理架构,会存在混合组网和混合管理的场景。在混合组网和混合管理的场景下,管理设备不能管理云管理系统中的网络设备。In a traditional network management system, the Internet Protocol (English: Internet Protocol, IP) addresses of network devices in the network management system are statically allocated, and the user manually adds the static IP addresses of the network devices in the management device. The management device manages the network device through the IP address of the network device. However, with the development of technology, a cloud management system has gradually emerged, and a Dynamic Host Configuration Protocol (English: Dynamic Host Configuration Protocol, DHCP) server in the cloud management system dynamically assigns IP addresses to network devices in the cloud management system. Due to the large stock of existing traditional network devices, and cloud management is a new network management architecture, there will be scenarios of hybrid networking and hybrid management. In hybrid networking and hybrid management scenarios, management devices cannot manage network devices in the cloud management system.
发明内容SUMMARY OF THE INVENTION
本公开提供了一种管理网络设备的方法、装置、设备及存储介质,可以实现管理设备对动态获取IP地址的网络设备的管理。所述技术方案如下:The present disclosure provides a method, apparatus, device and storage medium for managing network equipment, which can realize the management of network equipment that dynamically obtains IP addresses by the management equipment. The technical solution is as follows:
第一方面,本公开提供了一种管理网络设备的方法,所述方法包括:In a first aspect, the present disclosure provides a method for managing network devices, the method comprising:
管理设备探测地址池中的至少一个网际协议IP地址以确定已被使用的IP地址;The management device detects at least one Internet Protocol IP address in the address pool to determine the IP address that has been used;
所述管理设备基于所述已被使用的IP地址,用管理协议从使用所述已被使用的IP地址的网络设备获取所述网络设备的域名;The management device obtains the domain name of the network device from the network device using the used IP address by using a management protocol based on the used IP address;
所述管理设备根据所述域名,管理所述网络设备。The management device manages the network device according to the domain name.
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,管理设备基于已被使用的IP地址获取该网络设备的域名,并根据域名而不是IP地址管理网络设备。由于网络设备的域名不变,管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the management device acquires the domain name of the network device based on the IP address that has been used, and manages the network device based on the domain name instead of the IP address. Since the domain name of the network device remains unchanged, the management of the network device by the management device is not affected by the change of the IP address of the network device.
在一个可能的实现方式中,所述管理设备探测地址池中的至少一个网际协议IP地址以确定已被使用的IP地址之前,所述方法还包括:In a possible implementation manner, before the management device detects at least one Internet Protocol IP address in the address pool to determine the IP address that has been used, the method further includes:
所述管理设备检测到网络拓扑改变。The management device detects a network topology change.
管理设备在检测到网络拓扑改变时,才探测地址池中的至少一个IP地址以确定已被使用的IP地址,从而不需要实时探测,节省了网络资源。The management device detects at least one IP address in the address pool to determine the IP address that has been used until it detects a change in the network topology, so that real-time detection is not required and network resources are saved.
在一个可能的实现方式中,所述根据所述域名,管理所述网络设备包括:In a possible implementation manner, the managing the network device according to the domain name includes:
当所述管理设备与所述网络设备通信前,所述管理设备向域名服务器查询所述网络设备的域名;Before the management device communicates with the network device, the management device queries the domain name server for the domain name of the network device;
所述管理设备接收所述域名服务器回答的所述域名对应的新IP地址;receiving, by the management device, a new IP address corresponding to the domain name answered by the domain name server;
所述管理设备基于所述新IP地址,与所述网络设备通信。The management device communicates with the network device based on the new IP address.
管理设备在与网络设备通信前,管理设备从域名服务器中解析出该网络设备的新IP地址,基于该新IP地址,与该网络设备通信,从而提高了通信的准确性。Before the management device communicates with the network device, the management device resolves the new IP address of the network device from the domain name server, and communicates with the network device based on the new IP address, thereby improving the accuracy of communication.
第二方面,本公开提供了一种管理网络设备的方法,所述方法包括:In a second aspect, the present disclosure provides a method for managing network devices, the method comprising:
云管理器接收网络设备发送的包括所述网络设备的网际协议IP地址的注册请求;The cloud manager receives the registration request sent by the network device and includes the Internet Protocol IP address of the network device;
在所述网络设备完成注册后,所述云管理器为所述网络设备分配域名;After the network device completes the registration, the cloud manager assigns a domain name to the network device;
所述云管理器向域名服务器发送所述网络设备的域名和所述网络设备的IP地址的对应关系。The cloud manager sends the corresponding relationship between the domain name of the network device and the IP address of the network device to the domain name server.
因此,云管理器向域名服务器发送其管理的网络设备的域名及对应的IP地址,从而使管理设备能根据网络设备的域名管理网络设备。Therefore, the cloud manager sends the domain name and corresponding IP address of the network device managed by the cloud manager to the domain name server, so that the management device can manage the network device according to the domain name of the network device.
在一个可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
所述云管理器接收所述网络设备的包括所述网络设备的新IP地址和所述域名的新注册请求;所述云管理器向所述域名服务器发送所述网络设备的域名和所述网络设备的新IP地址的对应关系。The cloud manager receives a new registration request of the network device including the new IP address of the network device and the domain name; the cloud manager sends the domain name of the network device and the network to the domain name server The correspondence between the new IP address of the device.
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,云管理器更新域名服务器中与其域名对应的IP 地址。从而使管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the cloud manager updates the IP address corresponding to its domain name in the domain name server. Therefore, the management of the network device by the management device is not affected by the change of the IP address of the network device.
第三方面,本公开提供了一种管理网络设备的方法,所述方法包括:In a third aspect, the present disclosure provides a method for managing network devices, the method comprising:
网络设备向云管理器发送包括所述网络设备的网际协议IP地址的注册请求;The network device sends a registration request including the Internet Protocol IP address of the network device to the cloud manager;
在所述网络设备完成注册后,所述网络设备接收所述云管理器为所述网络设备分配的域名;After the network device completes the registration, the network device receives the domain name assigned by the cloud manager to the network device;
所述网络设备的IP地址变化时,所述网络设备向所述云管理器发送新IP地址。When the IP address of the network device changes, the network device sends a new IP address to the cloud manager.
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。当该网络设备的IP地址变化时,该网络设备向该云管理器发送新IP地址,以便于云管理器更新域名服务器中与该网络设备的域名对应的IP地址。从而使管理设备对网络设备的管理不受网络设备的IP地址变化的影响。。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. When the IP address of the network device changes, the network device sends a new IP address to the cloud manager, so that the cloud manager can update the IP address corresponding to the domain name of the network device in the domain name server. Therefore, the management of the network device by the management device is not affected by the change of the IP address of the network device. .
第四方面,本公开提供了一种管理网络设备的装置,所述装置包括:In a fourth aspect, the present disclosure provides an apparatus for managing network equipment, the apparatus comprising:
探测模块,用于探测地址池中的至少一个网际协议IP地址以确定已被使用的IP地址;A detection module for detecting at least one Internet Protocol IP address in the address pool to determine the IP address that has been used;
获取模块,用于基于所述已被使用的IP地址,用管理协议从使用所述已被使用的IP地址的网络设备获取所述网络设备的域名;an obtaining module, configured to obtain the domain name of the network device from the network device using the used IP address with a management protocol based on the used IP address;
管理模块,用于根据所述域名,管理所述网络设备。A management module, configured to manage the network device according to the domain name.
在一个可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
检测模块,用于检测到网络拓扑改变。The detection module is used to detect the change of the network topology.
在一个可能的实现方式中,所述管理模块,还用于当所述管理设备与所述网络设备通信前,向域名服务器查询所述网络设备的域名;接收所述域名服务器回答的所述域名对应的新 IP地址;基于所述新IP地址,与所述网络设备通信。In a possible implementation manner, the management module is further configured to query the domain name server for the domain name of the network device before the management device communicates with the network device; receive the domain name answered by the domain name server A corresponding new IP address; based on the new IP address, communicate with the network device.
第五方面,本公开提供了一种管理网络设备的装置,所述装置包括:In a fifth aspect, the present disclosure provides an apparatus for managing network equipment, the apparatus comprising:
第一接收模块,用于接收网络设备发送的包括所述网络设备的网际协议IP地址的注册请求;a first receiving module, configured to receive a registration request sent by a network device including the Internet Protocol IP address of the network device;
分配模块,用于在所述网络设备完成注册后,为所述网络设备分配域名;an allocation module, configured to allocate a domain name to the network device after the network device completes the registration;
第一发送模块,用于向域名服务器发送所述网络设备的域名和所述网络设备的IP地址的对应关系。The first sending module is configured to send the correspondence between the domain name of the network device and the IP address of the network device to the domain name server.
在一个可能的实现方式中,所述第一接收模块,还用于接收所述网络设备的包括所述网络设备的新IP地址和所述域名的新注册请求;In a possible implementation manner, the first receiving module is further configured to receive a new registration request from the network device including the new IP address of the network device and the domain name;
所述第一发送模块,还用于向所述域名服务器发送所述网络设备的域名和所述网络设备的新IP地址的对应关系。The first sending module is further configured to send the corresponding relationship between the domain name of the network device and the new IP address of the network device to the domain name server.
第六方面,本公开提供了一种管理网络设备的装置,所述装置包括:In a sixth aspect, the present disclosure provides an apparatus for managing network equipment, the apparatus comprising:
第二发送模块,用于向云管理器发送包括所述网络设备的网际协议IP地址的注册请求;A second sending module, configured to send a registration request including the Internet Protocol IP address of the network device to the cloud manager;
第二接收模块,用于在所述网络设备完成注册后,接收所述云管理器为所述网络设备分配的域名;a second receiving module, configured to receive the domain name allocated by the cloud manager for the network device after the network device completes the registration;
所述第二发送模块,还用于所述网络设备的IP地址变化时,向所述云管理器发送新IP 地址。The second sending module is further configured to send a new IP address to the cloud manager when the IP address of the network device changes.
第七方面,本公开提供了一种管理设备,所述管理设备包括:收发器、存储器、处理器;In a seventh aspect, the present disclosure provides a management device, the management device comprising: a transceiver, a memory, and a processor;
所述收发器用于接收报文;the transceiver is used for receiving messages;
所述存储器用于存储指令和数据;the memory is used to store instructions and data;
所述处理器,用于读取所述存储器中存储的指令和数据,以执行第一方面任一可能的实现方式所述的管理网络设备的方法。The processor is configured to read the instructions and data stored in the memory to execute the method for managing a network device described in any possible implementation manner of the first aspect.
第八方面,本公开提供了一种云管理器,所述云管理器包括:收发器、存储器、处理器;In an eighth aspect, the present disclosure provides a cloud manager, the cloud manager comprising: a transceiver, a memory, and a processor;
所述收发器用于接收报文;the transceiver is used for receiving messages;
所述存储器用于存储指令和数据;the memory is used to store instructions and data;
所述处理器,用于读取所述存储器中存储的指令和数据,以执行第二方面任一可能的实现方式所述的管理网络设备的方法。The processor is configured to read the instructions and data stored in the memory to execute the method for managing a network device described in any possible implementation manner of the second aspect.
第九方面,本公开提供了一种网络设备,所述网络设备包括:收发器、存储器、处理器;In a ninth aspect, the present disclosure provides a network device, the network device comprising: a transceiver, a memory, and a processor;
所述收发器用于接收报文;the transceiver is used for receiving messages;
所述存储器用于存储指令和数据;the memory is used to store instructions and data;
所述处理器,用于读取所述存储器中存储的指令和数据,以执行第三方面所述的管理网络设备的方法。The processor is configured to read the instructions and data stored in the memory to execute the method for managing a network device described in the third aspect.
第十方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述程序被处理器执行时实现第一方面任一可能的实现方式所述的管理网络设备的方法。In a tenth aspect, the present disclosure provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, any possible implementation manner of the first aspect is implemented. A method of managing network devices.
第十一方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述程序被处理器执行时实现第二方面任一可能的实现方式所述的管理网络设备的方法。In an eleventh aspect, the present disclosure provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, any possible implementation manner of the second aspect is implemented. method for managing network devices.
第十二方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述程序被处理器执行时实现第三方面所述的管理网络设备的方法。In a twelfth aspect, the present disclosure provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the method for managing a network device described in the third aspect is implemented .
附图说明Description of drawings
图1是本公开实施例提供的一种网络管理系统的结构示意图;FIG. 1 is a schematic structural diagram of a network management system provided by an embodiment of the present disclosure;
图2是本公开实施例提供的一种管理设备的结构示意图;FIG. 2 is a schematic structural diagram of a management device provided by an embodiment of the present disclosure;
图3是本公开实施例提供的一种云管理器的结构示意图;3 is a schematic structural diagram of a cloud manager provided by an embodiment of the present disclosure;
图4是本公开实施例提供的一种网络设备的结构示意图;4 is a schematic structural diagram of a network device provided by an embodiment of the present disclosure;
图5是本公开实施例提供的一种管理网络设备的方法流程图;5 is a flowchart of a method for managing network devices provided by an embodiment of the present disclosure;
图6是本公开实施例提供的一种管理网络设备的方法流程图;6 is a flowchart of a method for managing network devices provided by an embodiment of the present disclosure;
图7-1是本公开实施例提供的管理网络设备的装置结构示意图;7-1 is a schematic structural diagram of an apparatus for managing network equipment provided by an embodiment of the present disclosure;
图7-2是本公开实施例提供的管理网络设备的装置结构示意图;7-2 is a schematic structural diagram of an apparatus for managing network equipment provided by an embodiment of the present disclosure;
图8是本公开实施例提供的管理网络设备的装置结构示意图;8 is a schematic structural diagram of an apparatus for managing network equipment provided by an embodiment of the present disclosure;
图9是本公开实施例提供的管理网络设备的装置结构示意图。FIG. 9 is a schematic structural diagram of an apparatus for managing network devices provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present disclosure clearer, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
下述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。All the following optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, which will not be repeated here.
本公开实施例提供了一种网络管理系统,该参见图1,该系统包括:管理设备101、云管理器102、域名服务器103、DHCP服务器104和至少一个网络设备105。网络设备105为新网络设备。其中,新网络设备是指被动态分配IP地址的网络设备。该网络管理系统还包括传统网络设备。传统网络设备是指被静态分配IP地址的网络设备。An embodiment of the present disclosure provides a network management system. Referring to FIG. 1 , the system includes: a management device 101 , a
管理设备101和网络设备105在局域网(英文:local area network,LAN)中。管理设备101通过LAN管理网络设备105。云管理器102和网络设备105经由广域网(英文:widearea network,WAN)连接。云管理器102通过WAN为网络 设备105分配域名。域名服务器103可以在LAN中,也可以经由WAN连接到管理设备101。域名服务器103为管理设备101解析网络设备105的域名。DHCP服务器104可以在LAN中,也可以经由WAN连接到网络设备105。 DHCP服务器104通过LAN或者WAN为网络设备105分配IP地址。其中,网络设备105可以为交换机、路由器或者无线接入点等。The management device 101 and the
本公开实施例提供了一种管理设备101,参见图2,该管理设备101包括收发器201、处理器202、存储器203和总线204。其中,收发器201、处理器202、存储器203通过总线204 相互通信;收发器201用于管理设备101分别与网络设备105和域名服务器103之间的通信,存储器203用于存储配置信息和指令,该指令包括计算机操作指令,处理器202执行存储器203中存储的指令,使得管理设备101执行下述管理网络设备的方法。An embodiment of the present disclosure provides a management device 101 . Referring to FIG. 2 , the management device 101 includes a transceiver 201 , a processor 202 , a
其中,处理器202负责所有业务处理,如自动扫描网络设备105的IP地址,并主动到网络设备105上获取域名,动态添加或者刷新该网络设备105的管理信息的处理等。存储器203 包括但不限于随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、或光存储器。存储器203负责信息存储,如本公开实施例中的网络设备105的IP地址和域名等管理信息的存储。The processor 202 is responsible for all business processing, such as automatically scanning the IP address of the
本公开实施例提供了一种云管理器102,参见图3,该云管理器102包括收发器301、处理器302、存储器303和总线304。其中,收发器301、处理器302、存储器303通过总线304 相互通信;收发器301用于云管理器102分别与网络设备105、域名服务器103之间的通信,存储器303用于存储配置信息和指令,该指令包括计算机操作指令,处理器302执行存储器 303中存储的指令,使得云管理器102执行下述管理网络设备的方法。An embodiment of the present disclosure provides a
其中,处理器302负责所有业务处理,检测网络设备105的IP地址是否发生变化,以及发送该网络设备105变化后的第二IP地址和域名给DSN服务器103。存储器303包括但不限于RAM、ROM、EPROM或光存储器,存储器303负责信息存储,如本公开实施例中的网络设备105的IP地址和域名等管理信息的存储。The
本公开实施例提供了一种网络设备105,参见图4,该网络设备105 包括收发器401、处理器402、存储器403和总线404。其中,收发器401、处理器402、存储器403通过总线404 相互通信;收发器401用于网络设备105分别与管理设备101、云管理器102和DHCP服务器104之间的通信,存储器403用于存储配置信息和指令,该指令包括计算机操作指令,处理器402执行存储器403中存储的指令,使得网络设备105执行下述管理网络设备的方法。An embodiment of the present disclosure provides a
其中,处理器402负责所有业务处理,检测网络设备105的IP地址是否发生变化,以及检测到该网络设备105的IP地址发生变化时,向云管理器102发送变换后的第二IP地址。存储器403包括但不限于RAM、ROM、EPROM或光存储器,负责信息存储,如本公开实施例中的网络设备105的域名、旧IP地址和/或新IP地址等管理信息的存储。The
本公开实施例提供了一种管理网络设备方法,该方法应用在网络设备、管理设备、云管理器和域名服务器之间。在本公开实施例中以网络设备连接到局域网中的管理设备为例进行说明。参见图5,该方法包括:The embodiments of the present disclosure provide a method for managing network devices, and the method is applied among network devices, management devices, cloud managers, and domain name servers. In the embodiment of the present disclosure, the network device is connected to the management device in the local area network as an example for description. Referring to Figure 5, the method includes:
步骤501:网络设备接收被分配的IP地址。Step 501: The network device receives the assigned IP address.
该网络设备为网络管理系统中的任一网络设备。当该网络设备连接到局域网中的管理设备时,该网络设备向DHCP服务器发送分配请求,该分配请求用于请求DHCP服务器为该网络设备分配IP地址。DHCP服务器接收该网络设备发送的该分配请求,从地址池中选择一个未被使用的IP地址,将该选择的IP地址分配给该网络设备,向该网络设备发送该IP地址。该网络设备接收DHCP服务器发送的该IP地址,将该IP地址存储在非易失性存储器中。The network device is any network device in the network management system. When the network device is connected to the management device in the local area network, the network device sends an assignment request to the DHCP server, where the assignment request is used to request the DHCP server to assign an IP address to the network device. The DHCP server receives the assignment request sent by the network device, selects an unused IP address from the address pool, assigns the selected IP address to the network device, and sends the IP address to the network device. The network device receives the IP address sent by the DHCP server, and stores the IP address in a non-volatile memory.
其中,DHCP服务器中事先配置地址池,地址池中包括多个IP地址。地址池中的多个IP 地址可以为一个连续的IP地址段,也可以为多个连续的IP地址段。当该地址池中的多个IP 地址为一个连续的IP地址段时,DHCP服务器中可以仅存储该地址池的起始IP地址和终止IP 地址。The DHCP server is configured with an address pool in advance, and the address pool includes multiple IP addresses. Multiple IP addresses in the address pool can be one continuous IP address segment or multiple consecutive IP address segments. When the multiple IP addresses in the address pool are a continuous IP address segment, the DHCP server may only store the starting IP address and the ending IP address of the address pool.
步骤502:该网络设备向云管理器发送包括该网络设备的IP地址的注册请求。Step 502: The network device sends a registration request including the IP address of the network device to the cloud manager.
该网络设备向云管理器发送注册请求之前,该网络设备确定本地是否存在该网络设备上一次被分配的IP地址或者上一次被分配的IP地址和该IP地址是否相同。当该网络设备本地不存在该网络设备上一次被分配的IP地址或者该上一次被分配的IP地址和该IP地址不同时,该网络设备向云管理器发送包括该网络设备的IP地址的注册请求。Before the network device sends the registration request to the cloud manager, the network device determines whether there is an IP address assigned last time by the network device or whether the IP address assigned last time is the same as the IP address. When the network device does not have the IP address assigned last time by the network device or the IP address assigned last time is different from the IP address, the network device sends a registration including the IP address of the network device to the cloud manager ask.
在本步骤中,由于该网络设备连接到局域网中的管理设备,该网络设备中不存在上一次被已分配的IP地址;因此,该网络设备需要在云管理器中进行注册。该网络设备向云管理器发送包括该网络设备的IP地址的注册请求。其中,该注册请求中还可以携带该网络设备的媒体访问控制(英文:Media Access Control,MAC)地址。In this step, since the network device is connected to the management device in the local area network, the network device does not have the IP address assigned last time; therefore, the network device needs to be registered in the cloud manager. The network device sends a registration request including the IP address of the network device to the cloud manager. The registration request may also carry a media access control (English: Media Access Control, MAC) address of the network device.
步骤503:云管理器接收该网络设备发送的包括该网络设备的IP地址的注册请求,在该网络设备完成注册后,为该网络设备分配域名。Step 503: The cloud manager receives the registration request including the IP address of the network device sent by the network device, and allocates a domain name to the network device after the network device completes the registration.
云管理器接收该注册请求,从该注册请求中获取该网络设备的IP地址,根据该网络设备的IP地址,向该网络设备发送注册响应,此时云管理器与该网络设备之间建立长连接。云管理器存储该网络设备的IP地址,从而完成该网络设备的注册。当该注册请求中还携带该网络设备的MAC地址时,云管理器从该注册请求中获取该网络设备的MAC地址。The cloud manager receives the registration request, obtains the IP address of the network device from the registration request, and sends a registration response to the network device according to the IP address of the network device. connect. The cloud manager stores the IP address of the network device, thereby completing the registration of the network device. When the registration request also carries the MAC address of the network device, the cloud manager obtains the MAC address of the network device from the registration request.
云管理器在该网络设备完成注册后,为该网络设备分配域名。其中,云管理器中包括DNS 组件,相应的,云管理器为该网络设备分配域名的步骤可以为:云管理器通过该DNS组件为该网络设备分配域名。其中,该DNS组件中存储预设的域名规划规则,该DNS组件根据该预设的域名规划规则为该网络设备分配域名。After the network device completes the registration, the cloud manager assigns a domain name to the network device. The cloud manager includes a DNS component. Correspondingly, the step of assigning a domain name to the network device by the cloud manager may be: the cloud manager assigns a domain name to the network device through the DNS component. The DNS component stores a preset domain name planning rule, and the DNS component allocates a domain name to the network device according to the preset domain name planning rule.
预设的域名规划规则可以根据需要进行设置并更改,在本公开实施例中,对预设的域名规划规则不作具体限定。例如,预设的域名规划规则可以为:“前缀+站点名+后缀”。其中,“前缀”可以为网络设备的系统名(sysname),“站点名”可以为网络设备所在物理位置的命名,“后缀”可以为网络设备的域名规划;例如,该域名规划为“enterpriseA.com”。The preset domain name planning rules can be set and changed as needed. In the embodiment of the present disclosure, the preset domain name planning rules are not specifically limited. For example, the preset domain name planning rule may be: "prefix + site name + suffix". Among them, the "prefix" can be the system name (sysname) of the network device, the "site name" can be the name of the physical location of the network device, and the "suffix" can be the domain name plan of the network device; for example, the domain name plan is "enterpriseA. com".
云管理器为该网络设备分配域名之后,云管理器存储该网络设备的域名和IP地址的对应关系,以便于后续云管理器基于该域名,确定该网络设备当前的IP地址是否发生改变。并且,当该注册请求中携带该网络设备的MAC地址时,云管理器还可以存储该网络设备的MAC地址和域名的对应关系。After the cloud manager assigns the domain name to the network device, the cloud manager stores the correspondence between the domain name and the IP address of the network device, so that the subsequent cloud manager can determine whether the current IP address of the network device has changed based on the domain name. Moreover, when the registration request carries the MAC address of the network device, the cloud manager may also store the correspondence between the MAC address of the network device and the domain name.
云管理器根据该网络设备的IP地址,向该网络设备发送存储指令,该存储指令携带该域名,且该存储指令用于指示该网络设备将该域名存储到域名文件中。该网络设备接收该存储指令,从该存储指令中获取该网络设备的域名,根据该存储指令,将该域名存储到该网络设备的域名文件中。另外,该网络设备接收到该域名后,该网络设备存储该网络设备的IP地址和域名的对应关系。The cloud manager sends a storage instruction to the network device according to the IP address of the network device, the storage instruction carries the domain name, and the storage instruction is used to instruct the network device to store the domain name in a domain name file. The network device receives the storage instruction, obtains the domain name of the network device from the storage instruction, and stores the domain name in the domain name file of the network device according to the storage instruction. In addition, after the network device receives the domain name, the network device stores the correspondence between the IP address of the network device and the domain name.
步骤504:云管理器向域名服务器发送该网络设备的域名和该网络设备的IP地址的对应关系。Step 504: The cloud manager sends the corresponding relationship between the domain name of the network device and the IP address of the network device to the domain name server.
云管理器向域名服务器发送该网络设备的域名和该网络设备的IP地址的对应关系之前,云管理器确定本地是否存在该网络设备上一次被分配的IP地址或者上一次被分配的IP地址和该IP地址是否相同。当云管理器本地不存在该网络设备上一次被分配的IP地址或者该上一次被分配的IP地址和该IP地址不同时,云管理器向域名服务器发送该网络设备的域名和该网络设备的IP地址的对应关系。Before the cloud manager sends the corresponding relationship between the domain name of the network device and the IP address of the network device to the domain name server, the cloud manager determines whether there is an IP address assigned last time of the network device or the IP address and IP address assigned last time locally. Whether the IP address is the same. When the last IP address assigned to the network device does not exist locally in the cloud manager or the IP address assigned last time is different from the IP address, the cloud manager sends the domain name of the network device and the network device's domain name to the domain name server. Correspondence between IP addresses.
在本步骤中,由于该网络设备连接到局域网中的管理设备,云管理器中不存在上一次被已分配的IP地址。因此,云管理器向域名服务器发送报文类型为添加的第一域名系统(英文: Domain Name System,DNS)报文,第一DNS报文中携带该网络设备的域名和该网络设备的 IP地址的对应关系。In this step, since the network device is connected to the management device in the local area network, there is no IP address assigned last time in the cloud manager. Therefore, the cloud manager sends a first domain name system (English: Domain Name System, DNS) message whose message type is added to the domain name server, and the first DNS message carries the domain name of the network device and the IP address of the network device corresponding relationship.
步骤505:域名服务器接收云管理器发送的该网络设备的域名和该网络设备的IP地址的对应关系,存储该网络设备的域名和IP地址的对应关系。Step 505: The domain name server receives the correspondence between the domain name of the network device and the IP address of the network device sent by the cloud manager, and stores the correspondence between the domain name and the IP address of the network device.
域名服务器接收云管理器发送的第一DNS报文,从第一DNS报文中获取该网络设备的域名和该网络设备的IP地址的对应关系,存储该网络设备的域名和该网络设备的IP地址的对应关系,以便于后续在管理设备与该网络设备通信时,从该域名服务器中解析出该网络设备的IP地址。The domain name server receives the first DNS message sent by the cloud manager, obtains the correspondence between the domain name of the network device and the IP address of the network device from the first DNS message, and stores the domain name of the network device and the IP address of the network device. The corresponding relationship of the addresses is convenient to resolve the IP address of the network device from the domain name server when the management device communicates with the network device subsequently.
以上步骤501-505是该网络设备在云管理器中注册的过程。管理设备可以通过以下步骤 506-509对该网络设备进行管理。The above steps 501-505 are the process of registering the network device in the cloud manager. The management device can manage the network device through the following steps 506-509.
步骤506:管理设备探测地址池中的至少一个IP地址以确定已被使用的IP地址。Step 506: The management device probes at least one IP address in the address pool to determine an IP address that has been used.
管理设备可以每隔预设间隔对地址池中的IP地址进行探测以确定已被使用的IP地址;管理设备也可以对网络管理系统的网络拓扑进行检测,当检测到该网络拓扑改变时,才对地址池中的IP地址进行探测以确定已被使用的IP地址。其中,管理设备中包括用于指示该网络拓扑是否改变的物理端口;当该网络拓扑发生改变时,该物理端口向该管理设备发送通知消息。当该管理设备接收到该通知消息时,确定该网络拓扑发生改变。预设间隔可以根据需要进行设置并更改,例如,预设间隔可以为10分钟或者1小时等。The management device can detect the IP addresses in the address pool at preset intervals to determine the IP addresses that have been used; the management device can also detect the network topology of the network management system, and only when it detects that the network topology changes. Probe the IP addresses in the address pool to determine the IP addresses that have been used. Wherein, the management device includes a physical port for indicating whether the network topology changes; when the network topology changes, the physical port sends a notification message to the management device. When the management device receives the notification message, it is determined that the network topology has changed. The preset interval can be set and changed as required, for example, the preset interval can be 10 minutes or 1 hour, etc.
用户事先在管理设备中配置地址池,该地址池包括多个IP地址。在本步骤中,管理设备可以探测该地址池包括的每个IP地址以确定已被使用的IP地址。The user configures an address pool on the management device in advance, and the address pool includes multiple IP addresses. In this step, the management device may probe each IP address included in the address pool to determine the IP address that has been used.
由于该网络管理系统中包括新网络设备和传统网络设备,新网络设备的IP地址为DHCP 服务器动态分配的,而传统网络设备的IP地址为静态的。也即新网络设备的IP地址可能会由于网络设备的重启而发生改变,而传统网络设备的IP地址不会由于网络设备的重启而发生改变。因此,在本步骤中,管理设备可以不探测该地址池中的所有IP地址,而仅探测已知被使用的IP地址外的其他IP地址。已知被使用的IP地址包括静态配置的IP地址、最近探测到的被使用的IP地址和/或最近从域名服务器中解析到的IP地址。这样不仅节省资源,还能够提高效率。相应的,本步骤可以为:Since the network management system includes new network devices and traditional network devices, the IP addresses of the new network devices are dynamically allocated by the DHCP server, while the IP addresses of the traditional network devices are static. That is, the IP address of the new network device may be changed due to the restart of the network device, while the IP address of the traditional network device will not be changed due to the restart of the network device. Therefore, in this step, the management device may not detect all the IP addresses in the address pool, but only detect other IP addresses except the known used IP addresses. Known used IP addresses include statically configured IP addresses, recently detected used IP addresses, and/or IP addresses recently resolved from domain name servers. This not only saves resources, but also improves efficiency. Correspondingly, this step can be:
管理设备确定该地址池中除已知被使用的IP地址之外的其他IP地址,探测该其他IP地址以确定已被使用的IP地址。The management device determines other IP addresses in the address pool except the known used IP addresses, and detects the other IP addresses to determine the used IP addresses.
由于当管理设备与网络设备进行通信时,管理设备需要从域名服务器中解析出该网络设备的IP地址,管理设备存储该网络设备的IP地址和解析该IP地址的时间戳。相应的,当已知被使用的IP地址包括最近从域名服务器中解析到的IP地址时,管理设备确定该地址池中除已知被使用的IP地址之外的其他IP地址的步骤可以为:When the management device communicates with the network device, the management device needs to resolve the IP address of the network device from the domain name server, and the management device stores the IP address of the network device and the time stamp for resolving the IP address. Correspondingly, when the known used IP addresses include the IP addresses recently resolved from the domain name server, the management device determines other IP addresses in the address pool except the known used IP addresses as follows:
管理设备获取离当前时间最近的第一预设时长内解析到的IP地址,确定该地址池中除已经解析到的IP地址之外的其他IP地址。其中,第一预设时长可以根据需要进行设置并更改,在本公开中对第一预设时长不作具体限定;例如,第一预设时长可以为30分钟或者1个小时等。The management device obtains the IP address resolved within the first preset duration closest to the current time, and determines other IP addresses in the address pool except the IP addresses that have been resolved. The first preset duration can be set and changed as required, and the first preset duration is not specifically limited in this disclosure; for example, the first preset duration can be 30 minutes or 1 hour.
在本步骤中,管理设备中存储有静态配置的IP地址;相应的,当已知被使用的IP地址包括静态配置的IP地址时,管理设备确定该地址池中除已知被使用的IP地址之外的其他IP 地址的步骤可以为:管理设备获取静态配置的IP地址,确定该地址池中除静态配置的IP地址之外的其他IP地址。In this step, the statically configured IP address is stored in the management device; correspondingly, when the known used IP address includes the statically configured IP address, the management device determines that the known used IP address is excluded from the address pool. The steps of the other IP addresses may be: the management device obtains the statically configured IP addresses, and determines other IP addresses except the statically configured IP addresses in the address pool.
管理设备探测到已经被使用的IP地址时,管理设备存储该IP地址和该IP地址的探测时间。相应的,当已知被使用的IP地址包括最近探测到的被使用的IP地址时,管理设备确定该地址池中除已知被使用的IP地址之外的其他IP地址的步骤可以为:管理设备获取离当前时间最近的第二预设时长内探测到的IP地址,确定该地址池中除该离当前时间最近的第二预设时长内探测到的IP地址之外的其他IP地址。When the management device detects the IP address that has been used, the management device stores the IP address and the detection time of the IP address. Correspondingly, when the known used IP addresses include the recently detected used IP addresses, the step of the management device determining other IP addresses in the address pool other than the known used IP addresses may be: management The device obtains the IP addresses detected within the second preset duration closest to the current time, and determines other IP addresses in the address pool except the IP addresses detected within the second preset duration closest to the current time.
第二预设时长和第一预设时长可以相等,也可以不相等。并且,第二预设时长可以根据需要进行设置并更改,在本公开中对第二预设时长不作具体限定;例如,第二预设时长和第一预设时长相等,均为30分钟或者1个小时等。The second preset duration and the first preset duration may or may not be equal. In addition, the second preset duration can be set and changed as required, and the second preset duration is not specifically limited in the present disclosure; for example, the second preset duration is equal to the first preset duration, both being 30 minutes or 1 hours and so on.
在本步骤之前,用户将该地址池配置到管理设备中。对于任一IP地址,管理设备探测基于Ping操作探测该IP地址。其中,管理设备探测该IP地址的步骤可以为:管理设备向使用该IP地址的网络设备发送扫描信号。当该IP地址被使用时,则使用该IP地址的网络设备向管理设备返回IP数据包,该IP数据包中包括该网络设备的IP地址。当该IP地址未被使用时,则没有网络设备向该管理设备返回IP数据包。如果该管理设备发送扫描信号之后的第三预设时长内接收到网络设备返回的IP数据包,该管理设备确定该IP地址已被使用。如果该管理设备发送扫描信号之后的第三预设时长内没有接收到网络设备返回的IP数据包,该管理设备确定该IP地址没有被使用。Before this step, the user configures the address pool on the management device. For any IP address, the management device probes the IP address based on the Ping operation. The step of detecting the IP address by the management device may be: the management device sends a scan signal to the network device using the IP address. When the IP address is used, the network device using the IP address returns an IP data packet to the management device, and the IP data packet includes the IP address of the network device. When the IP address is not used, no network device returns an IP data packet to the management device. If the management device receives the IP data packet returned by the network device within a third preset time period after sending the scan signal, the management device determines that the IP address has been used. If the management device does not receive the IP data packet returned by the network device within a third preset time period after the management device sends the scan signal, the management device determines that the IP address is not used.
在本公开实施例中,管理设备基于IP地址扫描自动获取已被使用的IP地址。从而无需人工录入,即可获取到该网络设备的IP地址。节省了人力资源,并且提高了准确性。第三预设时长可以根据需要进行设置并更改,在本公开实施例中,对第三预设时长不做具体限定。例如,第三预设时长可以为1秒或者0.5秒等。In the embodiment of the present disclosure, the management device automatically acquires the IP addresses that have been used based on IP address scanning. Therefore, the IP address of the network device can be obtained without manual input. Human resources are saved and accuracy is improved. The third preset duration can be set and changed as required, and in this embodiment of the present disclosure, the third preset duration is not specifically limited. For example, the third preset duration may be 1 second or 0.5 seconds, or the like.
步骤507:管理设备基于已被使用的IP地址,用管理协议从使用该已被使用的IP地址的网络设备中获取该网络设备的域名。Step 507: The management device obtains the domain name of the network device from the network device using the used IP address by using the management protocol based on the used IP address.
该网络设备的域名文件中存储有该网络设备的域名;因此,管理设备可以用管理协议从该网络设备的域名文件中获取该网络设备的域名,也即以下第一种实现方式;管理设备也可以用管理协议从该网络设备中获取域名文件,然后从域名文件中获取该网络设备的域名,也即以下第二种实现方式。The domain name file of the network device stores the domain name of the network device; therefore, the management device can use the management protocol to obtain the domain name of the network device from the domain name file of the network device, which is the first implementation below; the management device also The management protocol can be used to obtain the domain name file from the network device, and then the domain name of the network device can be obtained from the domain name file, that is, the following second implementation manner.
对于第一种实现方式,本步骤可以通过以下步骤(1)至(4)实现,包括:For the first implementation, this step can be implemented through the following steps (1) to (4), including:
(1):管理设备生成传输协议为管理协议的第一获取请求,第一获取请求用于获取该网络设备的域名。(1): The management device generates a first acquisition request whose transmission protocol is the management protocol, and the first acquisition request is used to acquire the domain name of the network device.
第一获取请求可以为简单网络管理协议(英文:Simple Network ManagementProtocol, SNMP)报文。The first acquisition request may be a Simple Network Management Protocol (English: Simple Network Management Protocol, SNMP) message.
(2):管理设备根据该网络设备的IP地址,向该网络设备发送第一获取请求。(2): The management device sends a first acquisition request to the network device according to the IP address of the network device.
(3):该网络设备接收管理设备发送的第一获取请求,根据第一获取请求,从该网络设备的域名文件中获取该网络设备的域名,向管理设备发送该域名。(3): The network device receives the first acquisition request sent by the management device, acquires the domain name of the network device from the domain name file of the network device according to the first acquisition request, and sends the domain name to the management device.
(4):管理设备接收该域名。(4): The management device receives the domain name.
对于第二种实现方式,本步骤可以通过以下步骤(A)至(D)实现,包括:For the second implementation, this step can be implemented through the following steps (A) to (D), including:
(A):管理设备生成传输协议为管理协议的第二获取请求,第二获取请求用于获取该网络设备的域名文件。(A): The management device generates a second acquisition request whose transmission protocol is the management protocol, and the second acquisition request is used to acquire the domain name file of the network device.
同样,第二获取请求可以为SNMP报文。Likewise, the second acquisition request may be an SNMP message.
(B):管理设备根据该网络设备的IP地址,向该网络设备发送第二获取请求。(B): The management device sends a second acquisition request to the network device according to the IP address of the network device.
(C):该网络设备接收管理设备发送的第二获取请求,根据第二获取请求,获取该网络设备的域名文件,向管理设备发送该域名文件。(C): The network device receives the second acquisition request sent by the management device, acquires the domain name file of the network device according to the second acquisition request, and sends the domain name file to the management device.
(D):该管理设备接收该域名文件,从该域名文件中获取该网络设备的域名。(D): The management device receives the domain name file, and obtains the domain name of the network device from the domain name file.
管理设备通过以上第一种或者第二种方式获取到该域名后,关联存储该网络设备的IP地址和域名,以便于后续基于该域名或者IP地址对该网络设备进行管理。After acquiring the domain name in the first or second manner above, the management device associates and stores the IP address and domain name of the network device, so as to facilitate subsequent management of the network device based on the domain name or IP address.
步骤509:管理设备根据该域名,管理该网络设备。Step 509: The management device manages the network device according to the domain name.
管理设备与该网络设备进行通信时,管理设备需要获取该网络设备的IP地址,基于该 IP地址与该网络设备进行通信。相应的,本步骤可以通过以下步骤(1)-(3)实现,包括:When the management device communicates with the network device, the management device needs to obtain the IP address of the network device, and communicate with the network device based on the IP address. Correspondingly, this step can be realized by the following steps (1)-(3), including:
(1):当该管理设备与该网络设备通信前,管理设备向域名服务器查询该网络设备的域名。(1): Before the management device communicates with the network device, the management device queries the domain name server for the domain name of the network device.
由于域名服务器中存储有该网络设备的IP地址。因此,在管理设备与该网络设备通信前,管理设备向域名服务器发送域名请求,该域名请求携带该网络设备的域名,以请求从域名服务器中解析出该网络设备的IP地址。域名服务器接收管理设备发送的该域名请求,获取该域名请求中携带的该网络设备的域名,根据该域名,从域名和IP地址的对应关系中获取该网络设备的IP地址,向该管理设备发送该网络设备的IP地址。Because the IP address of the network device is stored in the domain name server. Therefore, before the management device communicates with the network device, the management device sends a domain name request to the domain name server, and the domain name request carries the domain name of the network device, so as to request to resolve the IP address of the network device from the domain name server. The domain name server receives the domain name request sent by the management device, obtains the domain name of the network device carried in the domain name request, obtains the IP address of the network device from the corresponding relationship between the domain name and the IP address according to the domain name, and sends the request to the management device. The IP address of this network device.
(2):管理设备接收域名服务器回答的该域名对应的IP地址。(2): The management device receives the IP address corresponding to the domain name answered by the domain name server.
(3):管理设备基于该IP地址,与该网络设备进行通信。(3): The management device communicates with the network device based on the IP address.
由于管理设备在步骤508中已经确定出该网络设备的IP地址;由于只有当该网络设备重启时,该网络设备的IP地址才会发生改变。因此,该网络设备的IP地址在一段时间内是有效的。因此,管理设备也可以不通过以上步骤(1)至(3)获取该网络设备的IP地址,而直接使用探测到的该网络设备的IP地址。相应的,本步骤可以为:Because the management device has determined the IP address of the network device in step 508; because only when the network device is restarted, the IP address of the network device will change. Therefore, the IP address of the network device is valid for a period of time. Therefore, the management device may also directly use the detected IP address of the network device without obtaining the IP address of the network device through the above steps (1) to (3). Correspondingly, this step can be:
当管理设备与该网络设备通信前,管理设备根据该网络设备的域名,从域名和新IP地址的对应关系中获取该域名对应的IP地址,基于该IP地址,与该网络设备通信。Before the management device communicates with the network device, the management device obtains the IP address corresponding to the domain name from the correspondence between the domain name and the new IP address according to the domain name of the network device, and communicates with the network device based on the IP address.
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,管理设备基于已被使用的IP地址获取该网络设备的域名,并根据域名而不是IP地址管理网络设备。由于网络设备的域名不变,管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the management device acquires the domain name of the network device based on the IP address that has been used, and manages the network device based on the domain name instead of the IP address. Since the domain name of the network device remains unchanged, the management of the network device by the management device is not affected by the change of the IP address of the network device.
本公开实施例提供了一种管理网络设备方法,该方法应用在网络设备、管理设备、云管理器和域名服务器之间。在本公开实施例中以网络设备重启为例进行说明。参见图6,该方法包括:The embodiments of the present disclosure provide a method for managing network devices, and the method is applied among network devices, management devices, cloud managers, and domain name servers. In the embodiments of the present disclosure, the network device restart is taken as an example for description. Referring to Figure 6, the method includes:
步骤601:网络设备接收被分配的新IP地址。Step 601: The network device receives the assigned new IP address.
当该网络设备重启时,该网络设备向DHCP服务器发送新分配请求,以请求DHCP服务器为该网络设备重新分配IP地址。网络设备将DHCP服务器为该网络设备分配的新IP地址存储在非易失性存储器中。When the network device restarts, the network device sends a new allocation request to the DHCP server, so as to request the DHCP server to re-allocate an IP address for the network device. The network device stores the new IP address assigned to the network device by the DHCP server in non-volatile memory.
步骤602:该网络设备向云管理器发送包括该网络设备的新IP地址和域名的新注册请求。Step 602: The network device sends a new registration request including the new IP address and domain name of the network device to the cloud manager.
由于DHCP服务器动态为该网络设备分配IP地址,因此该网络设备上一次被分配的IP地址和该新IP地址可能不同。该网络设备从非易失性存储器中获取该网络设备上一次被分配的 IP地址,确定该上一次被分配的IP地址和该新IP地址是否相同。当该网络设备上一次被分配的IP地址和该新IP地址不同时,该网络设备向云管理器发送包括该网络设备的新IP地址和域名的新注册请求。其中,该新注册请求中还可以携带该网络设备的MAC地址,还新注册请求中还可以携带该网络设备上一次被分配的IP地址。Since the DHCP server dynamically assigns an IP address to the network device, the IP address assigned to the network device last time and the new IP address may be different. The network device acquires the last IP address assigned by the network device from the non-volatile memory, and determines whether the IP address assigned last time and the new IP address are the same. When the IP address assigned to the network device last time is different from the new IP address, the network device sends a new registration request including the new IP address and domain name of the network device to the cloud manager. Wherein, the new registration request may further carry the MAC address of the network device, and the new registration request may also carry the IP address allocated last time of the network device.
当该网络设备上一次被分配的IP地址和该新IP地址相同时,由于已经在云管理器中进行了注册,因此在本步骤中不再进行重复注册,从而节省了网络资源。另外,该网络设备接收到当前被分配的IP地址之后,将该IP地址存储在非易失性存储器中,以便于后续该网络设备被重新分配IP地址后,从该非易失性存储器中获取该IP地址,并确定该IP地址和该重新分配的IP地址是否相同,以确定是否在云管理器中进行注册。When the IP address assigned to the network device last time is the same as the new IP address, since it has already been registered in the cloud manager, repeated registration is not performed in this step, thereby saving network resources. In addition, after the network device receives the currently assigned IP address, the IP address is stored in the non-volatile memory, so that the network device can obtain the IP address from the non-volatile memory after the network device is subsequently reassigned an IP address. the IP address, and determine whether the IP address and the reassigned IP address are the same to determine whether to register in the cloud manager.
步骤603:云管理器接收该网络设备发送的包括该网络设备的新IP地址和域名的新注册请求,向域名服务器发送该网络设备的域名和该网络设备的新IP地址的对应关系。Step 603: The cloud manager receives the new registration request including the new IP address and domain name of the network device sent by the network device, and sends the corresponding relationship between the domain name of the network device and the new IP address of the network device to the domain name server.
云管理设备可以将该网络设备的域名和该网络设备的新IP地址的对应关系承载在第一 DNS报文中。管理设备也可以将该网络设备的域名和该网络设备的新IP地址的对应关系承载在报文类型为更新的第二DNS报文中,向域名服务器发送报文类型为更新的第二DNS报文,该第二DNS报文中携带该网络设备的域名和新IP地址的对应关系。The cloud management device may carry the correspondence between the domain name of the network device and the new IP address of the network device in the first DNS message. The management device may also carry the correspondence between the domain name of the network device and the new IP address of the network device in the second DNS message whose message type is updated, and send the second DNS message whose message type is updated to the domain name server. The second DNS packet carries the correspondence between the domain name of the network device and the new IP address.
云管理器向域名服务器发送该网络设备的域名和该网络设备的新IP地址的对应关系之前,云管理器获取该网络设备上一次被分配的IP地址,确定该网络设备上一次被分配的IP 地址和该新IP地址是否相同;当该网络设备上一次被分配的IP地址和该新IP地址不同时,云管理器向域名服务器发送该网络设备的域名和该网络设备的新IP地址的对应关系。Before the cloud manager sends the corresponding relationship between the domain name of the network device and the new IP address of the network device to the domain name server, the cloud manager obtains the last IP address assigned to the network device, and determines the last IP address assigned to the network device Whether the address is the same as the new IP address; when the IP address assigned to the network device last time is different from the new IP address, the cloud manager sends the domain name of the network device and the new IP address of the network device to the domain name server. relation.
云管理器可以通过以下三种方式获取该网络设备上一次被分配的IP地址。对于第一种方式,云管理器在为该网络设备分配域名之后,云管理器存储该网络设备的域名和IP地址的对应关系;相应的,云管理器获取该网络设备上一次被分配的IP地址的步骤可以为:云管理器根据该网络设备的域名,从域名和IP地址的对应关系中获取该网络设备上一次被分配的IP 地址。The cloud manager can obtain the last assigned IP address of the network device in the following three ways. For the first method, after the cloud manager assigns a domain name to the network device, the cloud manager stores the correspondence between the domain name and the IP address of the network device; correspondingly, the cloud manager obtains the IP address that was assigned to the network device last time The step of addressing may be as follows: the cloud manager obtains, according to the domain name of the network device, the IP address allocated last time of the network device from the corresponding relationship between the domain name and the IP address.
对于第二种方式,该新注册请求中携带该网络设备上一次被分配的IP地址;云管理器从该新注册请求中获取该网络设备上一次被分配的IP地址。For the second method, the new registration request carries the IP address allocated last time of the network device; the cloud manager obtains the IP address allocated last time of the network device from the new registration request.
对于第三种方式,云管理器在为该网络设备分配域名之后,云管理器存储该网络设备的 MAC地址和IP地址的对应关系。相应的,云管理器获取该网络设备上一次被分配的IP地址的步骤可以为:云管理器根据该网络设备的MAC地址,从MAC地址和IP地址的对应关系中获取该网络设备上一次被分配的IP地址。For the third manner, after the cloud manager assigns the domain name to the network device, the cloud manager stores the correspondence between the MAC address and the IP address of the network device. Correspondingly, the step for the cloud manager to obtain the IP address that was assigned to the network device last time may be: the cloud manager obtains, according to the MAC address of the network device, from the correspondence between the MAC address and the IP address, that the network device was lastly assigned. The assigned IP address.
步骤604:域名服务器接收云管理器发送的该网络设备的域名和该网络设备的新IP地址的对应关系,将该网络设备的域名和上一次被分配的IP地址的对应关系更新为该网络设备的域名和该新IP地址的对应关系。Step 604: The domain name server receives the correspondence between the domain name of the network device and the new IP address of the network device sent by the cloud manager, and updates the correspondence between the domain name of the network device and the IP address assigned last time to the network device The corresponding relationship between the domain name and the new IP address.
域名服务器接收云管理器发送的第二DNS报文,从第二DNS报文中获取该网络设备的域名和该网络设备的新IP地址,根据该网络设备的域名,将该网络设备的域名和IP地址的对应关系中的该域名对应的IP地址修改为该网络设备的新IP地址。The domain name server receives the second DNS message sent by the cloud manager, obtains the domain name of the network device and the new IP address of the network device from the second DNS message, and, according to the domain name of the network device, obtains the domain name of the network device and the new IP address of the network device. The IP address corresponding to the domain name in the IP address correspondence is modified to the new IP address of the network device.
当该网络设备重启时,域名服务器接收云管理器发送的该网络设备的域名和该网络设备的新IP地址的对应关系,将该网络设备域名和IP地址的对应关系更新为该网络设备的域名和新IP地址的对应关系,从而域名服务器中存储有该网络设备的新IP地址,以便于后续管理设备与该网络设备通信时,从域名服务器中解析出该网络设备的新IP地址。When the network device restarts, the domain name server receives the correspondence between the domain name of the network device and the new IP address of the network device sent by the cloud manager, and updates the correspondence between the domain name and IP address of the network device to the domain name of the network device The new IP address of the network device is stored in the domain name server, so that when the subsequent management device communicates with the network device, the new IP address of the network device can be resolved from the domain name server.
步骤605:管理设备根据该域名,管理该网络设备。Step 605: The management device manages the network device according to the domain name.
本步骤和步骤509相同,在此不再赘述。This step is the same as step 509 and will not be repeated here.
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,管理设备基于已被使用的IP地址获取该网络设备的域名,并根据域名而不是IP地址管理网络设备。由于网络设备的域名不变,管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the management device acquires the domain name of the network device based on the IP address that has been used, and manages the network device based on the domain name instead of the IP address. Since the domain name of the network device remains unchanged, the management of the network device by the management device is not affected by the change of the IP address of the network device.
本公开实施例提供了一种管理网络设备的装置,应用于管理设备中,用于执行上述管理网络设备的方法中管理设备执行的步骤。参见图7-1,该装置包括:An embodiment of the present disclosure provides an apparatus for managing network equipment, which is applied to the management equipment and is used to execute the steps performed by the management equipment in the above method for managing network equipment. Referring to Figure 7-1, the device includes:
探测模块701,用于探测地址池中的至少一个网际协议IP地址以确定已被使用的IP地址;A
获取模块702,用于基于已被使用的IP地址,用管理协议从使用已被使用的IP地址的网络设备获取网络设备的域名;an obtaining
管理模块703,用于根据域名,管理网络设备。The
在一个可能的实现方式中,参见图7-2,该装置还包括:In a possible implementation, referring to Fig. 7-2, the device further includes:
检测模块704,用于检测到网络拓扑改变。The
在一个可能的实现方式中,管理模块703,还用于当管理设备与网络设备通信前,向域名服务器查询网络设备的域名;接收域名服务器回答的域名对应的新IP地址;基于新IP地址,与网络设备通信。In a possible implementation manner, the
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,管理设备基于已被使用的IP地址获取该网络设备的域名,并根据域名而不是IP地址管理网络设备。由于网络设备的域名不变,管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the management device acquires the domain name of the network device based on the IP address that has been used, and manages the network device based on the domain name instead of the IP address. Since the domain name of the network device remains unchanged, the management of the network device by the management device is not affected by the change of the IP address of the network device.
本公开实施例提供了一种管理网络设备的装置,应用于云管理器中,用于执行上述管理网络设备的方法中云管理器执行的步骤。参见图8,该装置包括:An embodiment of the present disclosure provides an apparatus for managing network equipment, which is applied to a cloud manager and is used to execute the steps performed by the cloud manager in the above method for managing network equipment. Referring to Figure 8, the device includes:
第一接收模块801,用于接收网络设备发送的包括网络设备的网际协议IP地址的注册请求;a
分配模块802,用于在网络设备完成注册后,为网络设备分配域名;an allocation module 802, configured to allocate a domain name to the network device after the network device completes the registration;
第一发送模块803,用于向域名服务器发送网络设备的域名和网络设备的IP地址的对应关系。The
在一个可能的实现方式中,第一接收模块801,还用于接收网络设备的包括网络设备的新IP地址和域名的新注册请求;In a possible implementation manner, the
第一发送模块803,还用于向域名服务器发送网络设备的域名和网络设备的新IP地址的对应关系。The
云管理器向域名服务器发送其管理的网络设备的域名及对应的IP地址,从而使管理设备能根据网络设备的域名管理网络设备。The cloud manager sends the domain name and corresponding IP address of the network device managed by the cloud manager to the domain name server, so that the management device can manage the network device according to the domain name of the network device.
本公开实施例提供了一种管理网络设备的装置,应用于网络设备中,用于执行上述管理网络设备的方法中网络设备执行的步骤。参见图9,该装置包括:An embodiment of the present disclosure provides an apparatus for managing network equipment, which is applied to the network equipment and is used to execute the steps performed by the network equipment in the above method for managing network equipment. Referring to Figure 9, the device includes:
第二发送模块901,用于向云管理器发送包括网络设备的网际协议IP地址的注册请求;A
第二接收模块902,用于在网络设备完成注册后,接收云管理器为网络设备分配的域名;The
第二发送模块901,还用于网络设备的IP地址变化时,向云管理器发送新IP地址。The
网络设备重启后,DHCP服务器为云管理系统中的网络设备分配的新IP地址可能与上一次为该网络设备分配的IP地址不同。因此,云管理器更新域名服务器中与其域名对应的IP 地址。从而使管理设备对网络设备的管理不受网络设备的IP地址变化的影响。After the network device is restarted, the new IP address assigned by the DHCP server to the network device in the cloud management system may be different from the IP address assigned to the network device last time. Therefore, the cloud manager updates the IP address corresponding to its domain name in the domain name server. Therefore, the management of the network device by the management device is not affected by the change of the IP address of the network device.
需要说明的是:上述实施例提供的管理网络设备的装置在管理网络设备时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的管理网络设备的装置与管理网络设备的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the apparatus for managing network equipment provided in the above embodiments manages network equipment, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the apparatus for managing network equipment provided in the above embodiments and the method embodiments for managing network equipment belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
本发明实施例还提供了一种计算机可读存储介质,该计算机可读存储介质应用于管理设备,该计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,该指令、该程序、该代码集或该指令集由处理器加载并执行以实现上述实施例的管理网络设备的方法中管理设备所执行的操作。Embodiments of the present invention further provide a computer-readable storage medium, where the computer-readable storage medium is applied to a management device, and the computer-readable storage medium stores at least one instruction, at least a piece of program, a code set or an instruction set, the The instructions, the program, the code set, or the instruction set are loaded and executed by the processor to implement the operations performed by the management device in the method for managing a network device in the above-mentioned embodiment.
本发明实施例还提供了一种计算机可读存储介质,该计算机可读存储介质应用于云管理器,该计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,该指令、该程序、该代码集或该指令集由处理器加载并执行以实现上述实施例的管理网络设备的方法中云管理器所执行的操作。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium is applied to the cloud manager, and the computer-readable storage medium stores at least one instruction, at least a piece of program, a code set or an instruction set, The instruction, the program, the code set or the instruction set are loaded and executed by the processor to implement the operations performed by the cloud manager in the method for managing a network device of the above-mentioned embodiment.
本发明实施例还提供了一种计算机可读存储介质,该计算机可读存储介质应用于网络设备,该计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,该指令、该程序、该代码集或该指令集由处理器加载并执行以实现上述实施例的管理网络设备的方法中网络设备所执行的操作。An embodiment of the present invention further provides a computer-readable storage medium, the computer-readable storage medium is applied to a network device, and the computer-readable storage medium stores at least one instruction, at least a piece of program, a code set or an instruction set, the The instructions, the program, the code set or the instruction set are loaded and executed by the processor to implement the operations performed by the network device in the method for managing the network device in the above-mentioned embodiments.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的发明构思之内,所作的任何修改、替换、改进等,均应包含在本公开的保护范围之内。The above descriptions are only optional embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modification, replacement, improvement, etc. made within the inventive concept of the present disclosure should be included in the protection scope of the present disclosure. Inside.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711162908.2A CN109819059B (en) | 2017-11-21 | 2017-11-21 | Method, device, equipment and storage medium for managing network equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711162908.2A CN109819059B (en) | 2017-11-21 | 2017-11-21 | Method, device, equipment and storage medium for managing network equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109819059A CN109819059A (en) | 2019-05-28 |
| CN109819059B true CN109819059B (en) | 2020-07-28 |
Family
ID=66599526
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711162908.2A Active CN109819059B (en) | 2017-11-21 | 2017-11-21 | Method, device, equipment and storage medium for managing network equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109819059B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11456987B1 (en) | 2021-05-07 | 2022-09-27 | State Farm Mutual Automobile Insurance Company | Systems and methods for automatic internet protocol address management |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113542447A (en) * | 2021-06-30 | 2021-10-22 | 深圳市优克联新技术有限公司 | Method and device for preventing information leakage, terminal equipment and readable storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1456979A (en) * | 2002-05-10 | 2003-11-19 | 智旺全球科技股份有限公司 | Method for providing network service on Internet by using non-fixed IP |
| CN101272407A (en) * | 2008-04-28 | 2008-09-24 | 杭州华三通信技术有限公司 | Caching detecting method, caching detecting device and detection responding device for domain name system |
| CN101753636A (en) * | 2009-12-23 | 2010-06-23 | 新太科技股份有限公司 | Method and system for realizing dynamic domain name visit through uniform communication |
| CN102143509A (en) * | 2010-12-16 | 2011-08-03 | 华为终端有限公司 | Method, device and system for managing wireless repeater by AP |
| CN102333131A (en) * | 2010-07-13 | 2012-01-25 | 中国电信股份有限公司 | Method for providing domain name service, system and agent DNS |
-
2017
- 2017-11-21 CN CN201711162908.2A patent/CN109819059B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1456979A (en) * | 2002-05-10 | 2003-11-19 | 智旺全球科技股份有限公司 | Method for providing network service on Internet by using non-fixed IP |
| CN101272407A (en) * | 2008-04-28 | 2008-09-24 | 杭州华三通信技术有限公司 | Caching detecting method, caching detecting device and detection responding device for domain name system |
| CN101753636A (en) * | 2009-12-23 | 2010-06-23 | 新太科技股份有限公司 | Method and system for realizing dynamic domain name visit through uniform communication |
| CN102333131A (en) * | 2010-07-13 | 2012-01-25 | 中国电信股份有限公司 | Method for providing domain name service, system and agent DNS |
| CN102143509A (en) * | 2010-12-16 | 2011-08-03 | 华为终端有限公司 | Method, device and system for managing wireless repeater by AP |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11456987B1 (en) | 2021-05-07 | 2022-09-27 | State Farm Mutual Automobile Insurance Company | Systems and methods for automatic internet protocol address management |
| US12113769B2 (en) | 2021-05-07 | 2024-10-08 | State Farm Mutual Automobile Insurance Company | Systems and methods for automatic internet protocol address management |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109819059A (en) | 2019-05-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8103795B2 (en) | TCP/IP host name resolution on a private network | |
| US9344397B2 (en) | Client aware DHCP lease management | |
| US20100312875A1 (en) | Automated discovery of monitoring devices on a network | |
| US20120324063A1 (en) | Method, network device, and system for automatically configuring network device in ipv6 network | |
| US9319377B2 (en) | Auto-split DNS | |
| US7774438B2 (en) | Parameter provisioning | |
| WO2019010694A1 (en) | Method and device for acquiring address of local domain name server and authoritative name server | |
| TW201401828A (en) | Cloud server for managing hostnames and IP addresses, and management method for the cloud server | |
| CN102932498A (en) | Virtual machine internet protocol (IP) resource management method of cloud computing platform | |
| CN102143247A (en) | Method for allocating and configuring address, address allocation server and host machine | |
| CN107547674B (en) | Address allocation method and device | |
| CN105208137A (en) | Internet Protocol (IP) address allocation methods, device, server and terminal | |
| US20080177868A1 (en) | Address Provisioning | |
| CN111431912B (en) | Method and device for detecting DHCP hijacking | |
| CN108429824B (en) | Address allocation method and device | |
| CN106657434A (en) | Method and device for checking IP address | |
| CN107896257A (en) | Method, device, device and medium for deploying client subsystem functions | |
| CN109819059B (en) | Method, device, equipment and storage medium for managing network equipment | |
| JP2000112851A (en) | Dynamic domain name system and dynamic domain name management method | |
| EP3048756B1 (en) | Management method and apparatus for dynamic host configuration protocol server and relay | |
| US20070299941A1 (en) | Device identification number based name service | |
| CN111404978A (en) | Data storage method and cloud storage system | |
| CN109120741A (en) | A kind of repeat address detecting method and device, computer readable storage medium | |
| KR100606005B1 (en) | How to manage IP address for IPC | |
| CN106878479B (en) | Address allocation method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |