CN111064824A - Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch - Google Patents

Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch Download PDF

Info

Publication number
CN111064824A
CN111064824A CN201911385859.8A CN201911385859A CN111064824A CN 111064824 A CN111064824 A CN 111064824A CN 201911385859 A CN201911385859 A CN 201911385859A CN 111064824 A CN111064824 A CN 111064824A
Authority
CN
China
Prior art keywords
address
data
port
database file
file table
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.)
Granted
Application number
CN201911385859.8A
Other languages
Chinese (zh)
Other versions
CN111064824B (en
Inventor
刘勇
王少美
陈雪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201911385859.8A priority Critical patent/CN111064824B/en
Publication of CN111064824A publication Critical patent/CN111064824A/en
Application granted granted Critical
Publication of CN111064824B publication Critical patent/CN111064824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for verifying addition and deletion of an IP address of a port of a switch, which comprises the following steps: responding to the received port IP address adding command, and inquiring whether all ports have IP addresses; recording the IP address data of the port with the IP address into a database file table; in response to the fact that the added IP address data is not repeated with the recorded IP address data in the database file table, adding an IP address to a port without the IP address and recording the IP address in the database file table; responding to the data repetition of the added IP address and the data repetition of the recorded IP address in the database file table, and prompting the IP address repetition related information; in response to receiving a command for deleting the port IP address, inquiring data of the IP address in a database file table; and prompting the relevant information of command failure in response to the condition that the IP address data does not exist in the database file table, and deleting the information if the IP address data does not exist. The invention also discloses a device, equipment and a medium. The invention improves the reliability of the switch.

Description

Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for verifying addition and deletion of an IP address of a switch port.
Background
Currently, there are many small and medium-sized enterprises using traditional switches of the Huashi, Huasan and Cisco brands, while large enterprises such as Google, Amazon and Facebook have started to take the lead to use white-brand switches. The former is programmable and the latter is not programmable, as compared to conventional switches. The biggest bright spot of the white-card switch is strong openness, that is, the operating system, software and other aspects of the white-card switch have more choices for users.
The switches are classified according to seven layers of ISO and can be divided into two-layer switches and three-layer switches, the two-layer switches belong to data link layer equipment, can identify MAC address information in a data packet, forward according to MAC addresses, and record the MAC addresses and corresponding ports in an internal address table. Three-layer switching (also called multi-layer switching technology, or IP switching technology) is proposed with respect to the traditional switching concept. As is well known, the conventional switching technique operates at the data link layer, which is the second layer in the OSI network standard model, and the three-layer switching technique achieves high-speed forwarding of data packets at the third layer in the network model. Briefly, the three-layer switching technique is: two-layer switching technology + three-layer forwarding technology.
Various problems exist today because the network operating systems (e.g., sonic, etc.) used by data center switches are themselves open source software and have a short development history. The current SONIC version has no IP address adding and deleting verification mechanism, so that different ports can be configured with the same IP address segment, the whole network data is not communicated, and meanwhile, the chaos of a switch database can be caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a medium for checking addition and deletion of an IP address of a switch port, which can better ensure network security and stability of a switch system.
Based on the above purpose, an aspect of the present invention provides a method for checking addition and deletion of an IP address of a switch port, where the method includes: responding to the received port IP address adding command, and inquiring whether all ports have IP addresses; recording the data of the IP address of the port with the IP address into a database file table; responding to the judgment that the added data of the IP address is not repeated with the data of the recorded IP address in the database file table, adding the IP address to a port without the IP address and recording the added data of the IP address into the database file table; responding to the judgment that the added data of the IP address is repeated with the data of the recorded IP address in the database file table, and prompting the IP address repetition related information; in response to receiving a command for deleting the port IP address, inquiring data of the IP address in a database file table; prompting command failure related information in response to the IP address data not existing in the database file table, and deleting the IP address data in response to the IP address data being queried in the database file table.
In some embodiments of the method for verifying addition and deletion of an IP address of a switch port of the present invention, in response to determining that data of an added IP address is not duplicated with data of an IP address already recorded in a database file table, adding an IP address to a port where no IP address exists and recording the data of the added IP address in the database file table further includes:
responding to the situation that the added IP address and the data of the recorded IP address in the database file table are not repeated, and verifying whether the added IP address meets the IP address classification standard or not;
and in response to the added IP address meeting the IP address classification standard, adding the IP address to the port without the IP address and recording the data of the IP address into a database file table.
In some embodiments of the method for verifying the addition or deletion of the IP address of the switch port, the database file table includes port data and data of the IP address corresponding to the port, and the database file table is configured to perform a data update operation at preset time intervals.
In some embodiments of the method for checking addition and deletion of an IP address of a switch port of the present invention, the method further includes: responding to the end of each data updating operation, and detecting whether an IP address exists in a port of the switch or not within preset time; and responding to the existence of the IP address, and recording the data of the IP address and the data of the port corresponding to the IP address into a database file table.
In some embodiments of the method for checking addition and deletion of an IP address of a switch port of the present invention, the method further includes: and directly triggering the data updating operation in response to receiving a command of adding the port IP address or receiving a command of deleting the port IP address.
In another aspect of the embodiments of the present invention, a device for verifying addition and deletion of an IP address of a switch port is further provided, where the device includes: the adding command module is configured to respond to the received port IP address adding command and inquire whether IP addresses exist in all ports or not; the port IP address recording module is configured to record the data of the IP address of the port with the IP address into a database file table; the adding and checking module is configured to respond to the fact that the data of the added IP address is not repeated with the data of the recorded IP address in the database file table, add the IP address to a port without the IP address and record the data of the added IP address into the database file table; the adding failure prompting module is configured to respond to judgment that the added data of the IP address is repeated with the data of the IP address recorded in the database file table and prompt related information of the IP address repetition; the deleting command module is configured to respond to a received port IP address deleting command and inquire the data of the IP address in the database file table; and the deletion checking module is configured to prompt the command failure related information in response to the IP address data which is inquired in the database file table does not exist, and delete the IP address data in response to the IP address data which is inquired in the database file table.
In some embodiments of the apparatus for checking addition and deletion of an IP address of a switch port of the present invention, the addition checking module is further configured to: responding to the situation that the added IP address and the data of the recorded IP address in the database file table are not repeated, and verifying whether the added IP address meets the IP address classification standard or not; and in response to the added IP address meeting the IP address classification standard, adding the IP address to a port without the IP address and recording the data of the IP address into a database file table.
In some embodiments of the apparatus for verifying addition and deletion of an IP address of a switch port according to the present invention, the database file table includes port data and data of an IP address corresponding to the port, and the database file table is configured to perform a data update operation at preset time intervals.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and the memory is used for storing a computer program which can run on the processor, and the processor executes the switch port IP address adding and deleting verification method when executing the program.
In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, where the computer-readable storage medium stores a computer program, and is characterized in that the computer program is executed by a processor to execute the foregoing method for checking addition and deletion of an IP address of a switch port.
The invention has at least the following beneficial technical effects: by designing the port IP address adding and deleting verification method, the configuration verification function of the switch can be controlled more reasonably, the problems that different ports of the switch are provided with addresses of the same network segment and IP address network segment errors of the port configuration and the like are solved, the normal operation of the switch service is ensured, and the condition that the switch cannot work normally due to the crash of the whole switch database caused by the wrong configuration can be effectively prevented.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating an embodiment of a method for verifying addition and deletion of an IP address of a port of a switch according to the present invention;
fig. 2 shows an IP address addition flow chart of an embodiment of a switch port IP address add/delete check method according to the invention;
fig. 3 shows an IP address deletion flow diagram of an embodiment of a switch port IP address add-delete check method according to the invention;
fig. 4 shows a db table data update flow diagram of an embodiment of a switch port IP address add-drop verification method according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it is understood that "first" and "second" are only used for convenience of expression and should not be construed as limitations to the embodiments of the present invention, and the descriptions thereof in the following embodiments are omitted.
Based on the above purpose, a first aspect of the embodiments of the present invention provides an embodiment of a method for checking addition and deletion of an IP address of a switch port. Fig. 1 is a schematic diagram illustrating an embodiment of a method for checking addition and deletion of an IP address of a switch port according to the present invention. In the embodiment shown in fig. 1, the method comprises at least the following steps:
s100, responding to the received port IP address adding command, and inquiring whether all ports have IP addresses;
s200, recording the data of the IP address of the port with the IP address into a database file table;
s300, in response to the judgment that the added data of the IP address is not repeated with the data of the recorded IP address in the database file table, adding the IP address to a port without the IP address and recording the added data of the IP address into the database file table;
s400, responding to the judgment that the added data of the IP address is repeated with the data of the recorded IP address in the database file table, and prompting the IP address repetition related information;
s500, responding to a received command for deleting the port IP address, and inquiring data of the IP address in a database file table;
s600, prompting relevant command failure information in response to the fact that IP address data do not exist in the database file table in a query mode, and deleting the IP address data in response to the fact that the IP address data are queried in the database file table.
In some embodiments of the present invention, the method automatically queries the IP address status of the switch port to form a db (database file) table corresponding to the port and the IP address, and fig. 2 is a flowchart illustrating an IP address adding process according to an embodiment of the IP address adding and deleting verification method for the switch port according to the present invention, as shown in fig. 2, if the IP address exists in the port, the IP address is added to the db table, and the port does not exist but exists in the db table, and the corresponding entry in the table is directly deleted. When the switch port is used as a three-layer port for data forwarding, an IP address field needs to be configured for each port, and the IP address field needs to be paid attention to when adding the port and cannot be the same as the IP addresses of other ports, so that a port IP address adding and checking mechanism is designed. And during adding, inquiring the db table, checking whether the IP address exists, and if so, indicating an error if the adding is unsuccessful. In the using process, a networking mode can be changed according to the actual using condition of a current user, the IP address of a port is changed, the IP address needs to be deleted firstly in the changing process, an IP address error written when an operator operates the network operating system can occur in the deleting process, but the network operating system of the current data center white board switch does not have an IP address deletion checking method, so the error can not be reported, the completed port IP address deletion checking mechanism is designed through the whole logic analysis, and the function stability of the switch is ensured. Fig. 3 is a flowchart illustrating an IP address deletion process according to an embodiment of the method for checking addition and deletion of an IP address of a switch port of the present invention, as shown in fig. 3, when deleting, querying a db table, and determining whether a matching port and an IP address exist, if so, directly deleting the table entry in the table, and not directly reporting an error.
According to some embodiments of the method for verifying addition and deletion of an IP address of a switch port, in response to determining that data of an added IP address is not duplicated with data of an IP address already recorded in a database file table, adding an IP address to a port where no IP address exists and recording the data of the added IP address in the database file table further includes:
responding to the situation that the added IP address and the data of the recorded IP address in the database file table are not repeated, and verifying whether the added IP address meets the IP address classification standard or not;
and in response to the added IP address meeting the IP address classification standard, adding the IP address to the port without the IP address and recording the data of the IP address into a database file table.
In some embodiments of the present invention, it is verified whether the added IP address meets the IP address classification standard, and when the added IP address does not meet the IP address classification standard, information that the format of the IP address is incorrect is prompted, and the added IP address is not added to the port. The operator can check the IP address according to the prompt. If all the ports are inquired to have no IP address, the IP address can be directly added, whether the added IP address meets the IP address classification standard needs to be verified, and the added IP address can be added to the ports and recorded in the database file table only if the added IP address meets the classification standard.
According to some embodiments of the method for verifying the addition and deletion of the IP address of the switch port, the database file table includes port data and data of the IP address corresponding to the port, and the database file table is configured to perform a data update operation at preset time intervals.
In some embodiments of the present invention, the update operation cycles every 5 seconds, automatically updating the db table containing port data and IP address data corresponding to the ports.
According to some embodiments of the method for checking addition and deletion of an IP address of a switch port of the present invention, the method further comprises:
responding to the end of each data updating operation, and detecting whether an IP address exists in a port of the switch or not within preset time; and responding to the existence of the IP address, and recording the data of the IP address and the data of the port corresponding to the IP address into a database file table.
Fig. 4 shows a flowchart of updating db table data according to an embodiment of the method for checking addition and deletion of an IP address of a switch port of the present invention, as shown in fig. 4, in some embodiments of the present invention, in a cycle period of 5 seconds after each time of automatically updating a db table containing port data and IP address data corresponding to a port, an operation is performed to find whether an IP address exists at the switch port, when the IP address exists at the switch port, the port data and the IP address data corresponding to the port are written into the db table, and a next cycle period is started after the 5 second cycle period is finished. If no IP address exists in the port of the switch, directly waiting for the 5-second period to end and entering the next cycle period.
According to some embodiments of the method for checking addition and deletion of an IP address of a switch port of the present invention, the method further comprises:
and directly triggering the data updating operation in response to receiving a command of adding the port IP address or receiving a command of deleting the port IP address.
In some embodiments of the present invention, when a command for adding a port IP address is received or a command for deleting a port IP address is received, no matter where the updated cycle period is proceeding, the previous cycle process may be interrupted and the cycle may be restarted, that is, a new cycle period may be immediately started, whether an IP address exists at a switch port may be searched for, when the switch port is found to have an IP address, the port data and the IP address data corresponding to the port are written into the db table, and the next cycle period may be started after the 5 second period is finished. If no IP address exists in the port of the switch, directly waiting for the 5-second period to end and entering the next cycle period.
On the other hand, the embodiment of the invention provides an embodiment of a device for verifying addition and deletion of an IP address of a port of a switch. The device includes:
s100, an adding command module, wherein the adding command module is configured to respond to the received port IP address adding command and inquire whether IP addresses exist in all ports or not;
s200, a port IP address recording module, wherein the port IP address recording module is configured to record the data of the IP address of the port with the IP address into a database file table;
s300, an adding and checking module, wherein the adding and checking module is configured to respond to the fact that the data of the added IP address is not repeated with the data of the recorded IP address in the database file table, add the IP address to a port without the IP address and record the data of the added IP address in the database file table;
s400, an addition failure prompt module configured to prompt IP address repetition related information in response to judging that the added data of the IP address is repeated with the data of the recorded IP address in the database file table;
s500, a deleting command module, wherein the deleting command module is configured to respond to a received port IP address deleting command and inquire data of an IP address in a database file table;
s600, a deleting and checking module, wherein the deleting and checking module is configured to prompt relevant command failure information in response to the condition that IP address data does not exist in the database file table, and delete the IP address data in response to the condition that the IP address data is inquired in the database file table.
According to some embodiments of the apparatus for checking addition and deletion of an IP address of a switch port of the present invention, the addition checking module is further configured to:
responding to the situation that the added IP address and the data of the recorded IP address in the database file table are not repeated, and verifying whether the added IP address meets the IP address classification standard or not; and in response to the added IP address meeting the IP address classification standard, adding the IP address to a port without the IP address and recording the data of the IP address into a database file table.
According to some embodiments of the apparatus for verifying addition and deletion of an IP address of a switch port, a database file table includes port data and data of an IP address corresponding to the port, and the database file table is configured to perform a data update operation at a preset time interval.
In view of the above object, another aspect of the embodiments of the present invention further provides a computer device, including: at least one processor; and the memory is used for storing a computer program which can run on the processor, and the processor executes the switch port IP address adding and deleting verification method when executing the program.
In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, where the computer-readable storage medium stores a computer program, and is characterized in that the computer program is executed by a processor to execute the foregoing method for checking addition and deletion of an IP address of a switch port.
Likewise, those skilled in the art will appreciate that all of the embodiments, features and advantages set forth above with respect to the switch port IP address add-drop verification method according to the present invention apply equally to the apparatus, computer devices and media according to the present invention. For the sake of brevity of the present disclosure, no repeated explanation is provided herein.
It should be particularly noted that, steps in the embodiments of the method, the apparatus, the device and the medium for verifying addition and deletion of an IP address of a switch port described above may be intersected, replaced, added and deleted, so that these reasonable permutation and combination transformations of the method, the apparatus, the device and the medium for verifying addition and deletion of an IP address of a switch port also belong to the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.
Finally, it should be noted that, as those skilled in the art can understand, all or part of the processes in the method according to the above embodiments may be implemented by a computer program to instruct related hardware to complete the process, and the program of the method for checking the IP address of the switch port by adding and deleting may be stored in a computer readable storage medium, and when executed, the program may include the processes according to the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for checking addition and deletion of an IP address of a switch port is characterized by comprising the following steps:
responding to the received port IP address adding command, and inquiring whether all ports have IP addresses;
recording the data of the IP address of the port with the IP address into a database file table;
in response to the judgment that the added data of the IP address is not repeated with the data of the IP address already recorded in the database file table, adding the IP address to one port without the IP address and recording the added data of the IP address into the database file table;
responding to the judgment that the added IP address data is repeated with the recorded IP address data in the database file table, and prompting IP address repetition related information;
in response to receiving a command for deleting a port IP address, inquiring data of the IP address in the database file table;
prompting command failure related information in response to the IP address data not existing in the database file table, and deleting the IP address data in response to the IP address data being queried in the database file table.
2. The method according to claim 1, wherein the adding and deleting the IP address to the port without an IP address and recording the added data of the IP address into the database file table in response to determining that the added data of the IP address is not duplicated with the data of the IP address already recorded in the database file table further comprises:
verifying whether the added IP address meets IP address classification criteria or not in response to the added IP address not being repeated with data of the IP address already recorded in the database file table;
and in response to the added IP address meeting an IP address classification standard, adding the IP address to the port without the IP address and recording the data of the IP address into the database file table.
3. The method according to claim 1, wherein the database file table includes the port data and the data of the IP address corresponding to the port, and the database file table is configured to perform a data update operation at a preset time interval.
4. The method for checking addition and deletion of an IP address of a switch port according to claim 3, further comprising:
responding to the end of each data updating operation, and detecting whether the IP address exists in the port of the switch or not within preset time;
and responding to the existence of the IP address, and recording the data of the IP address and the data of the port corresponding to the IP address into the database file table.
5. The method for checking addition and deletion of an IP address of a switch port according to claim 3, further comprising:
and directly triggering data updating operation in response to receiving the command of adding the port IP address or receiving the command of deleting the port IP address.
6. An apparatus for checking addition and deletion of an IP address of a port of a switch, the apparatus comprising:
an add command module configured to query whether all ports have IP addresses in response to receiving a port IP address add command;
a port IP address recording module configured to record data of the IP address of the port having an IP address into a database file table;
an adding and checking module configured to add the IP address to one of the ports having no IP address and record the added data of the IP address in the database file table in response to a determination that the added data of the IP address is not duplicated with the data of the IP address already recorded in the database file table;
an addition failure prompt module configured to prompt an IP address repetition related information in response to a determination that the data of the added IP address is repeated with the data of the IP address already recorded in the database file table;
a delete command module configured to query the database file table for data of a port IP address in response to receiving a command to delete the IP address;
a deletion check module configured to prompt for command failure related information in response to querying the database file table for absence of the IP address data, and to delete the IP address data in response to querying the database file table for the IP address data.
7. The apparatus according to claim 6, wherein the add/delete checking module is further configured to:
verifying whether the added IP address meets IP address classification criteria or not in response to the added IP address not being repeated with data of the IP address already recorded in the database file table;
and in response to the added IP address meeting the IP address classification standard, adding the IP address to one port without the IP address and recording the data of the IP address into the database file table.
8. The apparatus according to claim 6, wherein the database file table includes the port data and the data of the IP address corresponding to the port, and the database file table is configured to perform a data update operation at a preset time interval.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor, when executing the program, performs the method of any of claims 1-5.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 5.
CN201911385859.8A 2019-12-29 2019-12-29 Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch Active CN111064824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911385859.8A CN111064824B (en) 2019-12-29 2019-12-29 Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911385859.8A CN111064824B (en) 2019-12-29 2019-12-29 Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch

Publications (2)

Publication Number Publication Date
CN111064824A true CN111064824A (en) 2020-04-24
CN111064824B CN111064824B (en) 2022-05-13

Family

ID=70302770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911385859.8A Active CN111064824B (en) 2019-12-29 2019-12-29 Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch

Country Status (1)

Country Link
CN (1) CN111064824B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744572A (en) * 2005-08-31 2006-03-08 杭州华为三康技术有限公司 Switchnig equipment and method for controlling multicasting data forwarding
CN101552677A (en) * 2009-05-12 2009-10-07 杭州华三通信技术有限公司 Processing method and exchange equipment for address detected message
CN102137073A (en) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 Method and access equipment for preventing imitating internet protocol (IP) address to attack
US8543554B1 (en) * 2010-08-10 2013-09-24 ScalArc Inc. Method and system for transparent database query caching
CN103957288A (en) * 2014-04-28 2014-07-30 福建星网锐捷网络有限公司 Method, device and equipment for IP address dynamic allocation
CN105704036A (en) * 2014-11-27 2016-06-22 华为技术有限公司 Message forwarding method, apparatus, and system
CN107800629A (en) * 2016-09-07 2018-03-13 中兴通讯股份有限公司 A kind of message forwarding method and routing device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744572A (en) * 2005-08-31 2006-03-08 杭州华为三康技术有限公司 Switchnig equipment and method for controlling multicasting data forwarding
CN101552677A (en) * 2009-05-12 2009-10-07 杭州华三通信技术有限公司 Processing method and exchange equipment for address detected message
CN102137073A (en) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 Method and access equipment for preventing imitating internet protocol (IP) address to attack
US8543554B1 (en) * 2010-08-10 2013-09-24 ScalArc Inc. Method and system for transparent database query caching
CN103957288A (en) * 2014-04-28 2014-07-30 福建星网锐捷网络有限公司 Method, device and equipment for IP address dynamic allocation
CN105704036A (en) * 2014-11-27 2016-06-22 华为技术有限公司 Message forwarding method, apparatus, and system
CN107800629A (en) * 2016-09-07 2018-03-13 中兴通讯股份有限公司 A kind of message forwarding method and routing device

Also Published As

Publication number Publication date
CN111064824B (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN111585845B (en) Method, device and equipment for detecting network card node performance and readable medium
US9912576B2 (en) Method and system for detecting normalization of forwarding behavior of router in core routing area
JP2018509841A (en) Mobile terminal, maintenance server, and method and apparatus for maintaining virtual SIM card
CN111143106A (en) Repair method, device, equipment and medium for dual-port SSD
CN111726246A (en) Main/standby network card switching method and device in network card binding mode and storage medium
CN110806964A (en) Method and equipment for lighting hard disk and storage medium
CN114500467A (en) Address conflict detection method, address conflict detection device and electronic equipment
CN111030892B (en) Method, equipment and medium for testing network function in BMC NCSI adaptive mode
CN107547400B (en) Virtual machine migration method and device
CN111064824B (en) Method, device, equipment and medium for verifying addition and deletion of IP address of port of switch
CN111176932B (en) Method and device for recording abnormal event log and readable medium
CN111309264B (en) Method, system, device and medium for making directory quota compatible with snapshot
CN111309553B (en) Method, system, equipment and medium for monitoring storage Jbod
CN111290902B (en) Switch port pressure testing method, device, equipment and medium
CN111193677B (en) Method, device and medium for attributing FC (fiber channel) port of host to corresponding host
CN111092747A (en) Method, device and medium for network performance diagnosis
CN111130976B (en) Method, equipment and medium for configuring virtual local area network of white box switch
CN106713592A (en) Mobile terminal recording method and mobile terminal
CN111090625A (en) Method, device and medium for compressing management log
CN110875930A (en) Method, equipment and medium for monitoring trusted state
CN110912760B (en) Link state detection method and device
CN114157639B (en) Method, device and equipment for collecting information of intelligent network card of server and readable medium
CN105760283A (en) Log output method and device
CN109977097B (en) Network configuration management method and system based on database
CN113448512A (en) Takeover method, device and equipment for cache partition recovery and readable medium

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