A network card automatic binding method, device, equipment, medium and program product

By using an automated NIC bonding method, NIC bonding configuration information is obtained and a configuration request is generated. The switch is configured with port aggregation status, and the host is configured with the target physical NIC. This solves the problems of low efficiency and insufficient accuracy in NIC bonding configuration, and achieves efficient and accurate NIC bonding.

CN119402446BActive Publication Date: 2026-03-24LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, network card binding requires manual configuration, resulting in low configuration efficiency and unreliable accuracy.

Method used

By obtaining network interface card (NIC) binding configuration information, the target physical NIC is automatically determined and a configuration request is generated. The switch sets the port aggregation status according to the interface address, and the host configures the target physical NIC according to the working mode information, thus realizing automated port binding on both the NIC and switch sides.

Benefits of technology

It improves the efficiency and accuracy of network card binding, avoids resource waste caused by unsuccessful binding of switch ports, and reduces the risk of human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402446B_ABST
    Figure CN119402446B_ABST
Patent Text Reader

Abstract

The application discloses a network card automatic binding method, device, equipment, medium and program product, and relates to the field of computer network communication. The method comprises the following steps: obtaining a network card binding configuration; the network card binding configuration comprises working mode information and physical network card port information of at least two physical network cards; determining a corresponding target physical network card according to the physical network card port information; generating a configuration request according to the working mode information and the interface address of the target physical network card, and sending the configuration request to a switch; the switch determines that the interface address of the target physical network card corresponds to a target port on the switch, and sets the target port to a corresponding port aggregation state according to the working mode information; and configuring the target physical network card according to the working mode information to bind all the target physical network cards. The method can realize automatic binding of the network card side and the switch side ports, and improve the efficiency and accuracy of network card binding.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer network communication, and in particular to a network card automatic binding method, device, equipment, medium and program product. BACKGROUND

[0002] Network card binding (also known as network card binding, Bond technology) is to solve the problems of network reliability and bandwidth improvement by binding multiple physical network cards into a virtual network card. Network card binding makes multiple network cards appear as a single Ethernet interface device to the outside world and have the same IP (Internet Protocol) address.

[0003] In related technologies, an engineer usually selects physical network ports that need to be bound and configured from multiple physical network cards on a host according to a network topology, and manually virtualizes multiple physical network cards into a virtual network card. Then, port configuration needs to be performed on a switch. Manual binding and configuration are performed, and configuration needs to be performed on the host side first and then on the switch side, which is low in configuration efficiency and cannot guarantee configuration accuracy. SUMMARY

[0004] Therefore, the present application aims to provide a network card automatic binding method, device, equipment, medium and program product, which can realize automatic binding of network card side and switch side ports. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a network card automatic binding method applied to a host, including:

[0006] Obtaining network card binding configuration; the network card binding configuration includes working mode information and physical network card port information of at least two physical network cards;

[0007] Determining corresponding target physical network cards according to the physical network card port information;

[0008] Generating a configuration request according to the working mode information and the interface address of the target physical network card, and sending the configuration request to a switch; the switch determines a target port corresponding to the interface address of the target physical network card on the switch, and sets the target port to a corresponding port aggregation state according to the working mode information;

[0009] Configuring the target physical network cards according to the working mode information to bind all the target physical network cards.

[0010] Optionally, the obtaining of the network card binding configuration includes:

[0011] Obtain the network card binding instruction, and display the network configuration interface on the human-computer interaction interface according to the network card binding instruction;

[0012] The network card binding configuration is obtained through the network configuration interface.

[0013] Optionally, configuring the target physical network interface card according to the working mode information includes:

[0014] Generate a corresponding configuration file based on the working mode information;

[0015] Apply the configuration file to the target physical network interface card.

[0016] Optionally, before determining the interface address of the target physical network card on the corresponding target port on the switch, the method further includes:

[0017] The switch determines whether all target physical network cards are connected to the local switch based on the interface address of the target physical network card;

[0018] If all the target physical network interface cards are connected to the local switch, the switch determines the target port on the switch corresponding to the interface address of the target physical network interface card.

[0019] Optionally, after determining whether all the target physical network cards are connected to the local switch, the method further includes:

[0020] If the target physical network card is not connected to the local switch, a binding failure message indicating an abnormal connection between the network card and the switch will be generated.

[0021] Optionally, before configuring the target physical network interface card according to the working mode information, the method further includes:

[0022] Obtain the port configuration result sent by the switch; the port configuration result is obtained by the switch after setting the port aggregation state of the target port according to the working mode information, by reading the current port aggregation state of the target port;

[0023] If the port configuration result is successful, then the operation of configuring the target physical network card according to the working mode information is executed;

[0024] Optionally, after obtaining the port configuration result sent by the switch, the method further includes:

[0025] If the port configuration result is unsuccessful, a port configuration failure message will be generated, and the operation of configuring the target physical network card according to the working mode information will not be executed.

[0026] Optionally, the working mode information includes information on any of the following working modes: round-robin load balancing mode, master-slave mode, hash-based load balancing mode, broadcast mode, dynamic link aggregation mode, transmit load balancing mode, and receive-transmit load balancing mode; the port aggregation status is static physical port group, dynamic physical port group, or no physical port group configured.

[0027] Optionally, before generating the configuration request based on the working mode information and the interface address of the target physical network card, the method further includes:

[0028] Check the connection status of the target physical network card; the connection status includes a normal network connection and a disconnected network connection.

[0029] If the connection status of the target physical network card is the normal network connection status, then the operation of generating a configuration request based on the working mode information and the interface address of the target physical network card is executed.

[0030] If the connection status of the target physical network card is the network connection disconnected state, an abnormal status prompt is generated and the instruction selection interface is displayed on the human-computer interaction interface.

[0031] The system receives response instructions from the user based on the status error message through the instruction selection interface. The response instructions include a first instruction and a second instruction, wherein the first instruction is used to indicate termination of the binding operation and the second instruction is used to indicate continuation of the binding operation.

[0032] If the response instruction is the first instruction, then exit the network card binding operation;

[0033] If the response instruction is the second instruction, then the operation of configuring the target physical network card according to the working mode information is executed directly.

[0034] On another front, this application discloses a method for automatic network interface card (NIC) bonding, applied to a switch, comprising:

[0035] The system obtains a configuration request sent by a host; the host is used to obtain network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the system determines the corresponding target physical NIC based on the physical NIC port information; the system generates the configuration request based on the working mode information and the interface address of the target physical NIC; the system configures the target physical NIC based on the working mode information to bind all the target physical NICs.

[0036] The target port on the switch is determined by the interface address of the target physical network card, and the target port is set to the corresponding port aggregation state according to the working mode information.

[0037] In another aspect, this application discloses an automatic network card bonding device, applied to a host, comprising:

[0038] The network interface card (NIC) binding configuration acquisition module is used to acquire NIC binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs;

[0039] The target physical network interface card (NIC) determination module is used to determine the corresponding target physical NIC based on the physical NIC port information.

[0040] The configuration request sending module is used to generate a configuration request based on the working mode information and the interface address of the target physical network card, and send the configuration request to the switch. The switch determines the target port on the switch corresponding to the interface address of the target physical network card, and sets the target port to the corresponding port aggregation state based on the working mode information.

[0041] The network interface card (NIC) binding module is used to configure the target physical NIC according to the working mode information, so as to bind all the target physical NICs.

[0042] In another aspect, this application discloses an automatic network interface card (NIC) bonding device, applied to a switch, comprising:

[0043] A configuration request acquisition module is used to acquire configuration requests sent by a host; the host is used to acquire network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined based on the physical NIC port information; the configuration request is generated based on the working mode information and the interface address of the target physical NIC; the target physical NIC is configured based on the working mode information to bind all the target physical NICs;

[0044] The port configuration module is used to determine the target port on the switch corresponding to the interface address of the target physical network card, and set the target port to the corresponding port aggregation state according to the working mode information.

[0045] In another aspect, this application discloses an electronic device, comprising:

[0046] Memory, used to store computer programs;

[0047] A processor is used to execute the computer program to implement the aforementioned automatic network card binding method.

[0048] In another aspect, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned automatic network card binding method.

[0049] In another aspect, this application discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the aforementioned automatic network card binding method.

[0050] In this application, a network interface card (NIC) binding configuration is obtained; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined based on the physical NIC port information; a configuration request is generated based on the working mode information and the interface address of the target physical NIC, and the configuration request is sent to a switch; the switch determines the target port on the switch corresponding to the interface address of the target physical NIC, and sets the target port to the corresponding port aggregation state based on the working mode information; the target physical NIC is configured based on the working mode information to bind all the target physical NICs. As can be seen, by configuring the working mode information and the port information of the physical network card that needs to be bound, a configuration request is automatically generated and sent to the switch. The switch determines the target port to be bound based on the received configuration request and sets the port aggregation status of the target port according to the working mode information, thus realizing port binding on the switch side. The host side then configures the target physical network card according to the working mode information to realize physical network card binding. This achieves automated port binding on both the network card side and the switch side, eliminating the need for manual operation and improving the efficiency and accuracy of network card binding. Furthermore, by performing switch port binding first and then network card binding, the problem of wasting resources by binding the network card when the switch port cannot be bound is avoided. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0052] Figure 1 A flowchart of an automatic network card binding method provided in this application;

[0053] Figure 2 A flowchart of a specific method for automatic network card binding provided in this application;

[0054] Figure 3 Flowchart of another specific automatic network card binding method provided in this application;

[0055] Figure 4 A schematic diagram of a host-side network interface card automatic binding device is provided in this application;

[0056] Figure 5 This application provides a structural diagram of an electronic device. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] In related technologies, engineers typically select the physical network ports requiring binding configuration from multiple physical network interface cards (NICs) on a host based on the network topology, manually virtualize these multiple physical NICs into a single virtual NIC, and then configure the port on the switch. This manual binding configuration, requiring configuration on the host side followed by switch-side configuration, is inefficient and lacks accuracy. To overcome these technical problems, this application proposes an automatic NIC binding method that automates the binding of ports on both the NIC and switch sides.

[0059] This application discloses a method for automatic network interface card (NIC) binding, applied to a host; see [link to relevant documentation]. Figure 1 As shown, the method may include the following steps:

[0060] Step S11: Obtain network card binding configuration; the network card binding configuration includes working mode information and physical network card port information of at least two physical network cards.

[0061] First, the network interface card (NIC) binding configuration sent by the user is obtained. This configuration includes at least the operating mode information and the physical NIC port information of at least two physical NICs. In other words, the user configures the operating mode for the NICs according to their usage requirements and sends the physical NIC port information of the NICs to be bound. The working principle of NIC binding is to combine multiple physical NICs into a single logical interface. Within this logical interface, data can be distributed across multiple physical NICs, thereby improving transmission speed and bandwidth. NIC binding offers various operating modes, such as round-robin, active-backup, and balance-xor, providing flexible configuration options to adapt to different network needs.

[0062] In some embodiments, obtaining the network interface card (NIC) bonding configuration may include: obtaining a NIC bonding instruction; displaying a network configuration interface on a human-computer interaction interface according to the NIC bonding instruction; and obtaining the NIC bonding configuration through the network configuration interface. That is, the NIC provides a one-click bonding command, allowing the user to enter the host's network configuration interface and execute the one-click bonding command. After execution, the user is prompted to select the bonding type and corresponding port. NIC bonding supports multiple modes, commonly including the following seven: round-robin load balancing (balance-rr), active-backup, hash-based load balancing (balance-xor), broadcast, dynamic link aggregation (802.3ad), transmit load balancing (balance-tlb), and receive load balancing (balance-alb). The user selects one of these working modes for NIC bonding configuration.

[0063] Step S12: Determine the corresponding target physical network card based on the physical network card port information.

[0064] Based on the physical network card port information configured by the user, the physical network card corresponding to that port information is found and used as the target physical network card to be bound.

[0065] Step S13: Generate a configuration request based on the working mode information and the interface address of the target physical network card, and send the configuration request to the switch. The switch determines the target port on the switch corresponding to the interface address of the target physical network card, and sets the target port to the corresponding port aggregation state based on the working mode information.

[0066] The host sends a configuration request to the switch connected by the optical cable, causing the switch to automatically perform port binding upon receiving the request. Specifically, the configuration request includes the aforementioned operating mode information and the interface address of the target physical network card, which can be the MAC address (Media Access Control Address) of the target physical network card interface.

[0067] In other words, after selecting the binding type on the network interface card (NIC), the system sends a configuration request to the switch. This request message contains detailed binding configuration information: operating mode information to specify the user-selected operating mode; port MAC address, i.e., the MAC address of the NIC interface participating in the binding operation, so that the switch can correctly identify and configure these interfaces; and may also include other configuration parameters, such as relevant settings for the Link Aggregation Control Protocol (LACP). After receiving the request message from the NIC, the switch parses this information to obtain the operating mode information and the interface address of the target physical NIC, and then the switch performs an automatic binding operation based on the parsed information.

[0068] In some embodiments, to further improve the success rate of network interface card (NIC) bonding, before generating a configuration request based on the operating mode information and the interface address of the target physical NIC, it is also necessary to detect the NIC connection status, specifically including the following steps:

[0069] S130: Check the connection status of the target physical network card; the connection status includes normal network connection and disconnected network connection.

[0070] Understandably, once the working mode is selected, the program will begin to perform the binding operation; before execution, the system will detect the connection status of the network card to ensure that all interfaces are correctly connected.

[0071] S131: If the connection status of the target physical network card is the normal network connection status, then the operation of generating a configuration request based on the working mode information and the interface address of the target physical network card is executed;

[0072] S132: If the connection status of the target physical network card is the network connection disconnected state, an abnormal status prompt is generated, and the instruction selection interface is displayed on the human-computer interaction interface.

[0073] The system will detect the network card's connection status. If the network card port status is "link up", the binding operation will continue. If the network card port status is "link down", the system will prompt the user that the connection status is abnormal.

[0074] S133: Receive a response instruction sent by the user based on the status error message through the instruction selection interface; the response instruction includes a first instruction and a second instruction, the first instruction being used to indicate termination of the binding operation, and the second instruction being used to indicate continuation of the binding operation;

[0075] S134: If the response instruction is the first instruction, then exit the network card binding operation;

[0076] S135: If the response instruction is the second instruction, then the operation of configuring the target physical network card according to the working mode information is executed directly.

[0077] Understandably, to improve the flexibility of network card binding, when the connection status of the physical network card is "network connection disconnected", the system automatically asks the user whether to continue the binding operation. If the user chooses to give up, the program will exit and record the reason for the interruption. If the user chooses to continue, the program will ignore the abnormal status and directly bind the corresponding port on the host side. After the host side configuration is completed, the program will exit, prompt and record the port status.

[0078] Port aggregation states are specifically categorized as static physical port groups (static portchannel), dynamic physical port groups (dynamic portchannel), or no physical port group (no portchannel). A physical port group (portChannel) is a switch networking technology that aggregates multiple physical ports into a single logical port to distribute data traffic across these physical ports, thereby increasing the overall bandwidth of the link. In other words, the switch side configures static portchannel, dynamic portchannel, or no portchannel for the corresponding ports based on different bond types configured on the network interface card (NIC). Specifically, round-robin load balancing mode (balance-rr) corresponds to static portchannel, active-backup mode corresponds to no portchannel configuration, hash-based load balancing mode (balance-xor) corresponds to static portchannel, broadcast mode corresponds to static portchannel, dynamic link aggregation mode (802.3ad) corresponds to dynamic portchannel, transmit load balancing mode (balance-tlb) corresponds to no portchannel configuration, and transmit / receive load balancing mode (balance-alb) corresponds to no portchannel configuration.

[0079] In some embodiments, before the switch determines the interface address of the target physical network interface card (NIC) to the corresponding target port on the switch, the process may further include: the switch determining whether all target physical NICs are connected to the local switch based on the interface address of the target physical NIC; if all target physical NICs are connected to the local switch, the switch determines the target port on the switch corresponding to the interface address of the target physical NIC; if any target physical NIC is not connected to the local switch, a binding failure message indicating an abnormal connection between the NIC and the switch is generated.

[0080] The switch performs automatic binding based on the parsed information and returns a response message. First, the switch checks if all ports requested for binding by the peer network interface card (NIC) are connected to the switch. If any ports not connected to the switch are found, the switch returns a failure message to the NIC with the specific reason for the failure. If the check is correct, the switch configures the corresponding port as a static portchannel, dynamic portchannel, or no portchannel configured, depending on the configured operating mode. After configuration, the switch returns a success message to the NIC.

[0081] Step S14: Configure the target physical network card according to the working mode information to bind all the target physical network cards.

[0082] After the host side completes the binding process on the switch side, it configures the target physical network interface card (NIC) according to the operating mode information to achieve NIC binding. Specifically, configuring the target physical NIC according to the operating mode information includes: generating a corresponding configuration file based on the operating mode information; and applying the configuration file to the target physical NIC. That is, by automatically generating a configuration file corresponding to the operating mode information and applying it to the target physical NIC, the configuration file becomes effective on the target physical NIC, thus achieving NIC binding.

[0083] Compared to traditional networking methods that involve manual configuration of network interface cards (NICs) and switches to achieve NIC bonding, which is inefficient and lacks accuracy, this application standardizes and simplifies the configuration process for NICs and switches. This reduces the complexity of manual configuration and lowers the risk of human error. Furthermore, it improves fault location efficiency by enabling rapid screening of line or port anomalies.

[0084] In some embodiments, before configuring the target physical network interface card (NIC) according to the working mode information, the process may further include: obtaining the port configuration result sent by the switch; the port configuration result is obtained by the switch after setting the port aggregation state of the target port according to the working mode information, by reading the current port aggregation state of the target port; if the port configuration result is successful, the operation of configuring the target physical NIC according to the working mode information is executed; if the port configuration result is unsuccessful, a port configuration failure message is generated. That is, the NIC will execute the next action based on the message returned by the switch. If the switch returns a failure, the NIC will record the reason for the failure and exit the operation, helping the user quickly locate the problem and take further corrective measures. If the switch returns a success, the NIC will perform a binding operation on the target port, that is, bind the ports of multiple target NICs into a single bound port and check the status of the bound port; if the port network connection is normal, a message indicating that the binding operation has been completed is displayed, along with the port information and port status.

[0085] In some embodiments, the above-described automatic network interface card (NIC) binding method further includes: automatically generating operation logs and event records for the NIC binding process, so that administrators can trace problems by viewing the operation logs and event records; the event records are used to record configuration changes, status updates, and fault handling. The operation logs record content including, but not limited to, the time of obtaining the NIC binding configuration, the time of sending the configuration request to the switch, the time of receiving the switch response, the switch-side binding result returned by the switch, and the operation of binding the target physical NIC. Therefore, logs help network administrators track configuration history and audit network operations; log recording not only provides operational transparency but also supports post-event analysis, helping to optimize network configuration.

[0086] As can be seen from the above, this embodiment obtains network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined according to the physical NIC port information; a configuration request is generated according to the working mode information and the interface address of the target physical NIC, and the configuration request is sent to the switch; the switch determines the target port corresponding to the interface address of the target physical NIC on the switch, and sets the target port to the corresponding port aggregation state according to the working mode information; the target physical NIC is configured according to the working mode information to bind all the target physical NICs. As can be seen, by configuring the working mode information and the port information of the physical network card that needs to be bound, a configuration request is automatically generated and sent to the switch. The switch determines the target port to be bound based on the received configuration request and sets the port aggregation status of the target port according to the working mode information, thus realizing port binding on the switch side. The host side then configures the target physical network card according to the working mode information to realize physical network card binding. This achieves automated port binding on both the network card side and the switch side, eliminating the need for manual operation and improving the efficiency and accuracy of network card binding. Furthermore, by performing switch port binding first and then network card binding, the problem of wasting resources by binding the network card when the switch port cannot be bound is avoided.

[0087] This application discloses a specific method for automatic network interface card (NIC) binding, applied to the host, i.e., the NIC side. See [link to relevant documentation]. Figure 2 As shown, the method may include the following steps:

[0088] S201: The network card provides a one-click binding option to perform a one-click binding operation;

[0089] S202: After performing one-click binding, a network configuration interface is provided so that users can select the type of binding to be performed and the target binding port;

[0090] S203: Start detecting the status of the host-side network card and check if the network card status is normal;

[0091] S204: Enter different processes based on the network connection status of the network card;

[0092] S205: If the network connection at the network card end is disconnected, determine whether to continue executing the bond operation;

[0093] S206: Under normal network connection conditions, the network card sends a bond request message to the switch. This message will carry the bond type, port MAC address and other configuration parameters.

[0094] S207: The switch receives a request message, parses the request message, and extracts the corresponding information;

[0095] S208: Based on the obtained port MAC address, check the corresponding connection port;

[0096] S209: The switch is configured with the corresponding connection port according to the bond type;

[0097] S210: The switch returns a response message for the local operation to the network card, which is a success message and a failure message. The failure message carries the reason for the failure.

[0098] S211: The network interface card parses the response message to determine whether the execution was successful;

[0099] S212: The network interface card performs a binding operation on the target port and checks the status of the bound port;

[0100] S213: The binding operation is completed. The execution result is displayed and logged.

[0101] As can be seen, using automated binding tools to unify and simplify the configuration process of network interface cards (NICs) and switches reduces the complexity of manual configuration and lowers the risk of human error. Administrators can use these tools to batch configure NIC bindings and switch port channels, ensuring consistency and accuracy. Furthermore, the automated binding method checks the status of NICs and switches during the binding process, quickly detecting network connection or port anomalies. This rapid screening of line or port abnormalities improves fault location efficiency.

[0102] This application discloses a specific method for automatic network interface card (NIC) binding, applied to a switch. See [link to relevant documentation]. Figure 3 As shown, the method may include the following steps:

[0103] Step S31: Obtain the configuration request sent by the host; the host is used to obtain the network card binding configuration; the network card binding configuration includes working mode information and physical network card port information of at least two physical network cards; determine the corresponding target physical network card according to the physical network card port information; generate the configuration request according to the working mode information and the interface address of the target physical network card; configure the target physical network card according to the working mode information to bind all the target physical network cards.

[0104] The aforementioned host is also used to obtain network interface card (NIC) binding instructions, display a network configuration interface on the human-computer interaction interface according to the NIC binding instructions, and obtain the NIC binding configuration through the network configuration interface.

[0105] The above-mentioned configuration of the target physical network interface card according to the working mode information includes: generating a corresponding configuration file according to the working mode information; and applying the configuration file to the target physical network interface card.

[0106] The aforementioned switch is also used to determine whether all target physical network cards (NICs) are connected to the local switch based on their interface addresses. If all target NICs are connected to the local switch, the switch determines the target port on the switch corresponding to the interface address of each target NIC. If any target NIC is not connected to the local switch, a binding failure message indicating an abnormal connection between the NIC and the switch is generated.

[0107] Step S32: Determine the target port on the switch corresponding to the interface address of the target physical network card, and set the target port to the corresponding port aggregation state according to the working mode information.

[0108] After setting the port aggregation state of the target port according to the working mode information, the switch obtains the port configuration result by reading the current port aggregation state of the target port; the port configuration result is sent to the host so that the host can analyze it. If the port configuration result is successful, the host will execute the operation of configuring the target physical network card according to the working mode information; if the port configuration result is unsuccessful, a port configuration failure prompt will be generated.

[0109] The host is further configured to check the connection status of the target physical network card before generating a configuration request based on the working mode information and the interface address of the target physical network card; the connection status includes a normal network connection status and a disconnected network connection status; if the connection status of the target physical network card is the normal network connection status, the operation of generating a configuration request based on the working mode information and the interface address of the target physical network card is executed; if the connection status of the target physical network card is the disconnected network connection status, a status error prompt is generated, and an instruction selection interface is displayed on the human-computer interaction interface; through the instruction selection interface, a response instruction sent by the user based on the status error prompt is received; the response instruction includes a first instruction and a second instruction, the first instruction being used to indicate termination of the binding operation, and the second instruction being used to indicate continuation of the binding operation; if the response instruction is the first instruction, the network card binding operation is exited; if the response instruction is the second instruction, the operation of configuring the target physical network card based on the working mode information is executed directly.

[0110] As can be seen from the above, this embodiment obtains network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined according to the physical NIC port information; a configuration request is generated according to the working mode information and the interface address of the target physical NIC, and the configuration request is sent to the switch; the switch determines the target port corresponding to the interface address of the target physical NIC on the switch, and sets the target port to the corresponding port aggregation state according to the working mode information; the target physical NIC is configured according to the working mode information to bind all the target physical NICs. As can be seen, by configuring the working mode information and the port information of the physical network card that needs to be bound, a configuration request is automatically generated and sent to the switch. The switch determines the target port to be bound based on the received configuration request and sets the port aggregation status of the target port according to the working mode information, thus realizing port binding on the switch side. The host side then configures the target physical network card according to the working mode information to realize physical network card binding. This achieves automated port binding on both the network card side and the switch side, eliminating the need for manual operation and improving the efficiency and accuracy of network card binding. Furthermore, by performing switch port binding first and then network card binding, the problem of wasting resources by binding the network card when the switch port cannot be bound is avoided.

[0111] Accordingly, this application also discloses an automatic network card binding device, applied to a host, see [link to relevant documentation]. Figure 4 As shown, the device includes:

[0112] The network interface card (NIC) binding configuration acquisition module 11 is used to acquire the NIC binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs;

[0113] The target physical network card determination module 12 is used to determine the corresponding target physical network card based on the physical network card port information;

[0114] The configuration request sending module 13 is used to generate a configuration request based on the working mode information and the interface address of the target physical network card, and send the configuration request to the switch. The switch determines the target port corresponding to the interface address of the target physical network card on the switch, and sets the target port to the corresponding port aggregation state based on the working mode information.

[0115] The network card binding module 14 is used to configure the target physical network card according to the working mode information, so as to bind all the target physical network cards.

[0116] As can be seen from the above, this embodiment obtains network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined according to the physical NIC port information; a configuration request is generated according to the working mode information and the interface address of the target physical NIC, and the configuration request is sent to the switch; the switch determines the target port corresponding to the interface address of the target physical NIC on the switch, and sets the target port to the corresponding port aggregation state according to the working mode information; the target physical NIC is configured according to the working mode information to bind all the target physical NICs. As can be seen, by configuring the working mode information and the port information of the physical network card that needs to be bound, a configuration request is automatically generated and sent to the switch. The switch determines the target port to be bound based on the received configuration request and sets the port aggregation status of the target port according to the working mode information, thus realizing port binding on the switch side. The host side then configures the target physical network card according to the working mode information to realize physical network card binding. This achieves automated port binding on both the network card side and the switch side, eliminating the need for manual operation and improving the efficiency and accuracy of network card binding. Furthermore, by performing switch port binding first and then network card binding, the problem of wasting resources by binding the network card when the switch port cannot be bound is avoided.

[0117] In some specific embodiments, the network interface card (NIC) binding configuration acquisition module 11 may specifically include:

[0118] A network interface card (NIC) binding instruction acquisition unit is used to acquire NIC binding instructions and display a network configuration interface on a human-computer interaction interface based on the NIC binding instructions.

[0119] The network interface card (NIC) binding configuration acquisition unit is used to acquire the NIC binding configuration through the network configuration interface.

[0120] In some specific embodiments, the network interface card (NIC) bonding module 14 may specifically include:

[0121] A configuration file generation unit is used to generate a corresponding configuration file based on the working mode information.

[0122] The configuration file activation unit is used to apply the configuration file to the target physical network interface card.

[0123] In some specific embodiments, the switch can be used to determine whether all target physical network cards are connected to the local switch based on the interface address of the target physical network card before the switch determines the target port corresponding to the interface address of the target physical network card on the switch; if all target physical network cards are connected to the local switch, the switch determines the target port corresponding to the interface address of the target physical network card on the switch; if there is a target physical network card that is not connected to the local switch, a binding failure prompt containing an abnormal connection between the network card and the switch is generated.

[0124] In some specific embodiments, the network card automatic binding device may specifically include:

[0125] The port configuration result acquisition unit is used to acquire the port configuration result sent by the switch before configuring the target physical network card according to the working mode information; the port configuration result is obtained by the switch after setting the port aggregation state of the target port according to the working mode information by reading the current port aggregation state of the target port;

[0126] An execution unit is configured to execute the operation of configuring the target physical network card according to the working mode information if the port configuration result is successful.

[0127] The prompting unit is used to generate a prompt indicating that the port configuration was unsuccessful if the port configuration result is unsuccessful.

[0128] In some specific embodiments, the network card automatic binding device may specifically include:

[0129] A connection status detection unit is used to check the connection status of the target physical network card before generating a configuration request based on the working mode information and the interface address of the target physical network card; the connection status includes a normal network connection status and a disconnected network connection status;

[0130] An execution unit is configured to execute the operation of generating a configuration request based on the working mode information and the interface address of the target physical network card if the connection status of the target physical network card is the normal network connection status;

[0131] An error message unit is used to generate an error message if the connection status of the target physical network card is a network connection disconnection state, and to display an instruction selection interface on the human-computer interaction interface.

[0132] The response instruction acquisition unit is used to receive a response instruction sent by the user according to the status error prompt through the instruction selection interface; the response instruction includes a first instruction and a second instruction, the first instruction is used to indicate termination of the binding operation, and the second instruction is used to indicate continuation of the binding operation;

[0133] A binding exit unit is used to exit the network card binding operation if the response instruction is the first instruction;

[0134] A binding execution unit is used to directly execute the operation of configuring the target physical network card according to the working mode information if the response instruction is the second instruction.

[0135] Accordingly, this application also discloses an automatic network interface card (NIC) binding device applied to a switch. The device includes: a configuration request acquisition module, used to acquire a configuration request sent by a host; the host is used to acquire NIC binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; determining the corresponding target physical NIC based on the physical NIC port information; generating the configuration request based on the working mode information and the interface address of the target physical NIC; and configuring the target physical NIC based on the working mode information to bind all the target physical NICs.

[0136] The port configuration module is used to determine the target port on the switch corresponding to the interface address of the target physical network card, and set the target port to the corresponding port aggregation state according to the working mode information.

[0137] Furthermore, this application also discloses an electronic device, see [link to relevant documentation]. Figure 5 As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.

[0138] Figure 5This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the automatic network card binding method disclosed in any of the foregoing embodiments.

[0139] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0140] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon include operating system 221, computer program 222 and data 223 including working mode information, etc. The storage method can be temporary storage or permanent storage.

[0141] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the automatic network card bonding method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0142] Furthermore, this application also discloses a computer storage medium storing computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, they implement the network card automatic binding method steps disclosed in any of the foregoing embodiments.

[0143] Furthermore, this application also discloses a computer program product, which stores a computer program. When the computer program is loaded and executed by a processor, it implements the network card automatic binding method steps disclosed in any of the foregoing embodiments.

[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0145] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0146] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0147] The above provides a detailed description of the automatic network card binding method, apparatus, device, medium, and program product provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for automatic network card binding, characterized in that, Applied to the host, including: Obtain the network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information for at least two physical NICs; The corresponding target physical network card is determined based on the physical network card port information; A configuration request is generated based on the operating mode information and the interface address of the target physical network card. The configuration request is then sent to the switch. The switch determines the target port on the switch corresponding to the interface address of the target physical network card and sets the target port to the corresponding port aggregation state based on the operating mode information. The port aggregation state includes static physical port group, dynamic physical port group, and no physical port group configured. Configure the target physical network interface card (NIC) according to the operating mode information to bind all the target physical NICs; Before configuring the target physical network interface card according to the working mode information, the method further includes: Obtain the port configuration result sent by the switch; the port configuration result is obtained by the switch after setting the port aggregation state of the target port according to the working mode information, by reading the current port aggregation state of the target port; If the port configuration result is successful, then the operation of configuring the target physical network card according to the working mode information is performed.

2. The automatic network card binding method according to claim 1, characterized in that, The process of obtaining the network interface card (NIC) binding configuration includes: Obtain the network card binding instruction, and display the network configuration interface on the human-computer interaction interface according to the network card binding instruction; The network card binding configuration is obtained through the network configuration interface.

3. The automatic network card binding method according to claim 1, characterized in that, The step of configuring the target physical network interface card according to the working mode information includes: Generate a corresponding configuration file based on the working mode information; Apply the configuration file to the target physical network interface card.

4. The automatic network card binding method according to claim 1, characterized in that, Before the switch determines the interface address of the target physical network card on the corresponding target port on the switch, it also includes: The switch determines whether all target physical network cards are connected to the local switch based on the interface address of the target physical network card; If all the target physical network interface cards are connected to the local switch, the switch determines the target port on the switch corresponding to the interface address of the target physical network interface card.

5. The automatic network card binding method according to claim 4, characterized in that, After determining whether all target physical network cards are connected to the local switch, the process further includes: If the target physical network card is not connected to the local switch, a binding failure message indicating an abnormal connection between the network card and the switch will be generated.

6. The automatic network card binding method according to claim 1, characterized in that, After obtaining the port configuration result sent by the switch, the process further includes: If the port configuration result is unsuccessful, a port configuration failure message will be generated, and the operation of configuring the target physical network card according to the working mode information will not be executed.

7. The automatic network card binding method according to claim 1, characterized in that, The working mode information includes information on any of the following working modes: round-robin load balancing mode, master-slave mode, hash-based load balancing mode, broadcast mode, dynamic link aggregation mode, send load balancing mode, and send-receive load balancing mode. The port aggregation status is static physical port group, dynamic physical port group, or no physical port group configured.

8. The automatic network card binding method according to any one of claims 1 to 7, characterized in that, Before generating the configuration request based on the working mode information and the interface address of the target physical network card, the method further includes: Check the connection status of the target physical network card; the connection status includes a normal network connection and a disconnected network connection. If the connection status of the target physical network card is the normal network connection status, then the operation of generating a configuration request based on the working mode information and the interface address of the target physical network card is executed. If the connection status of the target physical network card is the network connection disconnected state, an abnormal status prompt is generated and the instruction selection interface is displayed on the human-computer interaction interface. The system receives response instructions from the user based on the status error message through the instruction selection interface. The response instructions include a first instruction and a second instruction, wherein the first instruction is used to indicate termination of the binding operation and the second instruction is used to indicate continuation of the binding operation. If the response instruction is the first instruction, then exit the network card binding operation; If the response instruction is the second instruction, then the operation of configuring the target physical network card according to the working mode information is executed directly.

9. A method for automatic network card binding, characterized in that, Applied to switches, including: The system obtains a configuration request sent by a host; the host is used to obtain network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the system determines the corresponding target physical NIC based on the physical NIC port information; the system generates the configuration request based on the working mode information and the interface address of the target physical NIC; the system configures the target physical NIC based on the working mode information to bind all the target physical NICs. The target port on the switch is determined by identifying the interface address of the target physical network card and setting the target port to the corresponding port aggregation state according to the working mode information; the port aggregation state includes static physical port group, dynamic physical port group, and no physical port group configured. After setting the port aggregation state of the target port according to the working mode information, the port configuration result is obtained by reading the current port aggregation state of the target port, and the port configuration result is sent to the host so that the host can perform the operation of configuring the target physical network card according to the working mode information after determining that the port configuration result is successful.

10. A network card automatic binding device, characterized in that, Applied to the host, including: The network interface card (NIC) binding configuration acquisition module is used to acquire NIC binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; The target physical network interface card (NIC) determination module is used to determine the corresponding target physical NIC based on the physical NIC port information. A configuration request sending module is used to generate a configuration request based on the working mode information and the interface address of the target physical network card, and send the configuration request to the switch. The switch determines the target port on the switch corresponding to the interface address of the target physical network card, and sets the target port to the corresponding port aggregation state based on the working mode information. The port aggregation state includes static physical port group, dynamic physical port group, and no physical port group configured. A network interface card (NIC) binding module is used to configure the target physical NIC according to the working mode information, so as to bind all the target physical NICs; The network interface card (NIC) automatic binding device is used to obtain the port configuration result sent by the switch before configuring the target physical NIC according to the working mode information; the port configuration result is obtained by the switch after setting the port aggregation state of the target port according to the working mode information by reading the current port aggregation state of the target port; if the port configuration result is successful, the operation of configuring the target physical NIC according to the working mode information is performed.

11. An automatic network card binding device, characterized in that, Applied to switches, including: A configuration request acquisition module is used to acquire configuration requests sent by a host; the host is used to acquire network interface card (NIC) binding configuration; the NIC binding configuration includes working mode information and physical NIC port information of at least two physical NICs; the corresponding target physical NIC is determined based on the physical NIC port information; the configuration request is generated based on the working mode information and the interface address of the target physical NIC; the target physical NIC is configured based on the working mode information to bind all the target physical NICs; The port configuration module is used to determine the target port on the switch corresponding to the interface address of the target physical network card, and set the target port to the corresponding port aggregation state according to the working mode information; the port aggregation state includes static physical port group, dynamic physical port group, and no physical port group configured. The network card automatic binding device is used to set the port aggregation state of the target port according to the working mode information, obtain the port configuration result by reading the current port aggregation state of the target port, and send the port configuration result to the host, so that the host can perform the operation of configuring the target physical network card according to the working mode information after determining that the port configuration result is successful.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the network card automatic binding method as described in any one of claims 1 to 8, or the network card automatic binding method as described in claim 9.

13. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein the computer programs, when executed by a processor, implement the network card automatic binding method as described in any one of claims 1 to 8, or the network card automatic binding method as described in claim 9.

14. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the network card automatic bonding method as described in any one of claims 1 to 8, or the network card automatic bonding method as described in claim 9.

Citation Information

Patent Citations

  • Network interface card binding method and device

    CN106209449A

  • Network card configuration management method and related device

    CN117041042A