CN111130976B - Method, equipment and medium for configuring virtual local area network of white box switch - Google Patents

Method, equipment and medium for configuring virtual local area network of white box switch Download PDF

Info

Publication number
CN111130976B
CN111130976B CN201911117089.9A CN201911117089A CN111130976B CN 111130976 B CN111130976 B CN 111130976B CN 201911117089 A CN201911117089 A CN 201911117089A CN 111130976 B CN111130976 B CN 111130976B
Authority
CN
China
Prior art keywords
address
vlan
local area
area network
virtual local
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
Application number
CN201911117089.9A
Other languages
Chinese (zh)
Other versions
CN111130976A (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 CN201911117089.9A priority Critical patent/CN111130976B/en
Publication of CN111130976A publication Critical patent/CN111130976A/en
Application granted granted Critical
Publication of CN111130976B publication Critical patent/CN111130976B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/695Types of network addresses using masks or ranges 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
    • 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 Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method, equipment and a medium for configuring a virtual local area network of a white box switch, wherein the method comprises the following steps: inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table; in response to receiving a command for configuring the virtual local area network, creating a new virtual local area network ID, and judging whether a new virtual local area network ID exists in a VLAN ID table or not; responding to the situation that no new virtual local area network ID exists in the VLAN ID table, setting an IP address of the new virtual local area network ID, and judging whether the IP address and the existing IP address in the VLAN ID table belong to the same network segment or not; and configuring a mask of the IP address in response to the fact that the IP address and the existing IP address in the VLAN ID table do not belong to the same network segment. The method, the equipment and the medium for configuring the virtual local area network of the white box switch provided by the invention verify the VLAN ID, the IP address and the mask, can prevent the switch from generating the conditions of wrong VLAN name, wrong mask address and the like, and ensure the normal operation of the switch service.

Description

Method, equipment and medium for configuring virtual local area network of white box switch
Technical Field
The present invention relates to the field of a white box switch, and more particularly, to a method, an apparatus, and a readable medium for configuring a virtual local area network of a white box switch.
Background
At present, large internet manufacturers and data centers are willing to adopt white boxes as solutions, on one hand, the usability is very high, on the other hand, the white boxes are provided with functions of decoupling software, so that the cost is reduced, more flexibility is provided, different components and modules are constructed for special requirements of manufacturers, and the white boxes are solutions of users which are suitable for special requirements in special fields. The biggest bright spot of the white box switch is that the white box switch has strong openness, that is, the white box switch has more choices for users in terms of operating systems, software and the like.
With the increasing maturity of the SONIC and the increasing application of the SONIC in the Internet industry, the SONIC + white box switch mode becomes the mainstream access switch of the data center in the future. Since the SONIC system is open source software and has a short development process, various problems exist. The current SONIC version VLAN configuration IP has no VLAN ID adding and deleting verification, mask setting and IP address format verification, so that the problems that the VLAN ID can be configured without verification, an illegal address can be set, the mask is not set and the like can be caused, and the exchanger can not normally communicate seriously.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a device, and a medium for configuring a virtual local area network of a white box switch, which can prevent the switch from having conditions such as a wrong VLAN name, a wrong mask address, and the like by checking a VLAN ID, an IP address, and a mask, and ensure normal operation of a switch service.
Based on the above object, an aspect of the embodiments of the present invention provides a method for configuring a virtual local area network of a white box switch, including the following steps: inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table; in response to receiving a command for configuring a virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table or not; responding to the situation that the new virtual local area network ID does not exist in the VLAN ID table, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address which already exists in the VLAN ID table belong to the same network segment; and responding to the fact that the IP address and the existing IP address in the VLAN ID table do not belong to the same network segment, and configuring a mask of the IP address.
In some embodiments, said configuring the mask of the IP address comprises: judging whether mask setting exists in the command or not; and in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination.
In some embodiments, further comprising: in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table.
In some embodiments, said removing said corresponding IP address from the VLAN ID table comprises: judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and in response to the presence of the ID corresponding to the ID in the vlan ID table, determining whether the corresponding IP address is present and performing deletion based on the determination result.
In some embodiments, the determining whether the corresponding IP address exists comprises: and judging whether the corresponding IP address has a mask or not.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table; in response to receiving a command for configuring a virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table or not; responding to the situation that the new virtual local area network ID does not exist in the VLAN ID table, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address which already exists in the VLAN ID table belong to the same network segment; and responding to the fact that the IP address and the existing IP address in the VLAN ID table do not belong to the same network segment, and configuring a mask of the IP address.
In some embodiments, said configuring the mask of the IP address comprises: judging whether mask setting exists in the command or not; and in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination.
In some embodiments, the steps further comprise: in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table.
In some embodiments, said removing said corresponding IP address from the VLAN ID table comprises: judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and in response to the presence of the ID corresponding to the ID in the vlan ID table, determining whether the corresponding IP address is present and performing deletion based on the determination result.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: by checking the VLAN ID, the IP address and the mask code, the conditions of wrong VLAN names, wrong mask code addresses and the like of the switch can be prevented, and the normal operation of the switch service is ensured.
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 of an embodiment of a method for configuring a virtual local area network of a white box switch according to the present invention;
fig. 2 is a flowchart of an embodiment of a method for configuring a virtual local area network of a white box switch according to the present invention;
fig. 3 is a schematic hardware structure diagram of an embodiment of the method for configuring a virtual local area network of a white box switch provided by 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 should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above-mentioned objects, a first aspect of the embodiments of the present invention provides an embodiment of a method for configuring a virtual local area network of a white box switch. Fig. 1 is a schematic diagram illustrating an embodiment of a method for configuring a virtual local area network of a white box switch according to the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN (virtual local area network) ID table;
s2, responding to the command of receiving the configuration virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table;
s3, responding to the VLAN ID table without the new virtual local area network ID, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the existing IP address in the VLAN ID table belong to the same network segment; and
and S4, configuring the mask of the IP address in response to the fact that the IP address and the IP address already existing in the VLAN ID table do not belong to the same network segment.
The white box switch is a switch with thoroughly separated hardware and software, and when the hardware switch leaves a factory, except BootLoader (software), no software exists, and a customer can additionally purchase software or write software according to own requirements. The existing white box switch added and deleted VLANIP function is imperfect, and has no functions of VLAN ID verification, IP address verification and mask setting, so that error configuration can be issued, the whole network data is not passed, and simultaneously, the database of the switch can be disordered.
And inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table. The configured virtual local area network ID of the white box switch can be inquired in real time, or can be inquired at preset time intervals, and the white box switch can be inquired before a new virtual local area network ID is configured. The queried virtual local area network IDs can be arranged according to a certain sequence to form a VLAN ID table, so that the query of a user is facilitated.
And in response to receiving a command for configuring the virtual local area network, creating a new virtual local area network ID and judging whether the new virtual local area network ID exists in the VLAN ID table. The command to configure the virtual local area network typically includes a VLAN ID, an IP address, and a mask. When a command for configuring the virtual local area network is received, a new virtual local area network ID may be created, but the new virtual local area network ID may already exist in the VLAN ID table, so it is necessary to determine whether the new virtual local area network ID exists in the VLAN ID table, and if the new virtual local area network ID already exists in the VLAN ID table, it may be suggested that the new virtual local area network ID exists.
And responding to the situation that the new virtual local area network ID does not exist in the VLAN ID table, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address which already exists in the VLAN ID table belong to the same network segment. If the new VLAN ID does not exist in the VLAN ID table, the new VLAN ID may be set, and an IP address of the new VLAN ID may be set, and the IP address may be referred to as a first IP address in order to be distinguished from other IP addresses. When the first IP address is added, whether the IP address exists under the VLAN interface or not is judged firstly, if the IP address does not exist, the first IP address can be directly added, if the IP address exists, whether the first IP address and the existing IP address belong to the same network segment or not is verified, if the first IP address and the existing IP address do not belong to the same network segment, whether the first IP address is in compliance or not can be verified, and if the compliance rule is configurable, the configuration of the non-compliance rule fails.
And configuring a mask of the IP address in response to the fact that the IP address and the IP address which already exists in the VLAN ID table do not belong to the same network segment. When the IP address does not belong to the same network segment as the IP address already existing in the VLAN ID table, a mask of the IP address can be configured. In some embodiments, said configuring the mask of the IP address comprises: judging whether mask setting exists in the command or not; and in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination. If the specific mask configuration does not exist in the command, the command is issued according to 32 bits, and if the specific mask configuration exists in the command, whether the mask configuration is in compliance is verified, for example, whether the mask configuration is a number within 1-32 can be verified, and if the mask configuration is exceeded, the configuration is failed.
In some embodiments, further comprising: in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table. In some embodiments, said removing said corresponding IP address from the VLAN ID table comprises: judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and in response to the presence of an ID corresponding to the ID in the VLAN ID table, determining whether the corresponding IP address is present and performing deletion based on the determination result. In some embodiments, the determining whether the corresponding IP address exists comprises: and judging whether the corresponding IP address has a mask or not.
Fig. 2 is a flowchart illustrating an embodiment of a method for configuring a virtual local area network of a white box switch according to the present invention. As shown in fig. 2, starting at block 101 and proceeding to block 102, the box switch is queried for the virtual local area network ID that it has configured and forms a VLAN ID table; continuing to block 103, in response to receiving a command to configure a virtual local area network, a new virtual local area network ID is created; proceeding to block 104, determining whether the new VLAN ID exists in the VLAN ID table, if yes, ending directly, if no, proceeding to block 105, and setting the IP address of the new VLAN ID; then, the process proceeds to block 106, where it is determined whether the IP address and the existing IP address in the VLAN ID table belong to the same network segment, and if yes, the process ends directly, otherwise, the process proceeds to block 107, where a mask of the IP address is configured, and then the process proceeds to block 108, where the process ends.
It should be particularly noted that, the steps in the embodiments of the method for configuring a whitebox switch vlan described above can be mutually intersected, replaced, added, and deleted, so that these methods for configuring a whitebox switch vlan are also intended to fall within the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above object, a second aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table; s2, responding to the command of receiving the configuration virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table; s3, responding to the VLAN ID table without the new virtual local area network ID, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address already existing in the VLAN ID table belong to the same network segment; and S4, configuring the mask of the IP address in response to the IP address not belonging to the same network segment with the IP address already existing in the VLAN ID table.
In some embodiments, said configuring the mask of the IP address comprises: judging whether mask setting exists in the command or not; and in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination.
In some embodiments, further comprising: in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table.
In some embodiments, said removing said corresponding IP address from the VLAN ID table comprises: judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and in response to the presence of the ID corresponding to the ID in the vlan ID table, determining whether the corresponding IP address is present and performing deletion based on the determination result.
In some embodiments, the determining whether the corresponding IP address exists comprises: and judging whether the corresponding IP address has a mask or not.
Fig. 3 is a schematic hardware structural diagram of an embodiment of the method for configuring a virtual local area network of a white box switch according to the present invention.
Taking the apparatus shown in fig. 3 as an example, the apparatus includes a processor 301 and a memory 302, and may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input device 303 and the output device 304 may be connected by a bus or other means, and fig. 3 illustrates the connection by a bus as an example.
The memory 302 is a non-volatile computer-readable storage medium and can be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for configuring a virtual local area network of a white box switch in the embodiment of the present application. The processor 301 executes various functional applications of the server and data processing by running nonvolatile software programs, instructions and modules stored in the memory 302, that is, implements the method for configuring the virtual local area network of the white box switch of the above-described method embodiment.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of configuring the virtual local area network of the white box switch, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 303 may receive information such as a user name and a password that are input. The output means 304 may comprise a display device such as a display screen.
One or more program instructions/modules corresponding to the method for configuring a virtual local area network of a white box switch are stored in the memory 302 and, when executed by the processor 301, perform the method for configuring a virtual local area network of a white box switch in any of the above-described method embodiments.
Any embodiment of a computer device implementing the method for configuring a virtual local area network of a white box switch described above may achieve the same or similar effects as any of the preceding method embodiments corresponding thereto.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program of the method for configuring a virtual local area network of a white box switch can be stored in a computer readable storage medium, and when executed, the program can include the processes of 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 of configuring a white box switch virtual local area network, comprising the steps of:
inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table;
in response to receiving a command for configuring a virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table or not;
responding to the situation that the new virtual local area network ID does not exist in the VLAN ID table, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address which already exists in the VLAN ID table belong to the same network segment; and
and configuring a mask of the IP address in response to the fact that the IP address and the existing IP address in the VLAN ID table do not belong to the same network segment.
2. The method of claim 1, wherein the configuring the mask for the IP address comprises:
judging whether mask setting exists in the command or not; and
in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination.
3. The method of claim 1, further comprising:
in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table.
4. The method of claim 3, wherein said removing the corresponding IP address from the VLAN ID table comprises:
judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and
in response to the presence of the ID corresponding to the ID in the VLAN ID table, it is determined whether the corresponding IP address is present and deletion is performed based on the determination result.
5. The method of claim 4, wherein the determining whether the corresponding IP address exists comprises:
and judging whether the corresponding IP address has a mask or not.
6. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of:
inquiring the configured virtual local area network ID of the white box switch, and forming a VLAN ID table;
in response to receiving a command for configuring a virtual local area network, creating a new virtual local area network ID, and judging whether the new virtual local area network ID exists in the VLAN ID table or not;
responding to the situation that the new virtual local area network ID does not exist in the VLAN ID table, setting the IP address of the new virtual local area network ID, and judging whether the IP address and the IP address which already exists in the VLAN ID table belong to the same network segment; and
and configuring a mask of the IP address in response to the fact that the IP address and the existing IP address in the VLAN ID table do not belong to the same network segment.
7. The computer device of claim 6, wherein the configuring the mask of the IP address comprises:
judging whether mask setting exists in the command or not; and
in response to the mask setting being present in the command, determining whether the mask setting is a correct number of bits and performing the setting based on the determination.
8. The computer device of claim 6, wherein the steps further comprise:
in response to receiving a command to delete an IP address corresponding to an ID, the corresponding IP address is deleted from the VLAN ID table.
9. The computer device of claim 8, wherein said removing the corresponding IP address from the VLAN ID table comprises:
judging whether the ID corresponding to the ID exists in the VLAN ID table or not; and
in response to the presence of the ID corresponding to the ID in the VLAN ID table, it is determined whether the corresponding IP address is present and deletion is performed based on the determination result.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201911117089.9A 2019-11-15 2019-11-15 Method, equipment and medium for configuring virtual local area network of white box switch Active CN111130976B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911117089.9A CN111130976B (en) 2019-11-15 2019-11-15 Method, equipment and medium for configuring virtual local area network of white box switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911117089.9A CN111130976B (en) 2019-11-15 2019-11-15 Method, equipment and medium for configuring virtual local area network of white box switch

Publications (2)

Publication Number Publication Date
CN111130976A CN111130976A (en) 2020-05-08
CN111130976B true CN111130976B (en) 2022-04-22

Family

ID=70495586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911117089.9A Active CN111130976B (en) 2019-11-15 2019-11-15 Method, equipment and medium for configuring virtual local area network of white box switch

Country Status (1)

Country Link
CN (1) CN111130976B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615139B (en) * 2022-03-17 2023-08-29 苏州浪潮智能科技有限公司 Automatic configuration management method and device for switch, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763407A (en) * 2014-01-28 2014-04-30 上海斐讯数据通信技术有限公司 Method for achieving address resolution protocol proxy through two-layer virtual local area network and local area network system
CN107124307A (en) * 2017-04-24 2017-09-01 紫光华山信息技术有限公司 One kind management VLAN switching methods and device
CN107332812A (en) * 2016-04-29 2017-11-07 新华三技术有限公司 The implementation method and device of NS software
CN107809386A (en) * 2017-11-15 2018-03-16 锐捷网络股份有限公司 IP address conversion method, routing device and communication system
CN108063837A (en) * 2017-12-25 2018-05-22 锐捷网络股份有限公司 Dynamic IP addressing distribution method and device
CN109889421A (en) * 2019-03-06 2019-06-14 乐鑫信息科技(上海)股份有限公司 Management method, device, terminal, system and the storage medium of router

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1332539C (en) * 2003-06-12 2007-08-15 华为技术有限公司 Method for implementing automatic establishment of VPN address pool
US9118561B2 (en) * 2012-11-30 2015-08-25 Cisco Technology, Inc. Network switch and method for automatically establishing connection to a wide area network
CN105393511B (en) * 2014-06-30 2019-04-26 华为技术有限公司 A kind of mode switcher switching method, equipment and system
CN105812260B (en) * 2014-12-31 2019-03-19 华为技术有限公司 A kind of method, apparatus and system that control mac address forwarding table is sent

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763407A (en) * 2014-01-28 2014-04-30 上海斐讯数据通信技术有限公司 Method for achieving address resolution protocol proxy through two-layer virtual local area network and local area network system
CN107332812A (en) * 2016-04-29 2017-11-07 新华三技术有限公司 The implementation method and device of NS software
CN107124307A (en) * 2017-04-24 2017-09-01 紫光华山信息技术有限公司 One kind management VLAN switching methods and device
CN107809386A (en) * 2017-11-15 2018-03-16 锐捷网络股份有限公司 IP address conversion method, routing device and communication system
CN108063837A (en) * 2017-12-25 2018-05-22 锐捷网络股份有限公司 Dynamic IP addressing distribution method and device
CN109889421A (en) * 2019-03-06 2019-06-14 乐鑫信息科技(上海)股份有限公司 Management method, device, terminal, system and the storage medium of router

Also Published As

Publication number Publication date
CN111130976A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN110427342B (en) Method, equipment and readable medium for creating mirror library
CN111177043B (en) Method, system, device and medium for accelerating reading of field replaceable unit information
CN111090545B (en) Method, device and medium for recovering failed CPLD
CN110519329B (en) Method, device and readable medium for concurrently processing samba protocol request
CN111030892B (en) Method, equipment and medium for testing network function in BMC NCSI adaptive mode
CN109446093B (en) Method and device for testing expansion platform interface
CN112383402B (en) Dual idempotent verification method and server
CN112118132A (en) Method, device and equipment for upgrading switch firmware and readable medium
CN111708482B (en) Method, system, device and medium for limiting bandwidth in distributed storage
CN107888563B (en) Method and device for determining terminal access position
CN111130976B (en) Method, equipment and medium for configuring virtual local area network of white box switch
CN111813507A (en) Method, system, equipment and medium for high availability of virtual machine based on sanlock
CN111309264B (en) Method, system, device and medium for making directory quota compatible with snapshot
CN111355716B (en) Method, system, equipment and medium for determining unique identifier of virtual machine
CN111045989A (en) Method, device and medium for querying CPLD version information
CN111193818A (en) Method, system, equipment and medium for obtaining IP address
CN111858538B (en) Method, device, equipment and medium for configuring BeeGFS quota by cluster
CN111722959B (en) Method, system, equipment and medium for expanding storage pool
CN111427756B (en) Method, system, equipment and medium for carrying out mixed pressure test on single hard disk
CN110266546B (en) Method, equipment and readable medium for configuring switch port
CN105630850A (en) Method and system for verifying data of distributed database in real time
CN111586203B (en) Method, device and equipment for storing IP configuration and readable medium
CN111125678A (en) Method, device and medium for managing Option ROM loading
CN111124566A (en) BMC user interface operation management method, equipment and readable medium
CN110968489B (en) Method, equipment and medium for testing BMC (baseboard management controller) access pressure of white box switch

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