LAN switch configuration method and device
Through the controller's whitelist and websocket connection, the VLAN virtual interface and static routing of the LAN switch are automatically configured, solving the problem of manual configuration errors, simplifying configuration and improving the efficiency of automated management.
Patent Information
- Application Number
- CN202310273012.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-03-16
AI Technical Summary
In a three-layer network, LAN switch configuration requires manual operation, which is prone to errors and difficult to troubleshoot. This creates an unfriendly user experience and affects the efficiency of automated management.
Through the controller preset whitelist list, based on the device serial number and websocket connection, the VLAN virtual interface and static route of the LAN switch are automatically configured, the downstream interface information is obtained, and automatic configuration is performed based on the topology information.
It simplifies the configuration process of LAN switches, reduces the probability of errors, improves the reliability and efficiency of automated management, and supports automatic aggregation and topology link processing.
Smart Images

Figure CN116389241B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a local area network switch configuration method and device. Background Art
[0002] In a three-layer network, a LAN switch (LSW) is required to ensure connectivity between devices and the controller. That is, all three layer devices in the network (spine, leaf, and access) need to connect to the controller through the LSW.
[0003] In current controller automation and new automation solutions, users must first connect the network cables and manually configure the LSW before managing devices. This ensures that downstream devices can communicate with the controller before initiating the automated management process. However, manual configuration requires maintenance personnel to enter specific configuration commands on the devices, distributing different configurations to different ports. This lacks automated distribution, making it prone to errors and difficult to troubleshoot, making it less user-friendly. Summary of the Invention
[0004] The present application provides a local area network switch configuration method and device.
[0005] In a first aspect, the present application provides a local area network switch configuration method, which is applied to a controller, wherein a whitelist of devices to be managed is preset on the controller, and the whitelist includes the device serial number and device role of the device to be managed; the method comprises:
[0006] After detecting that a websocket connection is established with a target network device, obtaining a target device serial number of the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface is created for the target network device and the IP address of the first VLAN is configured as an IP address of a first network segment;
[0007] Based on the target device serial number and the whitelist, determining whether the target network device is a local area network switch;
[0008] If so, configure a second VLAN virtual interface of the target network device, configure the IP address of the second VLAN virtual interface to the IP address of the second network segment, and configure a static route from the target network device to the controller;
[0009] Manage the target network device, obtain the downlink interface information of the target network device used to connect to the lower-layer device, and configure the downlink interface to pass all VLANs.
[0010] Optionally, the DHCP function is enabled on the target network device, and the DHCP relay function is enabled on the first VLAN virtual interface; in the network, the access device is connected to the leaf device, the leaf device is connected to the spine device, the spine device is connected to the local area network switch, and the local area network switch is directly connected to the controller; the method further includes:
[0011] After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller;
[0012] After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
[0013] Optionally, the step of delivering the configuration to each lower-layer device specifically includes:
[0014] Configuring a second VLAN virtual interface for each lower-layer device, configuring the IP address of the second VLAN virtual interface to be the IP address of the second network segment, and configuring a static route from each lower-layer device to the controller;
[0015] Determine the device role of each next-layer device based on the device serial number and the whitelist list of each next-layer device;
[0016] Based on the device role of the next layer device, a networking configuration corresponding to the device role is determined, and the networking configuration is sent to the next layer device.
[0017] Optionally, after determining that the target network device is a local area network switch, the method further includes:
[0018] Obtain the first network segment IP address of the target network device, determine the fabric to which the target network device belongs, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, execute the steps of configuring the second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route from the target network device to the controller; otherwise, end the process.
[0019] Optionally, after managing the target network device, obtaining downlink interface information of the target network device for connecting to lower-layer devices, and configuring the downlink interface to pass all VLANs, the method further includes:
[0020] If a configuration retraction instruction triggered by a user is received, it is determined that no downlink interface of a lower layer device is connected to the target network device, and the configuration sent to the downlink interface is retracted.
[0021] Optionally, the method further includes:
[0022] Based on the topology information, determine whether there are multiple interconnected ports between the target network device and each Spine device. If so, instruct the target network device and the corresponding Spine device to create an aggregation group based on the multiple interconnected ports, and maintain the relevant information of the created aggregation group locally.
[0023] In a second aspect, the present application provides a local area network switch configuration device, which is applied to a controller, wherein a whitelist of devices to be managed is preset on the controller, and the whitelist includes the device serial number and device role of the device to be managed; the device comprises:
[0024] an acquiring unit, configured to acquire a target device serial number of the target network device after detecting that a websocket connection is established with the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface has been created for the target network device and the IP address of the first VLAN is configured as an IP address of the first network segment;
[0025] A judging unit, configured to judge whether the target network device is a local area network switch based on the target device serial number and the whitelist;
[0026] Configuration unit, if so, the configuration unit is used to configure the second VLAN virtual interface of the target network device, and configure the IP address of the second VLAN virtual interface to the IP address of the second network segment, and configure the static route from the target network device to the controller;
[0027] The configuration unit is further configured to manage the target network device, obtain downlink interface information of the target network device used to connect to lower-layer devices, and configure the downlink interface to allow all VLANs to pass.
[0028] Optionally, a DHCP function is enabled on the target network device, and a DHCP relay function is enabled on the first VLAN virtual interface; in the network, an access device is connected to a leaf device, a leaf device is connected to a spine device, a spine device is connected to a local area network switch, and the local area network switch is directly connected to the controller; and the configuration unit is further configured to:
[0029] After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller;
[0030] After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
[0031] Optionally, when sending configuration to each lower layer device, the configuration unit is specifically used to
[0032] Configuring a second VLAN virtual interface for each lower-layer device, configuring the IP address of the second VLAN virtual interface to be the IP address of the second network segment, and configuring a static route from each lower-layer device to the controller;
[0033] Determine the device role of each next-layer device based on the device serial number and the whitelist list of each next-layer device;
[0034] Based on the device role of the next layer device, a networking configuration corresponding to the device role is determined, and the networking configuration is sent to the next layer device.
[0035] Optionally, after determining that the target network device is a local area network switch,
[0036] The judgment unit is also used to obtain the first network segment IP address of the target network device, judge the fabric to which the target network device belongs, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, the configuration unit executes the steps of configuring the second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route from the target network device to the controller; otherwise, the process ends.
[0037] Optionally, the device further comprises:
[0038] The recovery unit is configured to, upon receiving a configuration recovery instruction triggered by a user, determine that the target network device is not connected to a downlink interface of a lower layer device, and recover the configuration sent to the downlink interface.
[0039] Optionally, the judgment unit is also used to determine, based on topology information, whether there are multiple interconnected ports between the target network device and each Spine device. If so, instruct the target network device and the corresponding Spine device to create an aggregation group based on the multiple interconnected ports, and locally maintain the relevant information of the created aggregation group.
[0040] In a third aspect, an embodiment of the present application provides a local area network switch configuration device, the local area network switch configuration device comprising:
[0041] a memory configured to store program instructions;
[0042] a processor configured to invoke the program instructions stored in the memory and perform the steps of the method according to any one of the first aspect.
[0043] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium storing computer executable instructions, the computer executable instructions being configured to cause the computer to perform the steps of the method according to any one of the first aspect.
[0044] In summary, the local area network switch configuration method provided by the embodiment of the present application is applied to a controller, the controller is preconfigured with a whitelist list of devices to be managed, the whitelist list includes device serial numbers and device roles of the devices to be managed; the method comprises: after detecting that a websocket connection is established with a target network device, obtaining a target device serial number of the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface is created and an IP address of the first VLAN is configured as an IP address of a first network segment; based on the target device serial number and the whitelist list, determining whether the target network device is a local area network switch; if yes, configuring a second VLAN virtual interface of the target network device, configuring an IP address of the second VLAN virtual interface as an IP address of a second network segment, and configuring a static route of the target network device to the controller; managing the target network device, obtaining downlink interface information of the target network device used to connect lower layer devices, and configuring the downlink interface to pass through all VLANs.
[0045] By using the local area network switch configuration method provided by the embodiment of the present application, the configuration of the LSW can be simplified when the local point is opened, and only the WebSocket connection of the LSW needs to be configured, and other processes are included in the automation process, thereby further improving the automation range of the controller and reducing the probability of configuration errors. When the controller manages the device, the root node of the network can be determined, the topology information, device upgrade, and restart operation can be processed by starting from the root node, the hierarchical relationship of all devices can be calculated according to the topology link information, and the reliability is improved. The uplink port of the Spine is manually configured, and automatic aggregation is supported. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments of the present application or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0047] Figure 1 A schematic diagram of a three-layer networking model provided in an embodiment of the present application;
[0048] Figure 2 A detailed flow chart of a local area network switch configuration method provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the structure of a local area network switch configuration device provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the hardware architecture of a local area network switch configuration device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms "a," "the," and "the" used in this application and claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0052] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" used may also be interpreted as "at the time of" or "when" or "in response to determining".
[0053] For example, see Figure 1The figure shows a schematic diagram of a three-layer networking model provided by an embodiment of the present application. In the networking, an LSW (LAN Switch) is required to ensure the connection between the device and the controller. That is, the three-layer devices in the network in the figure: Spine, Leaf, and Access all need to connect to the controller through the LSW. The lower-layer directly connected device of the LSW is the Spine device, the lower-layer directly connected device of the Spine device is the Leaf device, and the lower-layer directly connected device of the Leaf device is the Access device. APs and wired users access the network through the Access device.
[0054] Currently, managing network devices on a controller requires not only pre-planning the network but also manual configuration of the LSWs used to connect the controller to each layer of network devices. Manual configuration is more complex and error-prone than automated configuration, making it less user-friendly. This inefficiency and complexity of the management process are driving challenges. Improving network management and configuration efficiency and streamlining the configuration process are pressing challenges.
[0055] For example, see Figure 2 FIG. 1 is a detailed flow chart of a method for configuring a local area network switch provided in an embodiment of the present application. The method is applied to a controller, wherein a whitelist of devices to be managed is preset on the controller. The whitelist includes the device serial numbers and device roles of the devices to be managed. The method comprises the following steps:
[0056] Step 200: After detecting that a websocket connection is established with a target network device, obtain a target device serial number of the target network device.
[0057] The target network device initiates a request to establish a websocket connection with the controller after determining that it has created a first VLAN virtual interface and the IP address of the first VLAN is configured as the IP address of the first network segment.
[0058] First, manually configure the physical connections of each device in the network, including the interface (physical connection) of the LSW connection service. Then, the user creates a first VLAN virtual interface (e.g., VLAN 1 virtual interface) on the LSW and assigns an IP address to the first VLAN virtual interface from the preset IP network segment (IP pool) corresponding to VLAN 1.
[0059] In practical applications, the IP address configured on a VLAN virtual interface can be understood as the gateway address of the IP address of that network segment. In the embodiment of the present application, the network of the first VLAN virtual interface (VLAN 1) is used for automatic online access of the LAN switch. Specifically, the LAN switch establishes a WebSocket connection (a three-way handshake) with the controller. During the WebSocket establishment process, the controller can obtain the device serial number of the LAN switch and, further, the VLAN 1 IP address of the LAN switch.
[0060] Step 210: Based on the target device serial number and the whitelist, determine whether the target network device is a local area network switch.
[0061] In the embodiment of the present application, a whitelist is pre-configured on the controller, that is, a list of items corresponding to each device and LSW in the network. For example:
[0062] Device 1: Device serial number (A): Role (LSW);
[0063] Device 2: Device serial number (B): Role (Spine 1);
[0064] Device 3: Device serial number (C): Role (Spine 2);
[0065] Device 4: Device serial number (D): Role (Leaf 1);
[0066] …….
[0067] Then, after receiving the websocket connection established between the target network device and itself, the controller determines the device role of the target network device based on the device serial number of the target network device, and executes corresponding configuration steps according to the determined device role.
[0068] Step 220: If yes, configure a second VLAN virtual interface of the target network device, configure the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configure a static route from the target network device to the controller.
[0069] For example, the controller sends a configuration to the LSW, configuring a second VLAN (e.g., VLAN 4094), a second VLAN virtual interface (e.g., VLAN 4094 virtual interface), and a 4094 gateway address (allocating an IP address in the second network segment to the VLAN 4094 virtual interface). At the same time, a static route is configured for the LSW, which is a static route to the controller.
[0070] In the embodiment of the present application, after determining that the target network device is a LAN switch, the method can further include the following steps:
[0071] The first network segment IP address of the target network device is obtained, the fabric to which the target network device belongs is determined, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, the steps of configuring a second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route of the target network device to the controller are performed, otherwise, the process is ended.
[0072] That is, if the network includes different fabrics, different first network segments can be preset for different fabrics. For example, for fabric1 included in the network, the first VLAN virtual interface (VLAN 1) of each device in fabric1 corresponds to network segment 1, and the first VLAN virtual interface (VLAN 1) of each device in fabric1 corresponds to network segment 2. Then, after determining that the target network device is a LAN switch, the fabric to which the LAN switch belongs can be further determined according to the first VLAN IP address of the target network device. If the fabric is configured with a LAN switch, the target network device is not configured, otherwise, the target network device is configured.
[0073] Step 230: The target network device is managed, the downlink interface information of the target network device used to connect the lower layer device is obtained, and the downlink interface is configured to pass through all VLANs.
[0074] In practical applications, after the controller is managed to the LAN switch, the device port information of the LAN switch can be obtained, such as which downlink interfaces (interfaces used to connect the lower layer Spine device) the LAN switch has, or which interfaces are idle (not configured). Then, an instruction for instructing the interface to pass through all VLANs (VLAN 1-VLAN 4094) is issued to the LAN switch.
[0075] In the embodiment of the present application, the DHCP function is enabled on the target network device, and the DHCP Relay function is enabled on the first VLAN virtual interface; the Access device accesses the Leaf device in the network, the Leaf device accesses the Spine device, the Spine device accesses the LAN switch, and the LAN switch is directly connected to the controller; the method further includes the following steps:
[0076] After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller;
[0077] After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
[0078] In the embodiment of the present application, when sending configurations to each lower-layer device, a preferred implementation method is:
[0079] Configure the second VLAN virtual interface of each next-layer device, configure the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configure the static route from each next-layer device to the controller; determine the device role of the next-layer device based on the device serial number and whitelist list of each next-layer device; determine the networking configuration corresponding to the device role based on the device role of the next-layer device, and send the networking configuration to the next-layer device.
[0080] For example, the link information between the target network device and each Spine device connected to the target network device is obtained, and based on the link information, the IP address of the first network segment is configured for each Spine device respectively, so that each Spine device establishes a websocket connection with the controller; after detecting that a websocket connection is established with each Spine device, the configuration is sent to each Spine device.
[0081] In an embodiment of the present application, after the target network device is managed, the downlink interface information of the target network device used to connect to the lower-layer device is obtained, and the downlink interface is configured to pass all VLANs, if a user-triggered configuration retraction instruction is received, it is determined that there is no downlink interface of the lower-layer device connected to the target network device, and the configuration issued to the downlink interface is retracted.
[0082] For example, after managing and configuring a LAN switch, when automatically configuring other spine, leaf, and access nodes, you may be prompted to "reclaim other interface configurations on the LSW." Specifically, you can choose whether to reclaim other interface configurations on the configuration page. If you select "Yes," all interfaces on the device that have been configured are obtained, and then the interconnection links between the LSW and the spine are determined based on the topology (other interfaces that are not interconnected with the spine can be determined). Finally, the configurations of the remaining interfaces are reclaimed.
[0083] Furthermore, in an embodiment of the present application, based on the topology information, it is determined whether there are multiple interconnected ports between the target network device and each Spine device. If so, the target network device and the corresponding Spine device are instructed to create an aggregation group based on the multiple interconnected ports, and the relevant information of the created aggregation group is maintained locally.
[0084] For example, the controller determines whether the LSW has multiple interconnected ports with each spine device. If so, it instructs the LSW and the corresponding spine device to create an aggregation group. The controller maintains the aggregation group information locally.
[0085] In actual applications, in addition to the existing devices, the nodes displayed on the topology page include newly added LSW nodes. LSW is distinguished from other devices, and the node shape, status color, etc. can be designed separately. LSW devices are not displayed in the network element list, but only on the topology page. LSW devices can right-click on the topology page to select the new function, which allows the deletion of LSW. Right-click to add the function of configuring a downlink port (such as connecting an idle downlink port to a new spine device). Since the configuration of all idle interfaces may be restored after the above automation, if an interface needs to be newly connected to a device, the configuration can be issued separately to a certain interface of the device here.
[0086] For example, see Figure 3 FIG. 1 is a schematic diagram of a configuration device for a local area network switch according to an embodiment of the present invention. The device is applied to a controller, and a whitelist of devices to be managed is preset on the controller. The whitelist includes the device serial numbers and device roles of the devices to be managed. The device includes:
[0087] an acquiring unit 30, configured to acquire a target device serial number of the target network device after detecting that a websocket connection is established with the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface is created for the target network device and the IP address of the first VLAN is configured as an IP address of the first network segment;
[0088] A judging unit 31 is configured to judge whether the target network device is a local area network switch based on the target device serial number and the whitelist;
[0089] Configuration unit 32, if yes, the configuration unit is used to configure the second VLAN virtual interface of the target network device, configure the IP address of the second VLAN virtual interface to the IP address of the second network segment, and configure the static route from the target network device to the controller;
[0090] The configuration unit 32 is further configured to manage the target network device, obtain downlink interface information of the target network device used to connect to lower-layer devices, and configure the downlink interface to allow all VLANs to pass.
[0091] Optionally, a DHCP function is enabled on the target network device, and a DHCP relay function is enabled on the first VLAN virtual interface; in the network, an access device is connected to a leaf device, a leaf device is connected to a spine device, a spine device is connected to a local area network switch, and the local area network switch is directly connected to the controller; and the configuration unit 32 is further configured to:
[0092] After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller;
[0093] After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
[0094] Optionally, when sending configurations to each lower layer device, the configuration unit 32 is specifically configured to
[0095] Configuring a second VLAN virtual interface for each lower-layer device, configuring the IP address of the second VLAN virtual interface to be the IP address of the second network segment, and configuring a static route from each lower-layer device to the controller;
[0096] Determine the device role of each next-layer device based on the device serial number and the whitelist list of each next-layer device;
[0097] Based on the device role of the next layer device, a networking configuration corresponding to the device role is determined, and the networking configuration is sent to the next layer device.
[0098] Optionally, after determining that the target network device is a local area network switch,
[0099] The judgment unit 31 is also used to obtain the first network segment IP address of the target network device, judge the fabric to which the target network device belongs, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, the configuration unit executes the steps of configuring the second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route from the target network device to the controller; otherwise, the process ends.
[0100] Optionally, the device further comprises:
[0101] The recovery unit is configured to, upon receiving a configuration recovery instruction triggered by a user, determine that the target network device is not connected to a downlink interface of a lower layer device, and recover the configuration sent to the downlink interface.
[0102] Optionally, the judgment unit 31 is also used to judge whether there are multiple interconnected ports between the target network device and each Spine device based on topology information. If so, it instructs the target network device and the corresponding Spine device to create an aggregation group based on the multiple interconnected ports, and locally maintains the relevant information of the created aggregation group.
[0103] The above units may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), one or more digital singnal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a unit is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0104] Furthermore, the LAN switch configuration device provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the LAN switch configuration device can be found in Figure 4 As shown, the LAN switch configuration device may include: a memory 40 and a processor 41,
[0105] The memory 40 is used to store program instructions. The processor 41 calls the program instructions stored in the memory 40 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0106] Optionally, the present application also provides a local area network switch configuration device, comprising at least one processing element (or chip) for executing the above method embodiment.
[0107] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above method embodiments.
[0108] Here, the machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage media, or a combination thereof.
[0109] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0110] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0111] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0112] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0113] Furthermore, these computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0115] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A local area network switch configuration method, characterized in that: Applied to a controller, the controller is preset with a whitelist of devices to be managed, the whitelist including the device serial numbers and device roles of the devices to be managed; the method includes: After detecting that a websocket connection is established with a target network device, obtaining a target device serial number of the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface is created for the target network device and the IP address of the first VLAN is configured as an IP address of a first network segment; Based on the target device serial number and the whitelist, determining whether the target network device is a local area network switch; If so, configure a second VLAN virtual interface of the target network device, configure the IP address of the second VLAN virtual interface to the IP address of the second network segment, and configure a static route from the target network device to the controller; Manage the target network device, obtain the downlink interface information of the target network device used to connect to the lower-layer device, and configure the downlink interface to pass all VLANs.
2. The method according to claim 1, wherein The DHCP function is enabled on the target network device, and the DHCP relay function is enabled on the first VLAN virtual interface; in the network, the access device is connected to the leaf device, the leaf device is connected to the spine device, the spine device is connected to the local area network switch, and the local area network switch is directly connected to the controller; the method further includes: After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller; After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
3. The method according to claim 2, wherein The steps for delivering configurations to the next-level devices include: Configuring a second VLAN virtual interface for each lower-layer device, configuring the IP address of the second VLAN virtual interface to be the IP address of the second network segment, and configuring a static route from each lower-layer device to the controller; Determine the device role of each next-layer device based on the device serial number and the whitelist list of each next-layer device; Based on the device role of the next layer device, a networking configuration corresponding to the device role is determined, and the networking configuration is sent to the next layer device.
4. The method according to any one of claims 1 to 3, wherein After determining that the target network device is a local area network switch, the method further includes: Obtain the first network segment IP address of the target network device, determine the fabric to which the target network device belongs, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, execute the steps of configuring the second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route from the target network device to the controller; otherwise, end the process.
5. The method according to claim 4, wherein After managing the target network device, obtaining downlink interface information of the target network device for connecting to lower-layer devices, and configuring the downlink interface to allow all VLANs to pass through, the method further includes: If a configuration retraction instruction triggered by a user is received, it is determined that no downlink interface of a lower layer device is connected to the target network device, and the configuration sent to the downlink interface is retracted.
6. The method according to claim 3, wherein The method further comprises: Based on the topology information, determine whether there are multiple interconnected ports between the target network device and each Spine device. If so, instruct the target network device and the corresponding Spine device to create an aggregation group based on the multiple interconnected ports, and maintain the relevant information of the created aggregation group locally.
7. A local area network switch configuration device, characterized in that: Applied to a controller, the controller is preset with a whitelist of devices to be managed, the whitelist including the device serial numbers and device roles of the devices to be managed; the device includes: an acquiring unit, configured to acquire a target device serial number of the target network device after detecting that a websocket connection is established with the target network device, wherein the target network device initiates a request to establish a websocket connection with the controller after determining that a first VLAN virtual interface has been created for the target network device and the IP address of the first VLAN is configured as an IP address of the first network segment; A judging unit, configured to judge whether the target network device is a local area network switch based on the target device serial number and the whitelist; Configuration unit, if so, the configuration unit is used to configure the second VLAN virtual interface of the target network device, and configure the IP address of the second VLAN virtual interface to the IP address of the second network segment, and configure the static route from the target network device to the controller; The configuration unit is further configured to manage the target network device, obtain downlink interface information of the target network device used to connect to lower-layer devices, and configure the downlink interface to allow all VLANs to pass.
8. The device according to claim 7, wherein The DHCP function is enabled on the target network device, and the DHCP relay function is enabled on the first VLAN virtual interface; in the network, the access device is connected to the leaf device, the leaf device is connected to the spine device, the spine device is connected to the local area network switch, and the local area network switch is directly connected to the controller; the configuration unit is further used to: After determining that the configuration of the upper-layer device is complete, obtaining link information between the upper-layer device and each lower-layer device connected to the upper-layer device, and based on the link information, configuring an IP address of the first network segment for each lower-layer device, so that each lower-layer device establishes a websocket connection with the controller; After detecting that a websocket connection has been established with each lower-level device, configurations are sent to each lower-level device.
9. The device according to claim 8, wherein When sending configuration to each lower layer device, the configuration unit is specifically used to Configuring a second VLAN virtual interface for each lower-layer device, configuring the IP address of the second VLAN virtual interface to be the IP address of the second network segment, and configuring a static route from each lower-layer device to the controller; Determine the device role of each next-layer device based on the device serial number and the whitelist list of each next-layer device; Based on the device role of the next layer device, a networking configuration corresponding to the device role is determined, and the networking configuration is sent to the next layer device.
10. The device according to any one of claims 7 to 9, characterized in that After determining that the target network device is a local area network switch, The judgment unit is also used to obtain the first network segment IP address of the target network device, judge the fabric to which the target network device belongs, and when it is determined that the fabric to which the target network device belongs is not configured with a LAN switch, the configuration unit executes the steps of configuring the second VLAN virtual interface of the target network device, configuring the IP address of the second VLAN virtual interface as the IP address of the second network segment, and configuring the static route from the target network device to the controller; otherwise, the process ends.
11. A local area network switch configuration device, characterized in that: The local area network switch configuration device includes: a memory for storing program instructions; A processor is configured to call the program instructions stored in the memory and execute the steps of the method according to any one of claims 1 to 6 according to the obtained program instructions.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
DHCP processing method and device, equipment and machine readable storage medium
CN112583947A
Network configuration method and device of Kubernetes cluster and electronic equipment
CN114650223A