Network address configuration method and electronic device

By setting a dedicated static network address configuration item in the preset storage area of ​​the baseboard management controller and configuring the static network address using the add command, while intercepting dynamic host configuration protocol requests, the incompatibility problem between static and dynamic network addresses is solved. This enables the baseboard management controller to be configured compatiblely on the same network interface, improving the reliability and maintainability of the system.

CN120935144BActive Publication Date: 2026-01-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511417025.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-01-27
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

In the existing technology, the static network address configuration and dynamic network address configuration of the baseboard management controller (BMC) are incompatible, which means that only one address configuration method can be used at any given time. It cannot support both static IP and dynamic IP at the same time, which brings inconvenience and high technical costs to small customers or field maintenance personnel.

Method used

A dedicated static network address configuration item is set in the preset storage area. The static network address is configured on the network interface of the baseboard management controller by adding a command, and the default configuration operation of the dynamic host configuration protocol request process is intercepted to achieve compatible configuration of static network address and dynamic network address on the same network interface.

Benefits of technology

This enables the baseboard management controller to simultaneously support static and dynamic network addresses on the same network interface, enhancing system reliability and maintainability, reducing manpower and time costs, and improving the reliability and predictability of out-of-band management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935144B_ABST
    Figure CN120935144B_ABST
Patent Text Reader

Abstract

The application discloses a network address configuration method and electronic equipment, and relates to the technical field of network address configuration, and the method comprises the steps of: setting a special static network address configuration item in a preset storage area; reading a static network address from the special static network address configuration item when the system starts, and configuring the static network address to a network interface of a baseboard management controller by using an addition command; initiating a dynamic host configuration protocol request to obtain a dynamic network address, and intercepting a default configuration operation of a dynamic host configuration protocol request process on the network interface; configuring the dynamic network address to the network interface of the baseboard management controller by using the addition command; and configuring the static network address and the dynamic network address to the same network interface of the baseboard management controller. The technical problem of incompatibility between static network address configuration and dynamic network address configuration in the prior art is solved, and the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network address configuration technology, and in particular to a network address configuration method and electronic device. Background Technology

[0002] The Baseboard Management Controller (BMC) provides crucial network connectivity for remote out-of-band management. Currently, it's common practice to allow users to pre-configure the BMC network through the BIOS (Basic Input / Output System) settings menu. Specific functions include setting the BMC's IP address acquisition method (static or dynamic), and manually specifying parameters such as IP address, subnet mask, and gateway when static mode is selected. The BIOS transmits this configuration data to the BMC through predefined hardware interfaces, and the BMC applies these settings after startup to initialize its network interfaces.

[0003] In related technologies, the standard TCP / IP network protocol stack requires that a network interface can only use one address configuration method at any given time: either a manually configured static network address or a dynamically allocated network address requested via Dynamic Host Configuration Protocol (DHCP). Therefore, the conventional method of setting a static network address is incompatible with requesting a dynamically allocated network address via DHCP. Summary of the Invention

[0004] This application provides a network address configuration method and an electronic device to at least solve the technical problem of incompatibility between static network address configuration and dynamic network address configuration in related technologies.

[0005] This application provides a network address configuration method applied to a baseboard management controller. The network address configuration method includes:

[0006] A dedicated static network address configuration item is set in the preset storage area; in response to system startup, the static network address is read from the dedicated static network address configuration item, and the static network address is configured on the network interface of the baseboard management controller using the add command; a dynamic host configuration protocol request is initiated to obtain the dynamic network address, and at the same time, the default configuration operation of the dynamic host configuration protocol request process on the network interface is intercepted; in response to receiving the dynamic network address, the dynamic network address is configured on the network interface of the baseboard management controller using the add command; wherein, the static network address and the dynamic network address are configured on the same network interface of the baseboard management controller, so that the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the network address configuration method described in the following embodiments.

[0008] A dedicated static network address configuration item is set in the preset storage area; in response to system startup, the static network address is read from the dedicated static network address configuration item, and the static network address is configured on the network interface of the baseboard management controller using the add command; a dynamic host configuration protocol request is initiated to obtain the dynamic network address, and at the same time, the default configuration operation of the dynamic host configuration protocol request process on the network interface is intercepted; in response to receiving the dynamic network address, the dynamic network address is configured on the network interface of the baseboard management controller using the add command; wherein, the static network address and the dynamic network address are configured on the same network interface of the baseboard management controller, so that the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.

[0009] The network address configuration method provided in this application creates a static network address configuration space independent of traditional network configuration, specifically for a static network address configuration and dynamic network configuration compatibility mode, by setting a dedicated static network address configuration item in a preset storage area. This achieves isolation between the dedicated static network configuration item and the original operating system network configuration. Related technologies use a replacement command to configure a new network address on a network interface, which clears the network address already configured on the network interface. However, this application uses an add command to configure dynamic and static network addresses on the network interface, providing support for compatibility between static and dynamic network address configurations. Furthermore, by issuing... While initiating a Dynamic Host Configuration Protocol (DHCP) request to obtain a dynamic network address, the default configuration operations of the DHCP request process on the network interface are intercepted. This avoids the DHCP request client from overwriting the network address already configured on the network interface by default. This application innovatively breaks through the mutual exclusion limitation of dynamic and static network address configuration in traditional protocol stacks by creating a static network address configuration space dedicated to the static and dynamic network address configuration compatibility mode, adopting an additive configuration command, and intercepting the default configuration operations of the DHCP request process on the network interface, thus achieving compatibility between dynamic and static network address configuration. Attached Figure Description

[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating a network address configuration method provided in an embodiment of this application;

[0012] Figure 2A flowchart illustrating a network address configuration method provided in another embodiment of this application;

[0013] Figure 3 A flowchart illustrating a network address configuration method provided in yet another embodiment of this application;

[0014] Figure 4 This is an internal structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0016] It should be noted that, in the description of this application, 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. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0017] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] The BIOS (Basic Input / Output System) Setup menu supports BMC (Baseboard Management Controller) network configuration. This function allows you to set the server BMC's network information, including configuring the BMC's IP address acquisition method, IP address, subnet mask, and gateway. Through the BIOS-BMC interaction, the BIOS transmits this configuration data to the BMC, which then configures the corresponding network card data to achieve the desired functionality. Entering the setup menu interface allows you to configure parameters for either Dedicated Network or ShareLink Network. Dedicated Network refers to a private network, where access to the BMC is only possible through the server management network port. ShareLink Network refers to a shared network, where access to the BMC is possible through the PCIe network card port. Users can choose between Dedicated Network and ShareLink Network modes based on their needs.

[0019] The following section uses the Private Cloud (PCV) mode configuration as an example; the configuration for the Shared Cloud mode is similar. Both network modes support IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6) startup, and the configuration is the same. The IPv4 configuration will be used as an example:

[0020] The BMC Dedicated Network Parameters option is used to set the method for obtaining BMC dedicated network parameters. The available values ​​are: Auto (automatically obtain the current BMC network settings parameters), Manual (manually set the BMC network settings parameters), and Current Configuration Address source (used to display the current BMC configuration status).

[0021] When BMC Dedicated Network Parameters is set to Manual, the Address Source menu is displayed; when set to Auto, the Address Source menu is hidden. This is because in manual mode, users need to manually specify the method of obtaining the IP address (static or DHCP) and related network parameters, thus requiring the display of advanced menus such as Address Source. In automatic mode, the system (or firmware) automatically handles network configuration without user intervention, therefore hiding specific configuration menus such as Address Source simplifies the interface.

[0022] There are three settings for the address source: Unspecified, Static, and Dynamic BMC DHCP (which automatically assigns IP addresses via the DHCP protocol).

[0023] In dynamic BMC DHCP mode, the BMC device can obtain a temporary IP address from the DHCP server. This address may change after the lease expires. When Unspecified is selected, no settings are required. When Static is selected, a static IP address mode is used. In this case, the following parameters can be set: Station IP address, Subnet mask, and Router IP address. These parameters must be configured correctly according to network protocol requirements. Follow the Setup prompts to save the parameters and send them to the BMC. After that, you can access the BMC network via a static IP address.

[0024] When the Address source is set to Dynamic BMC DHCP: Dynamic DHCP automatically assigns IP addresses to the BMC network. After saving and sending the IP data to the BMC as prompted in the Setup instructions, you can access the BMC using the dynamically assigned IP address. The setup and functionality are similar when using an IPv6 network. The Address source refers to the network address used to access the BMC management interface.

[0025] In related technologies, when the address source is set to Static and the network parameters are configured, it is relatively simple for users to use. For example, connecting the network port of one's computer to the network port of the server BMC (Branch Management Center) which is configured with a Static IP address using a network cable, and setting one's computer's IP address to be on the same network segment as the server's IP address, one can then access the server's BMC WebUI interface through a web browser on their computer by entering the server's Static IP address. The WebUI then provides functions for viewing server data and using various server management features. Setting the address source to a Static IP address is particularly convenient and straightforward, especially for personnel performing on-site server maintenance; a laptop and a network cable are all that's needed to access the server's BMC.

[0026] When the address source is set to dynamic BMC DHCP, the BMC needs to be configured to act as a standard DHCP client, requesting and dynamically obtaining network configurations such as IP address, subnet mask, and gateway from an independent DHCP server. Deployment is relatively complex and technically costly, and small customers generally do not want to use it. However, for large customers with numerous servers, remote deployment, storage, and connectivity are not technically problematic, so this method is often adopted. From a configuration perspective, using DHCP requires both a DHCP client and a DHCP server, dynamically allocating IP addresses through communication between the DHCP client and server. This communication process includes the following four main phases: Discover, Offer, Request, and Acknowledge.

[0027] Therefore, setting the address source to a static IP involves the administrator manually inputting fixed network parameters, while setting the address source to dynamic BMC DHCP involves the BMC actively requesting temporarily leased network parameters from the DHCP server in the network. These two scenarios are completely different and are mutually exclusive under normal circumstances. A network interface can only use either a manually configured static IP or a dynamically assigned IP via DHCP at any given time; it cannot use both simultaneously. This is the behavior of the standard TCP / IP network protocol stack. Therefore, static IP settings and DHCP dynamic IP allocation are incompatible under normal circumstances.

[0028] Furthermore, in the corresponding firmware settings such as BIOS and BMC, the configuration of these two scenarios is mutually exclusive. Selecting Static mode will enter the Static parameter setting interface, and selecting DHCP mode will enter the DHCP parameter display interface. The two are displayed separately, and only one can be selected and displayed at the same time. They cannot be supported simultaneously.

[0029] To cater to the needs of numerous internet users, the default address source setting in the BIOS Setup and / or BMC is Dynamic BMC DHCP. For the reasons mentioned above, this is inconvenient for smaller customers or on-site maintenance personnel, presents technical challenges, or requires booting the server into the BIOS Setup or operating system to adjust settings, setting the address source to Static and configuring parameters such as IP, gateway, and subnet mask before connecting to and accessing the BMC. Alternatively, smaller customers may request customization, wanting the server to have the address source set to Static mode before shipping. However, this requires firmware (BIOS or BMC) development and customization, involving firmware version development and maintenance costs. Furthermore, even with the default Static setting, manual configuration of network parameters such as IP, gateway, and subnet mask is still necessary, resulting in both version development and on-site maintenance costs in terms of manpower and timeliness.

[0030] In response to the above technical problems, such as Figure 1 As shown, an embodiment of this application provides a network address configuration method, which specifically includes the following steps:

[0031] Step 101: Configure a dedicated static network address in the preset storage area.

[0032] Specifically, the preset storage area can be a region of the non-volatile storage area of ​​the baseboard management controller. The dedicated static network address entry here is an additional, independent static network address configuration entry, separate from the traditional system network configuration, and unique to the static network address configuration in the dynamic and static network address configuration compatibility mode proposed in this application. This dedicated static network address configuration entry can be protected by the baseboard management controller's main control process, decoupling it from the client requesting Dynamic Host Configuration Protocol (DMP) (the device used by DMP to request configuration information) and the system network configuration tool. This makes the static network address configuration in the dynamic and static network address configuration compatibility mode completely independent of the operating system's own network configuration file. Thus, regardless of whether the operating system is reinstalled, upgraded, or its configuration is accidentally modified, the stability of the baseboard management controller's own network function will not be affected, improving the system's reliability and maintainability.

[0033] Step 102: In response to system startup, read the static network address from the dedicated static network address configuration item, and use the add command to configure the static network address to the network interface of the baseboard management controller.

[0034] After the baseboard management controller powers on and the operating system kernel completes initialization, it accesses the preset storage area to retrieve parameters such as static network address, gateway, and subnet mask. The `add` command is then used to configure these parameters on the baseboard management controller's network interface. This command instructs the Linux kernel network protocol stack to append a static network address to the IP address list of the network interface named "baseboard management controller" and set the gateway and subnet mask. By using the `add` command to configure the network address on the baseboard management controller's network interface, the kernel network state is manipulated in a non-destructive way. It simply adds an entry to the interface's address list, perfectly preserving the "occupancy space" for subsequent dynamic IP addresses. This avoids the destructive behavior of traditional DHCP clients overwriting network addresses already configured on the network interface, which involves clearing old addresses and setting new ones.

[0035] By configuring a static network address at the system startup, before initiating a Dynamic Host Configuration Protocol (DMP) request, a known, fixed, and never-lost BMC access address is ensured. Regardless of whether subsequent DMP processes run or succeed, administrators can access the BMC through this static network address, greatly enhancing the reliability and predictability of out-of-band management.

[0036] Step 103: Initiate a Dynamic Host Configuration Protocol (DHCP) request to obtain a dynamic network address. At the same time, intercept the DHCP request process's default configuration operations on the network interface.

[0037] Because the DHCP client overwrites the static network address already configured on the network interface during the Dynamic Host Configuration Protocol (DHCP) request process, causing incompatibility between static and dynamic network addresses, the DHCP request process is configured to intercept the default configuration operation of the DHCP request process on the network interface and add the obtained dynamic network address to the network interface through the main control process of the baseboard management controller, instead of adding the dynamic network address to the network interface through the previous DHCP process.

[0038] Specifically, a Dynamic Host Configuration Protocol (DHCP) request is initiated, and a pre-deployed script is enabled. When the client that made the DHCP request successfully obtains the dynamic network address, the pre-deployed script forces the return of a preset value to terminate the DHCP request. The client's default value is overwritten with the network address already configured on the network interface.

[0039] The pre-deployed script can be a custom hook script defined by the baseboard management controller. When the Dynamic Host Configuration Protocol (DHCP) client successfully requests a dynamic network address from the DHCP server, the pre-deployed script forces a default value to be returned, thus terminating the client's default overwriting of the network address already configured on the network interface. This default value refers to a non-zero exit status code, indicating "configuration failed" to the DHCP client process. This terminates the subsequent default, destructive IP configuration process (preventing it from calling the program that sets the IP address of the network interface). Afterward, the DHCP client process's role is redefined: it is only responsible for Discovery and Request protocol interactions, completing the process once it successfully obtains configuration information (IP address, subnet mask, gateway, etc.). The obtained dynamic network address is then transmitted to the baseboard management controller's main control process, thus preventing it from overwriting the static network address already configured on the network interface.

[0040] Step 104: In response to receiving a dynamic network address, use an add command to configure the dynamic network address on the network interface of the baseboard management controller; wherein the static network address and the dynamic network address are configured on the same network interface of the baseboard management controller so that the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.

[0041] Specifically, in response to receiving a dynamic network address, the dynamic network address is passed to the main control process of the baseboard management controller, which then uses an add command to configure the dynamic network address in the network interface of the baseboard management controller.

[0042] Unlike configuring dynamic network addresses on the network interface of the baseboard management controller via a DHCP client, this application configures the baseboard management controller's master process to receive the dynamic network address successfully obtained from the DHCP server and send an add command message to the kernel via Netlink socket communication (a method for bidirectional data transmission between the kernel and user applications). Upon receiving the add command message, the kernel appends the dynamic network address as an additional address to the address list of the baseboard management controller's network interface, rather than replacing the static network address already configured on the baseboard management controller's network interface. This breaks through the traditional single-replacement network address configuration mode and transforms it into a multi-addition network address configuration mode, supporting the coexistence of static and dynamic network addresses on the baseboard management controller's network interface.

[0043] In one embodiment, before configuring the dynamic network address to the network interface of the baseboard management controller using an add command in response to receiving the dynamic network address, the method includes: listening to the dynamic host configuration protocol request response status; in response to failure to successfully obtain the dynamic network address within a preset timeout period, recording the failure to obtain the dynamic network address and maintaining the configured static network address as the baseboard management controller access channel; in response to successful acquisition of the dynamic network address within the preset timeout period, acquiring the dynamic network address and using both the dynamic network address and the static network address as the baseboard management controller access channel.

[0044] After the Baseboard Management Controller (BMC) initiates a Dynamic Host Configuration Protocol (DHCP) request (executing the dhclient process), the BMC's master process immediately starts a timer with a preset timeout duration (e.g., 30 or 60 seconds). If a successful dynamic network address acquisition is not detected within the preset timeout period, the BMC's master process generates a log recording the DHCP request failure or the DHCP server's lack of response, along with a timestamp and the failure time. Alternatively, the DHCP process can be forcibly terminated, preventing dynamic network address configuration and maintaining the configured static network address as the access channel for the Baseboard Management Controller.

[0045] If a dynamic network address is successfully acquired within the preset timeout period, the BMC's main control process will generate a log to record the successful DHCP request and configure the parameters such as the dynamic network address, subnet mask, and default gateway successfully obtained from the DHCP server on the network interface of the baseboard management controller. At this time, both static and dynamic network addresses exist on the same network interface of the baseboard management controller, and the BMC can be accessed through either network address, achieving dual-channel redundancy.

[0046] In this application, address conflict checks are performed before configuring a static network address to the network interface of the baseboard management controller using the add command; and address conflict checks are also performed before configuring a dynamic network address to the network interface of the baseboard management controller using the add command. That is, this application requires address conflict checks to be performed before configuring any network address.

[0047] Specifically, the address conflict verification process includes: obtaining the network address to be configured and the configured network address, wherein the configured network address is the network address that has been configured and is effective on the network interface of the baseboard management controller; comparing the network address to be configured and the configured network address; and in response to the network address to be configured being consistent with the configured network address, adjusting the host number value of the network address to be configured, generating a new network address to be assigned, and enabling the new network address to be assigned to replace the network address to be configured.

[0048] Specifically, the network address to be configured can be the network address to be configured or the dynamic network address to be configured. The baseboard management controller can query the configured address list formed by all network addresses currently in effect on the network interface in the kernel, and compare the network address to be configured with each network address in the configured address list one by one to check whether the network address to be configured is exactly the same as any of the configured network addresses.

[0049] If they are different, it means that the network address to be configured does not conflict with the already configured network address, the verification is successful, and the network address to be configured can be directly configured on the network interface of the baseboard management controller using the add command.

[0050] If they are the same, it means there is a conflict between the network address to be configured and the already configured network address, and the verification fails. In this case, the network address to be configured can be split into a network number and a host number. The host number portion of the network address to be configured can be adjusted to generate a new network address to be assigned. The new network address to be assigned will not conflict with the already configured network address. The newly generated IP address replaces the originally planned conflicting address. The new network address to be assigned is then used to replace the network address to be configured and finally configured on the network interface of the baseboard management controller. This avoids configuration errors, such as the administrator manually setting a static network address that happens to overlap with the IP address pool to be assigned by the DHCP server, resulting in two identical IP addresses being configured on the same network card of the same device, thus improving system stability.

[0051] Since static network addresses are pre-defined specific addresses, when there are multiple devices to be deployed, before setting the dedicated static network address configuration item in the preset storage area, the number of devices to be deployed and the basic static network address can be obtained; the basic static network address can be parsed to obtain the host number corresponding to the basic static network address; using the host number value as the starting value, target derived static network addresses can be generated for the target devices to be deployed, and the host number of the target derived static network addresses can be incremented based on the starting value to obtain multiple derived static network addresses equal to the number of devices to be deployed; the multiple derived static network addresses can be distributed and configured to the corresponding network interfaces of each device to be deployed, where the devices to be deployed can be baseboard management controllers, network cards, or servers.

[0052] Specifically, the basic static network address can be resolved. This basic static network address represents a specified starting network address. The specific value of the basic static network address can be customized according to actual needs. It can be broken down into a network prefix and a host address. The network prefix is ​​usually determined by the specific IP address and subnet mask. For example, assuming the basic static network address is "192.168.1.100", "192.168.1" represents the network prefix, and "100" represents the host address. The host address can be incremented or decremented based on its value to create different host addresses, equal to the number of devices to be deployed. These different host addresses, combined with the same network prefix, form different derived static network addresses and are assigned to each device to be deployed. In this way, the work of manually configuring static network addresses one by one is transformed into an automated batch operation, greatly reducing labor costs and deployment time.

[0053] In one embodiment, the network address configuration method provided in this application further includes: detecting whether a default gateway parameter is obtained in the Dynamic Host Configuration Protocol (DMP) request process; in response to obtaining the default gateway parameter in the DMP request process, setting the default gateway parameter as the system default route; detecting whether an independent gateway is configured in the dedicated static network configuration item; in response to configuring an independent gateway in the dedicated static network configuration item, adding a target static route for the network segment where the static network address is located, with the target static route using the independent gateway as the next-hop address; setting the target static route to a height value so that the priority of the target static route is lower than the default route allocated by the DMP; and in response to the failure of the default route allocated by the DMP, using the target static route as a temporary default route, and switching back to the default route after the DMP service is restored.

[0054] Specifically, after the DHCP client process successfully obtains the dynamic network address and related parameters, it checks whether the dynamic network address parameters include a default gateway. If a default gateway parameter is detected, the baseboard management controller immediately sets the default network as the system's default route. This means that all data packets destined for non-local network segments will be forwarded through this default gateway by default. Simultaneously, the baseboard management controller also checks whether a dedicated gateway is configured in the dedicated static network configuration. If a dedicated gateway is configured in the dedicated static network configuration, a target static route is added to the network segment containing the static network address. The target static route uses the dedicated gateway as its next-hop address, ensuring that all traffic belonging to the network segment containing the static network address is forwarded through the dedicated gateway. When adding a target static route, a higher metric value can be set. Generally, a lower metric value indicates higher priority. The default route set by DHCP typically has a lower metric value. In this case, the target static route has a lower priority than the default route. When a data packet's destination matches both the default route and the target static route, the system will choose the more accurate route with the lower metric. For traffic destined for network segments with static network addresses, static routes are more precise and therefore preferred; for traffic destined for all other networks, default routes are used. Thus, prioritizing the DHCP-assigned gateway as the default route ensures that the BMC always uses the primary exit path planned for it within the network environment under normal circumstances. This is typically the optimal and most efficient path, guaranteeing performance when accessing the internet or other external network resources. By adding specific static routes and using metric priority control, the responsibilities of each gateway are defined. This allows two gateways to coexist peacefully in the system, each fulfilling its specific function, completely avoiding path uncertainty and network connectivity issues caused by multiple default routes.

[0055] The baseboard management controller (BMC) continuously verifies the validity of the default route by periodically probing or attempting to connect to the external network. If a default route failure is detected, such as when the gateway is unreachable, the BMC automatically prioritizes the static route or adds a new default route pointing to the static gateway, making it a temporary default route. When DHCP service recovery is detected, such as network connectivity restoration or DHCP lease renewal, the BMC automatically revoks the temporary default route setting and restores the system routing state to its initial optimal configuration: the DHCP gateway is the default route, and the static gateway only handles traffic from specific network segments. In this way, the static gateway acts as a backup gateway. When the primary (DHCP) gateway fails, the system can automatically and seamlessly switch to the backup (static) gateway, ensuring uninterrupted external network connectivity for the BMC. This enhances the reliability and availability of the out-of-band management system.

[0056] In one embodiment, the network address configuration method provided in this application further includes: responding to the fact that a static network address and a dynamic network address have been configured on the network interface of the baseboard management controller; obtaining a preset firewall rule template, wherein the preset firewall rule template filters based on network service ports; applying the static network address and dynamic network address configured on the network interface of the baseboard management controller in batches to the firewall rule template, creating the same access control rules for the static network address and dynamic network address configured on the network interface of the baseboard management controller; and updating the firewall rules to maintain policy consistency when a new network address is detected or a configured network address is deleted on the network interface of the baseboard management controller.

[0057] After the baseboard management controller successfully configures both dynamic and static network addresses to the network interface, it retrieves a preset firewall rule template. This template does not contain specific network addresses and allows SSH (Secure Shell), HTTPS (Hypertext Transfer Security), IPMI (Intelligent Platform Management Interface), and UDP (User Datagram Protocol) access. It also allows return packets from established connections and, by default, denies all other inbound traffic. The baseboard management controller executes a command to retrieve a list of all currently configured network addresses on its network interface. It then combines all the configured network addresses stored in this list with the preset firewall rule template to generate access control rules for each configured network address. This ensures that every IP address on the baseboard management controller's network interface has the same service access permissions, avoiding security policy differences due to different network addresses.

[0058] This application also configures the baseboard management controller to monitor whether a new network address has been configured or whether an existing network address has been deleted. Once a new network address is detected or a deleted network address is detected on the baseboard management controller's network interface, the same access control rules are recreated for both the static and dynamic network addresses currently configured on the baseboard management controller's network interface. This prevents unexpected interruptions to the management channel due to new or deleted network addresses. By dynamically monitoring for new or deleted network addresses and automatically updating the rules, this application ensures that the firewall policy is always synchronized with the currently effective network address, thereby maintaining the continuous reachability and reliability of the management channel.

[0059] In one embodiment, in response to the baseboard management controller entering a low-power or sleep mode, the static network address is maintained on the network interface and its listening state is kept up, while the request sending and renewal operation of the Dynamic Host Configuration Protocol (DHCP) client are suspended; in response to the baseboard management controller being woken up from the low-power or sleep mode, the DHCP request is re-initiated to obtain a new dynamic network address, and the newly obtained dynamic network address is configured on the network interface using an add command; wherein, in the low-power or sleep mode, the baseboard management controller is accessed only through the static network address, while after being woken up, it can be accessed simultaneously through both the static network address and the new dynamic network address.

[0060] Specifically, when the baseboard management controller enters low-power or sleep mode, it maintains a pre-configured static network address that remains valid and in listening mode, ensuring the management channel remains available even in low-power conditions. Simultaneously, to conserve power and avoid unnecessary network traffic, it suspends client requests for Dynamic Host Configuration Protocol (DHCP) and address renewal operations. When the baseboard management controller is awakened and resumes normal operation, it immediately re-initiates DHCP requests because the previous dynamic network address lease may have expired. A new dynamic network address needs to be acquired and configured on the network interface using an add command, coexisting with the static address. Thus, the continued existence of the static address ensures that even when the device is in sleep mode, DHCP service is unavailable, or the network environment changes, maintenance personnel can still remotely access and wake up the baseboard management controller using a known, fixed static address, guaranteeing the reliability of the management channel in low-power mode. Suspending DHCP service during sleep reduces unnecessary network packet interaction.

[0061] The network address configuration method provided in this application is applied to a network address configuration system, which includes:

[0062] The configuration interface provides multiple address source configuration items, including the first static network address configuration item (the address source configuration item corresponding to the original static network address configuration), the dynamic network address configuration item (the address source configuration item corresponding to the original dynamic network address configuration), and the second static network address configuration item (a dedicated static network address configuration item).

[0063] Multiple address source configuration items are configured to support multiple network address configuration modes, including static mode, dynamic mode, and compatibility mode. Static mode corresponds to enabling the first static network address configuration item, dynamic mode corresponds to enabling the dynamic network address configuration item, and compatibility mode corresponds to enabling both dynamic and static network address configuration items. Compatibility mode supports simultaneous dynamic and static network address configuration.

[0064] Traditional baseboard management controller network configuration modes only allow for a choice between static network address configuration and dynamic network address configuration, which is a "mutually exclusive single selection" logic. Typically, only one process can control the IP address of a network interface at any given time.

[0065] This application achieves physical decoupling by adding an extra static network address configuration item (second static network address configuration item) dedicated to compatibility mode in the configuration interface. This makes the first static network address configuration item dedicated to static mode settings, and the newly added static network address dedicated to compatibility mode network address settings, thus avoiding configuration conflicts. In compatibility mode, static network addresses used for backup or parallel processing can be set independently without interfering with the static network addresses reserved by the user for "static mode", thereby supporting the implementation of compatibility configuration strategies.

[0066] The baseboard management controller is communicatively coupled with the configuration interface. It is configured to obtain selection instructions through the configuration interface, determine a configuration strategy for a network address configuration mode that matches the selection instructions, and adjust the enabling status of multiple address source configuration items based on the configuration strategy so that the baseboard management controller can be accessed through at least one of dynamic network addresses and / or static network addresses.

[0067] Specifically, users can enter the network address configuration mode selection command in the configuration interface. The baseboard management controller can obtain the selection command through the configuration interface and then determine the configuration strategy to be executed based on the selection command.

[0068] If the instruction is selected as static mode, the first static network address configuration item is enabled, the static network address that needs to be obtained in static mode is obtained, the static network address is used as the parameter of the first static network address configuration item, the static network address is configured in the network interface of the baseboard management controller, and the static network address is activated so that the baseboard management controller can be accessed through the static network address.

[0069] If the command is selected as dynamic mode, the dynamic network address configuration item is enabled, a dynamic host configuration protocol request is initiated to obtain the dynamic network address, the dynamic network address is used as a parameter of the dynamic network address configuration item, the dynamic network address is configured on the network interface of the baseboard management controller, and the dynamic network address is activated so that the baseboard management controller can be accessed through the dynamic network address.

[0070] If the instruction is selected as compatibility mode, the dynamic network address configuration item and the second static network address configuration item are enabled. The static network address is obtained from the dedicated static network address configuration item set in the preset storage area. A dynamic host configuration protocol request is initiated to obtain the dynamic network address. At the same time, the default configuration operation of the dynamic host configuration protocol request process on the network interface is intercepted. In response to receiving the dynamic network address, the dynamic network address is configured on the network interface of the baseboard management controller using the add command. The static network address and the dynamic network address are configured on the same network interface of the baseboard management controller so that the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.

[0071] In a specific application scenario, the network address configuration method of this application can be as follows: Figure 2 As shown:

[0072] First, the baseboard management controller acquires and parses the network settings and parameters, determines whether the network address configuration mode corresponding to the selection command is a compatibility mode, and if it is a static mode, it enables the first static network address configuration item according to the original static network address configuration mode, acquires the static network address that needs to be acquired in the static mode, configures the static network address in the network interface of the baseboard management controller, and activates the static network address.

[0073] If it is in dynamic mode, the dynamic network address configuration item is enabled, a dynamic host configuration protocol request is initiated to obtain a dynamic network address, the dynamic network address is configured on the network interface of the baseboard management controller, and the dynamic network address is activated.

[0074] If in compatibility mode, the second static network configuration item is enabled to additionally support the function of accessing a dedicated static network address. The dynamic host configuration protocol is initiated to obtain the dynamic network address and related parameters. After receiving the dynamic host configuration protocol request, the server of the dynamic host configuration protocol sends the dynamic network address and related parameters to the baseboard management controller, and configures the dynamic network address and static network address on the network interface of the baseboard management controller.

[0075] In this implementation, it is essentially a mechanism that combines static configuration with DHCP client functionality. Upon startup, the system actively attempts to request a dynamic network address via DHCP, while simultaneously keeping a pre-configured static network address active. Therefore, regardless of whether DHCP allocation is successful, the access channel corresponding to the static network address is always available, thus enabling parallel access via dual IP addresses.

[0076] In another specific application scenario, the network address configuration method of this application can be as follows: Figure 3 As shown:

[0077] First, the baseboard management controller acquires and parses the network settings and parameters, determines whether the network address configuration mode corresponding to the selection command is a compatibility mode, and if it is a static mode, it enables the first static network address configuration item according to the original static network address configuration mode, acquires the static network address that needs to be acquired in the static mode, configures the static network address in the network interface of the baseboard management controller, and activates the static network address.

[0078] If it is in dynamic mode, the dynamic network address configuration item is enabled, a dynamic host configuration protocol request is initiated to obtain a dynamic network address, the dynamic network address is configured on the network interface of the baseboard management controller, and the dynamic network address is activated.

[0079] In compatibility mode, the second static network configuration option is enabled to additionally support access via a dedicated static network address. A Dynamic Host Configuration Protocol (DHCP) is initiated to obtain the dynamic network address and related parameters. It is then determined whether the dynamic network address can be obtained. If obtained, the DHCP server sends the obtained dynamic network address and related parameters to the baseboard management controller, configuring both the dynamic and static network addresses on the baseboard management controller's network interface. If obtaining the dynamic network address fails, the already configured static network address is maintained as the baseboard management controller's access channel.

[0080] In this implementation, the system first attempts to obtain a dynamic IP address from the DHCP server. If successful, the BMC can access the network through this dynamic IP address. The system monitors whether the DHCP request times out or fails. If the DHCP request fails, the system automatically uses a preset static network address as a backup access channel to ensure that the BMC is reachable under any network environment. In summary, the compatibility mode is implemented based on a dual-protocol stack (static network address and dynamic network address) parallel operation mechanism, combined with the DHCP client's status detection and fault fallback functions.

[0081] In this application, there are two implementation methods: one is to pass parameters to the BMC through the BIOS Setup function, and the other is to have the BMC implement the function. Alternatively, the BMC can develop and implement both functions. If the BMC develops and implements both functions, the BIOS Setup function can be similarly implemented on the BMC's WebUI interface.

[0082] It cannot be ruled out that other software, firmware (including but not limited to CPLD, FPGA, etc.), operating systems, etc., can replace the role of BIOS in the above scheme to cooperate with BMC to implement the above network address configuration method.

[0083] The method of setting a dedicated static network address in the above scheme can also be replaced by expanding and optimizing the original option functions. For example, the address source setting function can still retain the two functions of Dynamic BMC DHCP and Static, while the function of Dynamic BMC DHCP setting can be implemented as the function of the dedicated static network address setting in the above scheme, that is, it is compatible with both DHCP mode and default Static IP address setting.

[0084] Embodiments of this application also provide an electronic device, such as... Figure 4 As shown, it includes a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the network address configuration method embodiments described above.

[0085] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the network address configuration method embodiments described above when it is run.

[0086] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), mobile device, magnetic disk, or optical disk.

[0087] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0088] The network address configuration method provided in this application has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A network address configuration method, characterized in that, The network address configuration method, applied to a baseboard management controller, includes: A dedicated static network address configuration item is set in the preset storage area; the dedicated static network address configuration item is an additional static network address configuration item set on the basis of the address source configuration item corresponding to the original static network address configuration and the address source configuration item corresponding to the original dynamic network address configuration. In response to system startup, the static network address is read from the dedicated static network address configuration item, and the static network address is configured in the network interface of the baseboard management controller using the add command; Initiate a Dynamic Host Configuration Protocol (DHCP) request to obtain a dynamic network address, and at the same time, intercept the DHCP request process's default configuration operations on the network interface; In response to receiving a dynamic network address, the dynamic network address is configured in the network interface of the baseboard management controller using the add command; In response to the default gateway parameter obtained in the Dynamic Host Configuration Protocol (DHCP) request process, the default gateway parameter is set as the system's default route; In response to the configuration of a separate gateway in the dedicated static network address configuration item, a target static route is added for the network segment where the static network address is located; wherein, the target static route uses the separate gateway as the next-hop address; Set the target static route to a height value so that the target static route has a lower priority than the default route assigned by the Dynamic Host Configuration Protocol; In response to the failure of the default route assigned by the Dynamic Host Configuration Protocol, the target static route is used as a temporary default route; In response to the service recovery of the Dynamic Host Configuration Protocol, the temporary default route is switched to the default route; The static network address and the dynamic network address are configured on the same network interface of the baseboard management controller, so that the baseboard management controller can be accessed through at least one of the dynamic network address and the static network address.

2. The network address configuration method according to claim 1, characterized in that, The process of initiating a Dynamic Host Configuration Protocol (DHCP) request to obtain a dynamic network address, and simultaneously intercepting the DHCP request process's default configuration operations on the network interface, includes: Initiate a Dynamic Host Configuration Protocol (DHCP) request and simultaneously enable a pre-deployed script. When the client of the DHCP request successfully obtains the dynamic network address, the pre-deployed script forces the return of a preset value to terminate the DHCP request and overwrite the network address already configured on the network interface by default.

3. The network address configuration method according to claim 1, characterized in that, The step of configuring the dynamic network address in the network interface of the baseboard management controller using the add command in response to receiving the dynamic network address includes: Listen for the status of Dynamic Host Configuration Protocol (DHCP) request and response. If a dynamic network address is not successfully obtained within a preset timeout period, the failure to obtain the dynamic network address is recorded, and the configured static network address is maintained as the access channel for the baseboard management controller. If a dynamic network address is successfully obtained within a preset timeout period, the dynamic network address is obtained and used together with the static network address as the access channel for the baseboard management controller.

4. The network address configuration method according to claim 1, characterized in that, The step of configuring the dynamic network address in the network interface of the baseboard management controller using the add command in response to receiving the dynamic network address includes: In response to receiving a dynamic network address, the dynamic network address is transmitted to the master process of the baseboard management controller, and the master process of the baseboard management controller is controlled to use an add command to configure the dynamic network address in the network interface of the baseboard management controller.

5. The network address configuration method according to claim 1, characterized in that, The network address configuration method further includes: Before using the add command to configure a static network address to the network interface of the baseboard management controller, perform an address conflict check; and before using the add command to configure a dynamic network address to the network interface of the baseboard management controller, perform an address conflict check. The execution address conflict verification includes: Obtain the network address to be configured and the network address already configured, wherein the configured network address is the network address that has been configured and is effective on the network interface of the baseboard management controller; Compare the network address to be configured with the network address that has already been configured; In response to the fact that the network address to be configured is consistent with the network address already configured, the value of the host number of the network address to be configured is adjusted, a new network address to be assigned is generated, and the new network address to be assigned is used to replace the network address to be configured.

6. The network address configuration method according to claim 1, characterized in that, Before setting the dedicated static network address configuration item in the preset storage area, the following is also included: Obtain information on the number of devices to be deployed and their basic static network addresses; Based on the quantity information and the basic static network address, multiple derived static network addresses equal to the number of devices to be deployed are generated according to the address expansion algorithm. The multiple derived static network addresses are distributed and configured to the corresponding devices to be deployed.

7. The network address configuration method according to claim 6, characterized in that, The step of generating multiple derived static network addresses equal to the number of devices to be deployed, based on the quantity information and the basic static network addresses, according to the address expansion algorithm, includes: Parse the basic static network address to obtain the host number corresponding to the basic static network address; Starting with the host number, a target derived static network address is generated for the target device to be deployed, wherein the host number of the target derived static network address is incremented based on the starting value.

8. The network address configuration method according to claim 1, characterized in that, Before the default gateway parameter is obtained in the Dynamic Host Configuration Protocol (DMP) request process, the following steps are included: detecting whether the default gateway parameter has been obtained in the DMP request process; The response before configuring a separate gateway in the dedicated static network address configuration item includes: Check whether a dedicated gateway is configured in the dedicated static network address configuration item.

9. The network address configuration method according to claim 1, characterized in that, The network address configuration method further includes: In response to the fact that a static network address and a dynamic network address have been configured on the network interface of the baseboard management controller, a preset firewall rule template is obtained, and the preset firewall rule template filters based on the network service port; The static and dynamic network addresses configured on the network interface of the baseboard management controller are applied in batches to the firewall rule template, creating the same access control rules for the static and dynamic network addresses configured on the network interface of the baseboard management controller. When a new network address is detected or an existing network address is deleted on the network interface of the baseboard management controller, the firewall rules are updated to maintain policy consistency.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the network address configuration method as described in any one of claims 1 to 9 when executing the computer program.

Citation Information

Patent Citations

  • White box engineering IP network optimization

    CN110677508A

  • IP configuration method and device, controller and storage medium

    CN115102926A

  • Method and device for determining network configuration information, computer equipment and storage medium

    CN119814733A