Network Management Mechanism Guide
更新时间: 2025/12/06
在Gitcode上查看源码

1. BMC Network Management Introduction

The main responsibility of bmc_network is IPv4/IPv6 configuration, ensuring normal BMC network communication from two perspectives:

  1. Configuring external IP addresses: Users can connect to the BMC via the management IP address configured on the BMC.
  2. Configuring internal IP addresses: These are primarily used for network communication between the management board and the BMC, or between multiple BMCs within the same chassis.

Networking example

The eth0.702 (702 is the VLAN ID) network port device belongs to the internal network port group on the 171.31.1.x subnet.

eth0.701, eth2, and eth3 belong to the external network port group on the xx.xx.16.x subnet. External IP addresses switch among these three network port devices. Currently, eth0 and eth2 are mostly used.

2. BMC Network Management Objects

2.1 Common Objects

IPv4

This class primarily carries IPv4 information for external network ports, including the IP address, subnet mask, default gateway, address acquisition mode (DHCP or Static), backup IP address (activated in DHCP mode), and backup subnet mask. It also provides modification interfaces for these properties.

PropertyDescription
IpModeIPv4 network mode, which can be DHCP or Static
IpAddrIP address
BackupIpAddrBackup IPv4 Address
SubnetMaskIPv4 subnet mask
BackupSubnetMaskBackup IPv4 subnet mask
DefaultGatewayDefault IPv4 gateway
EthNameName of the external network port device, such as eth0.701 (701 indicates a VLAN)

IPv6

This class primarily carries IPv6 information for external network ports, including the IP address, prefix length, default gateway, and address acquisition mode (DHCPv6 or Static). It also provides modification interfaces for these properties (see 4. Common BMC Network Interfaces for interface usage).

PropertyDescription
IpModeIPv6 network mode, which can be DHCPv6 or Static
IpAddrIP address
PrefixLengthLength of the IPv6 prefix
ScopeLink,Global
DefaultGatewayDefault IPv6 gateway

EthernetInterfaces

This class primarily carries most of the information for external network ports.

PropertyDescription
EthNameName of the external network port device, such as eth0.701 (701 indicates a VLAN)
NetModeFixed network port mode/adaptive mode (selecting the external network port based on the NIC priority)
MacExternal MAC address of the BMC
IpVersionIPv4/IPv6 enabling status
PortIdID of the currently activated network port, corresponding to Id of MgmtPort
NcsiEnableNC-SI enabling status
VLANEnableNC-SI VLAN enabling status
VLANIdNC-SI VLAN ID
LinkLocalAddressIPv6 link-local address

MgmtPort

This class primarily carries physical NIC information.

PropertyDescription
IdUnique identifier (PortId in EthernetInterfaces refers to this). Currently, the dedicated port is fixed at 1, and others start from 2 and are returned to the network adapter.
EthIdAssociated eth device ID. The value 2 indicates eth2.
DeviceIdNIC device information. Currently, the value is 1, which is not critical.
DevicePortIdPort number on the NIC (one NIC has multiple ports), such as port1 or port2.
SilkscreenNIC silkscreen, such as Mgmt or Port1.
AdaptiveFlagWhether the port participates in adaptive mode.
LinkStatusLink status: Disconnected, Connected (updated by bmc_network for dedicated ports and by the network adapter for NC-SI ports).
TypeNIC type (PCIe, Dedicated, OCP, LOM, and more).
VLANEnabledWhen Id is 1, this represents the VLAN information for the dedicated port. When Id is not 1, this indicates the VLAN information for the NC-SI port.
VLANIdVLAN ID
PriorityPriority for adaptive mode.

LldpConfig

This class primarily carries LLDP-related configurations.

PropertyDescription
EnabledWhether to enable the LLDP service, which is disabled by default. Set true to enable.
WorkModeLLDP working mode. Currently, only the Tx mode is supported.
TxDelaySecondsLLDP Tx delay.
TxIntervalSecondsLLDP Tx interval.
TxHoldLLDP Tx hold time.
LLDPSupportWhether to support the LLDP function. LLDP is not supported by default, preventing its service and routine test from starting.
LLDPParseEnabledWhether to support the LLDP parsing function. LLDP parsing is not supported by default.
LLDPOverNCSIEnabledWhether to support LLDP over NC-SI. LLDP Over NC-SI is not supported by default, preventing LLDP from parsing packets sent by NC-SI.
LLDPGetPortDescEnabledWhether to support LLDP port description acquisition. This function is not supported by default, preventing the Port Desc field from being parsed.

LLDPInfo

This class primarily carries information related to LLDP packet parsing.

PropertyDescription
PortNamePort number parsed from the packet
PortDescPort description parsed from the packet
SystemDescSwitch model parsed from the packet
OrgSpecOrganization model parsed from the packet
ManagementIPManagement address parsed from the packet
SlotIdU position number corresponding to the cabinet port, defaulting to 0

Assembly

This class primarily carries information related to LLDP packet parsing.

PropertyDescription
HostNameHost name
SystemGUIDSystem-wide unique identifier, which can be modified by users
DomainNameDomain name
UUIDDevice-wide unique identifier, which can only be generated by the IPMI and cannot be modified
ManagementIPManagement address parsed from the packet
FQDNFully qualified domain name (FQDN) in format of host_name.domain_name

Group

This class currently primarily persists the MAC address of external network ports.

PropertyDescription
GroupIdFixed as EthGroup0
EthNameExternal network port name, such as eth2 and eth0
EthIdExternal network port ID, such as 2 and 0
MacExternal network port MAC address, defaulting to 20:22:01:75:BC:60

EthMac

This class primarily carries network port hardware-related configurations.

PropertyDescription
GroupIdNetwork port group ID, such as EthGroup0 and MaintEthGroup
EthNameNetwork port name, such as eth2 and eth0
EthIdExternal network port ID, such as 2 and 0
MacNetwork port MAC address
MacUseEnabledWhether to enable the MAC address, with only one enabled for a network port group
SpeedDuplexEnableWhether to enable the auto-negotiation mode of the network port
SpeedSettingNetwork port speed: 0 for N/A, 1 for 10 Mbit/s, 2 for 100 Mbit/s, and 3 for 1,000 Mbit/s
DuplexSettingNetwork port working mode: 0 for N/A, 1 for half-duplex, and 2 for full-duplex

HeartBeat

This class primarily carries internal network heartbeat configuration.

PropertyDescription
NameName of the entity monitoring the heartbeat, such as IRMHeartBeat
StatusCurrent heartbeat status, such as Lost

EthGroup

This class primarily carries configurations for internal networks, multiple external network ports, and maintenance network ports.

PropertyDescription
GroupIdNetwork port group ID, which is unique
NameNetwork port group name, such as InnerEthGroup, MaintEthGroup, or VethGroup
OutTypeType of network port group, including 1 (internal), 2 (external), 3 (veth), 4 (internal network for local maintenance of the Atlas compute node), 5 (external network for local maintenance of the Atlas compute node), 6 (floating IP network of the SMM), 7 (internal network for the peer SMM), 8 (dedicated network port for local O&M), 9 (internal network for cabinet management), and 10 (internal network of the cabinet node)
ActiveEthIdIndex of the currently activated network port, such as 2 for eth2
InnerNetWorkInternal subnet, which is not used
VLANIdVLAN ID corresponding to the activated network port in this group
VLANEnabledWhether to enable the VLAN corresponding to the activated network port in this group
EthAliasAlias of the activated network port. If there is an alias, the maximum value is 254 (255 indicates that there is no alias), for example, eth2:0.
InnerNetWorkInternal subnet, such as 172.31.1.0
IpAddrIPv4 address
BaseIpAddrBase IPv4 address, compared with IpAddr, which is used to determine if the internal IP address is generated based on the slot number
SubnetMaskIPv4 subnet mask
DefaultGatewayIPv4 gateway
Ipv6AddrIPv6 address
PrefixLengthIPv6 prefix length
Ipv6DefaultGatewayIPv6 gateway
IpPolicyIP address generation policy: 0 for default IP address basis and 1 for slot and base IP address basis
StatusWhether the IP address is in the working state
IpModeIPv4 mode, which can be Static or DHCP
Ipv6ModeIPv6 mode, which can be Static or DHCPv6
IpVersionIP protocol type, including IPv4, IPv6, and IPv4AndIPv6
AssociatedPortTypeNetwork port type associated with the group
ChannelLAN channel number corresponding to the network port

Relationships Between Classes

2.2 Common Customization Items

Customization item document

Customization ItemCustomization InterfaceDefault ValueProcessing LogicDescription
BMC host nameBMCSet_Hostname
Custom_SerialNUM
BMCSet_Hostname:offif (BMCSet_Hostname == on)
Use Custom_SerialNUM as Hostname.
else
if (product-serialnumber in the FRU data != Empty)
Use product-serialnumber as Hostname.
else
Set HostName as the host name.
If BMCSet_Hostname is set to on, Custom_SerialNUM is used as the hostname. The value is a string of 1 to 64 characters.
(1) By default, the product serial number is used as the host name.
(2) The host name cannot contain the following characters: ` ~ ! @ # $ % ^ & * ( ) _ = + [ { } ] | ; : ' , < . > / ? \ (including space).
IPv4 address of the management network portBMCSet_ETH0_DHCPMode
BMCSet_Eth0_Ipv4
Custom_Eth0_Ip_Addr
Custom_ipv4_gateway
Custom_Eth0_DefaultPolicy
BMCSet_ETH0_DHCPMode: on
BMCSet_Eth0_Ipv4: off
Custom_Eth0_Ip_Addr: empty string
Custom_ipv4_gateway: empty string
Custom_Eth0_DefaultPolicy: 1
if (BMCSet_ETH0_DHCPMode == off)
if(BMCSet_Eth0_Ipv4 = on)
Set the IPv4 address and subnet mask of the external network port to the value of Custom_Eth0_Ip_Addr.
if (Custom_ipv4_gateway != Empty)
Set the IPv4 gateway address of the external network port to the value of Custom_ipv4_gateway.
else
Set the IPv4 gateway address of the external network port to the value of Custom_Eth0_Ip_Addr.
else
if(Custom_Eth0_DefaultPolicy == 2)
Set the IPv4 address and subnet mask of the external network port to 192.168.2.100/24.
Set the IPv4 gateway address of the external network port to 192.168.2.100.
else
Set the IPv4 address of the external network port to DHCP mode.
else
Set the IPv4 address of the external network port to DHCP mode.
BMCSet_ETH0_DHCPMode: mode for obtaining the BMC IPv4 address. The value can be:
on or not configured: The IPv4 address is obtained in DHCP mode.
off: The IPv4 address is obtained in static mode.

BMCSet_Eth0_Ipv4: customization of the BMC IPv4 address (including the mask). The value can be:
on: The static address is set based on the value of Custom_Eth0_Ip_Addr.
off or not configured: The DHCP mode is used.

Custom_Eth0_DefaultPolicy: default policy of the BMC network port. The value can be:
1: DHCP mode
2: fixed as 192.168.2.100/24
BMC external network port modeBMCSet_NET_Modemgntif (BMCSet_NET_Mode == Empty)
Set the network port mode to the forced dedicated management network port.
else
Set the network port mode to the value of BMCSet_NET_Mode.
Mode of the BMC management network port. The value can be:
mgnt or not configured: forced management network port
auto: adaptive (based on the link status of the management network port)
pcie: forced PCIe NC-SI mode
NC-SI network port bindingCustom_NCSI_Port_Num0if (BMCSet_NET_Mode != auto && BMCSet_NET_Mode != mgnt)
if (Custom_NCSI_Port_Num != Empty)
Bind the NC-SI network port specified by Custom_NCSI_Port_Num.
else
No action
elseif (BMCSet_NET_Mode == auto && Custom_NCSI_Port_Num != Empty)
Add the NC-SI network port specified by Custom_NCSI_Port_Num to adaptive network ports.
else
No action
NC-SI network port number. The options are:
For four-port configurations, the value ranges from 0 to 3.
For two-port configurations, the value ranges from 0 to 1.
Note: Currently, only standard PCIe NICs can be bound to NC-SI ports.
VLAN ID of the NC-SI network portBMCSet_NCSI_VLAN_ID0if (BMCSet_NCSI_VLAN_ID != Empty)
Set the VLAN ID of the NC-SI network port to the value of BMCSet_NCSI_VLAN_ID.
else
Set the VLAN ID of the NC-SI network port to 0 (disabling the VLAN function).
VLAN ID of the NC-SI network port. The value can be:
0: disables the VLAN function.
1 to 4094: sets the effective VLAN ID.
IPv4/IPv6 enablement for the network portBMCSet_IPVersionIPv4AndIPv6if (BMCSet_IPVersion == Empty)
Set the IP version to IPv4AndIPv6.
else
Set the IP version to the value of BMCSet_IPVersion.
IP version supported by the BMC network. The value can be:
IPv4
IPv4AndIPv6
IPv6
BMC domain nameBMCSet_DDSN_DomainNameEmptySet the domain name to the value of BMCSet_DDSN_DomainName.The value contains 0 to 67 characters.
The value must:
1. Consist of digits, letters, hyphens (-), and dots (.).
2. Not start with a hyphen or dot, and not end with a hyphen.
3. Contain no more than 63 characters between any two dots.

2.3 Common Network CSR Configurations

Network configuration CSR file: The platform.sr file of the corresponding model in the vpd repository.

eth0 and eth2 as External Network Ports, Both Using IP and MAC Addresses Sourced from IPv4/IPv6 Objects

json
        "EthMac_Eth0": &#123;
            "EthId": 0,
            "EthName": "eth0",
            "GroupId": "EthGroup0",
            "Mac": "20:22:01:75:BC:60",
            "MacUseEnabled": false,
            "SpeedDuplexEnable": true,
            "SpeedSetting": 0,
            "DuplexSetting": 0
        &#125;,
        "EthMac_Eth2": &#123;
            "EthId": 2,
            "EthName": "eth2",
            "GroupId": "EthGroup0",
            "Mac": "20:22:01:75:BC:60",
            "MacUseEnabled": true,
            "SpeedDuplexEnable": true,
            "SpeedSetting": 0,
            "DuplexSetting": 0
        &#125;

Note: The same GroupId indicates that eth0 and eth2 belong to the same external network port group. Both network ports use the MAC address of the port where MacUseEnabled is set to true. That is, eth0 uses the MAC address of eth2.

Dual Network Port Configuration (Both the NC-SI and Dedicated Port Configured with External IP Addresses), With the Dedicated Port Using the IPv4 Object and New Port Using the EthGroup Object

json
        "EthMac_Eth0": &#123;
            "EthId": 0,
            "EthName": "eth0",
            "GroupId": "EthGroup0",
            "Mac": "20:22:01:75:BC:60",
            "MacUseEnabled": false,
            "SpeedDuplexEnable": true,
            "SpeedSetting": 0,
            "DuplexSetting": 0
        &#125;,
        "EthMac_Eth2": &#123;
            "EthId": 2,
            "EthName": "eth2",
            "GroupId": "EthGroup0",
            "Mac": "20:22:01:75:BC:60",
            "MacUseEnabled": true,
            "SpeedDuplexEnable": true,
            "SpeedSetting": 0,
            "DuplexSetting": 0
        &#125;,
        "EthGroup_OutEthGroup1": &#123;
            "Name": "OutEthGroup1",
            "GroupId": 0,
            "OutType": 2,
            "ActiveEthId": 0,
            "InnerNetWork": "",
            "VLANId": 4092,
            "VLANEnabled": false,
            "EthAlias": 255,
            "IpAddr":"192.168.2.200",
            "BackupIpAddr": "",
            "BaseIpAddr": "",
            "SubnetMask": "255.255.255.0",
            "BackUpSubnetMask": "",
            "DefaultGateway": "192.168.2.200",
            "IpPolicy": 0,
            "Status": true,
            "IpMode": "DHCP",
            "Ipv6Mode": "Static",
            "Ipv6Addr": "",
            "PrefixLength": 0,
            "Ipv6DefaultGateway": "",
            "AssociatedPortType": 1,
            "Channel": 2
        &#125;,
        "IPMIChannel_LAN2": &#123;
            "ChanType": 4,
            "Instance": 2,
            "ChanPro": 1,
            "ChannelID": 2,
            "DestAddr": 32,
            "SrcAddr": 0,
            "MedType": 4
        &#125;

2.4 bmc_network External Network Initialization Process

2.5 bmc_network Internal Network Initialization Process

2.6 DHCP Task Process

3. Network Features

3.1 Configuring the IPv4 Address

IPv4 addresses can be set in either of the following ways:

  1. Set static IPv4 information, including the IP address, subnet mask, and gateway.
  2. Set the DHCP mode, where The DHCP server dynamically distributes IPv4 information. You can also configure a backup IPv4 address and subnet mask. If DHCP fails to obtain an IP address, the BMC can still be accessed via the backup IP address.

3.2 Configuring the IPv6 Address

IPv6 addresses can be set in any of the following ways:

  1. Set static IPv6 information, including the IP address, prefix, and gateway.
  2. Set the DHCPv6 mode for dynamically distributed IPv6 information.
  3. Use SLAAC to automatically configure stateless addresses.

3.3 External Network Port Switching

BMC network devices typically come in two types: dedicated network ports and NC-SI network ports. A dedicated network port is the own management port of the BMC (usually eth2). An NC-SI network port refers to a port shared between the BMC and other network devices in the server via NC-SI (usually eth0). Network port switching refers to the switching of external network configurations between the dedicated port and the NC-SI port. For example, when switching from a dedicated port to an NC-SI port, the external IP address on eth2 will be cleared, and eth0 will be reconfigured with the external IP address. There are two modes for switching external network ports:

  1. Manually switching to a specified network port.
  2. Setting adaptive mode: The connected network port with the highest priority is automatically selected. (The dedicated network port usually has the highest priority.)

3.4 External Network VLAN Configuration

VLAN configuration includes dedicated network port VLAN and NC-SI network port VLAN. After a VLAN is configured, the BMC network port only processes packets with the corresponding VLAN tag, effectively partitioning a virtual LAN.

3.5 Network Port Configuration

  1. Network port MAC address configuration: You can modify the the MAC address of a BMC network port using the ipmi command. Generally, the MAC address is fixed after being set during equipment.
  2. Network port speed configuration: You can customize the network port speed and half/full duplex mode in auto-negotiation or non-auto-negotiation mode.
  3. Network ports up/down support: All network ports are brought up during initialization. Interfaces are also provided for bringing up/down network ports.

4. Common BMC Network Interfaces

4.1 busctl Interfaces

Setting IPv4 Information

Set the IP address, subnet mask, and gateway using busctl. Pass the four-part IP address, subnet mask, and gateway in order:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv4 bmc.kepler.Managers.EthernetInterfaces.Ipv4 SetIpMaskGateway a&#123;ss&#125;sss 3 Interface a UserName a ClientAddr a <ipaddr> <mask> <gateway>

Set the IP address and subnet mask using busctl. Pass the four-part IP address and subnet mask in order:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv4 bmc.kepler.Managers.EthernetInterfaces.Ipv4 SetIpAddr a&#123;ss&#125;ss 3 Interface a UserName a ClientAddr a <ipaddr> <mask>

Set the gateway using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv4 bmc.kepler.Managers.EthernetInterfaces.Ipv4 SetDefaultGateway a&#123;ss&#125;s 3 Interface a UserName a ClientAddr a <gateway>

Setting IPv6 Information

Set the IP address, prefix length, and gateway using busctl. Pass the IP address, prefix length, and gateway in order:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv6 bmc.kepler.Managers.EthernetInterfaces.Ipv6 SetIpv6PrefixGateway a&#123;ss&#125;sis 3 Interface a UserName a ClientAddr a <ipaddr> <prefix> <gateway>

Set the IP address and prefix length using busctl. Pass the IP address and prefix length in order:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv6 bmc.kepler.Managers.EthernetInterfaces.Ipv6 SetIpAddr a&#123;ss&#125;si 3 Interface a UserName a ClientAddr a <ipaddr> <prefix>

Set the gateway using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Ipv6 bmc.kepler.Managers.EthernetInterfaces.Ipv6 SetDefaultGateway a&#123;ss&#125;s 3 Interface a UserName a ClientAddr a <ipaddr> <prefix>

External Network Port Switching

Switch network ports using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces bmc.kepler.Managers.EthernetInterfaces SetNetworkConfig a&#123;ss&#125;sybq 3 Interface a UserName a ClientAddr a <network_mode> <port_ID> <NCSI_VLAN_enable> <NSCI_VLAN_ID>

Parameters:

  1. network_mode: The value can be Automatic or Fixed. Pass Fixed when switching to a specified network port, or Automatic to set adaptive mode.
  2. port_ID: This parameter takes effect only when NetMode is set to Fixed. It represents the ID of the network port to switch to (the ID of the dedicated port is usually 1).
  3. NCSI_VLAN_enable: The value is a Boolean value indicating whether to enable the VLAN function for the NC-SI network port.
  4. NSCI_VLAN_ID: This parameter is effective only when the VLAN function is enabled. If the VLAN function is disabled, the value is 0.

External Network VLAN Configuration

Notes: Configuration will cause network disconnection. You need to configure the same VLAN in the LAN. You can connect to the network through the serial port. Query method: Use the ifconfig command. Set the VLAN using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces bmc.kepler.Managers.EthernetInterfaces SetVLANConfig a&#123;ss&#125;bqy 3 Interface a UserName a ClientAddr a <VLAN_enable> <VLAN_ID> <port_type>

Parameters:

  1. VLAN_enable: The value is a Boolean value indicating whether to enable the VLAN function.
  2. VLAN_ID: This parameter is effective only when the VLAN function is enabled. If the VLAN function is disabled, the value is 0.
  3. port_type: The value 0 indicates setting the VLAN of NC-SI, and the value 1 indicates setting the VLAN of the dedicated network port.

Network Port Configuration

Setting the Network Port Speed

Use ethtool <EthName> or cat /sys/class/net/<EthName>/speed to query the network port speed. Set network port speed using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces/Eth bmc.kepler.Managers.EthernetInterfaces.EthConfig SetSpeed a&#123;ss&#125;sbyy 3 Interface a UserName a ClientAddr a <EthName> <SpeedDuplexEnable> <SpeedSetting> <DuplexSetting>

Parameters:

  1. EthName: For example, eth2 and eth0.
  2. SpeedDuplexEnable: The value is a Boolean value, indicating whether to enable the auto-negotiation mode for the network port.
  3. SpeedSetting: The value can be 0 for N/A (pass 0 when auto-negotiation is enabled), 1 for 10 Mbit/s, 2 for 100 Mbit/s, and 3 for 1,000 Mbit/s.
  4. DuplexSetting: The value can be 0 for N/A (pass 0 when auto-negotiation is enabled), 1 for half-duplex, and 2 for full-duplex.

Setting the Network Port Status

Run ipmcget -d ethport to query the port status. Set the network port status using busctl:

bash
busctl --user call bmc.kepler.bmc_network /bmc/kepler/Managers/1/EthernetInterfaces bmc.kepler.Managers.EthernetInterfaces SetEthState a&#123;ss&#125;sb 3 Interface a UserName a ClientAddr a <EthName> <port_status>

Parameters:

  1. EthName: For example, eth2 and eth0.
  2. port_status: The value is a Boolean value. true indicates bringing up the network port. false indicates bringing down the network port.

4.2 CLI Interfaces

Setting IPv4 Information

Set the static IPv4 address, subnet mask, and gateway using the CLI. Pass the four-part IP address, subnet mask, and gateway (optional) in order after -v:

bash
ipmcset -d ipaddr -v <ipaddr> <mask> [gateway]

Set the static IPv4 gateway using the CLI:

bash
ipmcset -d gateway -v <gateway>

Set the IPv4 mode to DHCP or Static using the CLI:

bash
ipmcset -d ipmode -v <dhcp|static>

Setting IPv6 Information

Set the static IPv6 address, prefix length, and gateway using the CLI. Pass the IP address, prefix length, and gateway (optional) in order after -v:

bash
ipmcset -d ipaddr6 -v <ipaddr> <prefix> [gateway]

Set the static IPv6 gateway using the CLI:

bash
ipmcset -d gateway6 -v <gateway>

Set the IPv6 mode to DHCPv6 or Static using the CLI:

bash
ipmcset -d ipmode6 -v <dhcp|static>

External Network Port Switching

Set the network mode using the CLI. Pass 1 for a fixed network port or 2 for adaptive mode:

bash
ipmcset -d netmode -v <network_mode>

Switch network ports using the CLI (switching is possible only in fixed network port mode):

bash
ipmcset -d activeport -v <port_type> <port_id>

Parameters:

  1. port_type: Set 0 for a dedicated network port, 1 for LOM, and 2 for PCIe.
  2. port_id: Set the index of the port for the specified network port type. (Port IDs start from 0. If the network port type is 0, this parameter is optional.)

4.3 IPMI Interfaces

Setting IPv4 Information

Setting the External IPv4 Address

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0x03 <four-byte_IP_address>

Setting the External IPv4 Subnet Mask

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0x06 <four-byte_subnet_mask>

Setting the External IPv4 Gateway

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0x0c <four-byte_gateway>

Setting the External IPv4 Mode

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0x04 <one-byte_mode>

The last byte represents the mode: 0x01 (Static) or 0x02 (DHCP).

Note:

  1. If only IPv6 is enabled, the IPv4 address, subnet mask, and gateway cannot be set.
  2. If the current mode is DHCP, it will change to Static mode after configuration.
  3. Passing all zeros for the IP address clears the IPv4 address (the subnet mask and gateway are also cleared).
  4. Passing all zeros for the subnet mask clears the IPv4 subnet mask (the gateway is also cleared).
  5. If the configured gateway is not in the same subnet as the current IP address, the operation fails.
  6. Passing all zeros for the gateway clears the IPv4 gateway.

Querying the External IPv4 Address

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0x03 0x00 0x00

Querying the External IPv4 Subnet Mask

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0x06 0x00 0x00

Querying the External IPv4 Gateway

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0x0c 0x00 0x00

Querying the External IPv4 Mode

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0x04 0x00 0x00

The first byte returned is always 11, and the following bytes are the query result.

Setting IPv6 Information

Setting the External IPv6 Address

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0xcc <three-byte_vendor_ID> <sixteen-byte_IPv6_address>

Setting the External IPv6 Prefix Length

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0xcd <three-byte_vendor_ID> <one-byte_prefix_length>

Setting the External IPv6 Gateway

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0xce <three-byte_vendor_ID> <sixteen-byte_gateway>

Setting the External IPv6 Mode

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 0xd0 <three-byte_vendor_ID> <one-byte_mode>

Querying the External IPv6 Address

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0xcc 0x00 0x00

Querying the External IPv6 Prefix Length

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0xcd 0x00 0x00

Querying the External IPv6 Gateway (Gateway Address Passed in Little-Endian Format)

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0xce 0x00 0x00

Querying the External IPv6 Mode

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x02 0x01 0xd0 0x00 0x00

The first byte returned is always 11, the following three bytes are the vendor ID, and the following bytes are the query result.

Setting the Network Mode

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x0c 0x01 0x01 <three-byte_vendor_ID> <one-byte_network_mode>

The network mode can be 1 (dedicated network port), 3 (adaptive mode), or 4 (PCIe mode, where the first port is used by default).

Setting the VLAN

bash
ipmitool -H <BMC_IP_address> -I lanplus -p 623 -U <username> -P <password> -C 17 raw 0x30 0x93 <three-byte_vendor_ID> 0x5a 0x1a 0x00 0x04 0x00 <one-byte_port_type> <one-byte_VLAN_enable> <two-byte_VLAN_ID>

Parameters:

  1. port_type: The value 0 indicates setting the VLAN of NC-SI, and the value 1 indicates setting the VLAN of the dedicated network port.
  2. VLAN_enable: The value 0 indicates that the VLAN is disabled, and the value 1 indicates that the VLAN is enabled.
  3. VLAN_ID: The value consists of two bytes, where the lower four bits of the first byte and the entire second byte form a 12-bit number.

4.4 RPC Interfaces

IPv4

Ipv4SetIpAddr

Callback function: set_ipv4_addr

Function: Sets the IPv4 address, passing only the IP address and subnet mask.

Prerequisites:

  1. The input IPv4 address is valid.
  2. The input subnet mask is valid.
  3. ip_version supports IPv4.
  4. No subnet conflicts exist with the internal network or maintenance IP addresses.

Note: The DHCP client will be stopped if this interface is used in DHCP mode, and the static address mode will be used.

Function implementation:

  1. Modify resource tree and database information.
  2. Record operation logs.
  3. Set the IPv4 address and subnet mask through a socket (core implementation).
  4. Update iptables rules in the network address translation (NAT) table for the external network.
  5. Emit signals for IPv4 address and subnet mask changes.
  6. Clear alias network ports.
  7. Modify iptables rules when the IP address changes.
  8. Broadcast ARP packets.

Ipv4SetDefaultGateway

Callback function: set_ipv4_gateway

Function: Sets the IPv4 gateway independently.

Prerequisites:

  1. The input gateway address is valid.
  2. ip_version supports IPv4.
  3. The current gateway and the IP address to be set are in the same subnet.

Function implementation:

  1. Modify resource tree and database information (DefaultGateway).
  2. Record operation logs.
  3. Set the IPv4 address through a socket (core implementation).
  4. Emit signals for IPv4 gateway changes.
  5. Broadcast ARP packets.

Ipv4SetIpMaskGateway

Callback function: set_ipv4_mask_gateway

Function: Sets the IPv4 address, passing the IP address, subnet mask, and gateway.

Prerequisites:

  1. The input parameters are valid.
  2. The subnets are the same.
  3. The IP address does not conflict with other IP addresses.

Note: The DHCP client will be stopped if this interface is used in DHCP mode, and the static address mode will be used.

Function implementation:

  1. Modify the database and resource tree.
  2. Record operation logs.
  3. Set the IPv4 address, subnet mask, and default gateway through a socket (core implementation).
  4. Update iptables rules in the NAT table for the external network.
  5. Modify iptables rules when the IP address changes.
  6. Emit signals for IPv4 information changes.
  7. Clear alias network ports.
  8. Broadcast ARP packets.

Ipv4SetDedicatedMaintIpMask

Callback function: set_dedicated_maint_ipv4_mask

Function: Sets the IPv4 address and subnet mask for dedicated port O&M.

Prerequisites:

  1. The input parameters are valid.
  2. The subnets are the same.
  3. The IP address does not conflict with other IP addresses.

Function implementation:

  1. Update the dedicated O&M network:
    • Set the IPv4 address and subnet mask of the O&M network port through a socket (core implementation).
    • Set route_localnet to 1 to ensure services like Web and SSH function normally.
    • Update iptables rules in the NAT table for the O&M network.
    • After the O&M network port is configured, ARP address resolution points to the maintenance IP address. Therefore, the external network port needs to actively send ARP packets to trigger address learning for the external IP address.
  2. Record operation logs.

IPv6

Ipv6SetIpAddr

Callback function: set_ipv6_addr

Function: Sets the IPv6 address, passing only the IP address and prefix length. ipv6_addr must be in the shortest string format, such as fe80::.

Prerequisites:

  1. The IPv6 address is valid.
  2. The prefix length is valid (the maximum prefix length is 128 bits).
  3. ip_version supports IPv6.

Note:

  1. If the passed prefix length is 0, the default value of 64 is used.
  2. Disable the DHCPv6 service first if the DHCP mode is used.

Function implementation:

  1. Record operation logs.
  2. Modify the database and resource tree.
  3. Delete the previous IPv6 information through a socket.
  4. Set new IPv6 information through a socket (core implementation).
  5. Emit signals for IPv6 address and prefix length changes.
  6. Send Neighbor Advertisement (NA) packets.
  7. Modify ip6tables rules when the IPv6 address changes.

Ipv6SetDefaultGateway

Callback function: set_ipv6_gateway

Function: Sets the IPv6 gateway independently.

Prerequisites:

  1. The gateway is valid.
  2. The gateway to be set is in the same subnet as the current IP address.
  3. ip_version supports IPv6.

Function implementation:

  1. Record operation logs.
  2. Modify resource tree and database information (DefaultGateway).
  3. Delete the previous IPv6 gateway through a socket.
  4. Set a new IPv6 gateway through a socket (core implementation).
  5. Emit signals for IPv6 gateway changes.

Ipv6SetIpv6PrefixGateway

Callback function: set_ipv6_prefix_gateway

Function: Sets the IPv6 address, passing the IP address, prefix length, and gateway.

Prerequisites:

  1. In Redfish scenarios, configuration is required if either IpAddr or PrefixLength is valid.
  2. The IP address, prefix length, and gateway are valid.
  3. The gateway to be set is in the same subnet as the current IP address.
  4. ip_version supports IPv6.

Note:

  1. In Redfish scenarios, an error will be reported if the IPv6 address is invalid.
  2. Disable the DHCPv6 service first if the DHCP mode is used.
  3. If the passed prefix length is 0, the default value of 64 is used.

Function implementation:

  1. Record operation logs.
  2. Modify resource tree and database information.
  3. Delete the previous IPv6 gateway through a socket.
  4. Set a new IPv6 gateway through a socket (core implementation).
  5. Delete the previous IPv6 information through a socket.
  6. Set new IPv6 information through a socket (core implementation).
  7. Emit signals for IPv6 address, prefix length, and gateway changes.
  8. Send NA packets.
  9. Modify ip6tables rules when the IPv6 address changes.

Ethernet

EthernetInterfacesGetAllPort

Callback function: get_all_port

Function implementation:

Traverse slot.Port and return all port information:

  • Id
  • EthId
  • DeviceId
  • DevicePortId
  • Silkscreen
  • Type
  • AdaptiveFlag
  • LinkStatus
  • Mac

EthernetInterfacesSetNetworkConfig

Callback function: set_network_config

Function: Sets network configuration.

Input parameters: NetMode, PortId, VLANEnable, and VLANId

Prerequisites:

  1. The network configuration does not conflict with the internal VLAN.
  2. The port ID is valid.
  3. In adaptive mode, the port remains unchanged from the previous one, and interface parameters are not accepted.
  4. If only vlan_id is modified while VLANEnable is false, the network is not restarted.

Function implementation:

  1. NetMode includes the adaptive mode and fixed network port mode.
  2. Update database and resource tree information.
  3. Switch the network port and restart the network, updating multi-IP address configurations for the external network port.
  4. Restart the network if the VLAN information of the NC-SI network port changes.

EthernetInterfacesAddMgmtPort

Callback function: add_mgmt_port

Function: Adds a management port.

Note:

  1. If portId is not 0, the existing port is updated. Otherwise, a port with the specified portId is registered.
  2. A value of 0 indicates a new registration, and a portId must be automatically generated.
  3. Modification of the dedicated network port is not supported.

Function implementation:

  1. Add a resource tree object.

EthernetInterfacesDeleteMgmtPort

Callback function: delete_mgmt_port

Function: Deletes a management port.

Note:

  1. When portId is 255, all NC-SI network ports are deleted.
  2. Dedicated network ports cannot be deleted.

Function implementation:

  1. Delete the resource tree object.

EthernetInterfacesSetVLANConfig

Callback function: rpc_set_vlan

Function: Sets the VLAN.

Prerequisites:

  1. The network configuration does not conflict with the internal VLAN.
  2. The vlan_id is within the range of 1 to 4094.

Function implementation:

  1. Set vlan_id based on portType. Currently, only two types are supported: 0 for NCSI and 1 for Dedicated.
  2. Determine whether the current model supports VLAN configuration for the dedicated network port. If not, return a failure message directly.

HeartBeatBeat

Callback function: heart_beat:beat

Function: Provides heartbeats.

EthernetInterfacesNetworkFailover

Callback function: network_failover

Function: Updates the network failover status.

Note: When the LAN switch (LSW) switches ports, ARP packets and NA packets are actively sent.

iptables

EthernetInterfacesAddIptablesRule

Callback function: add_iptables_rule

Input parameters: interface_name and ip_addr

Note:

  1. Operation logs are not recorded when this RPC method is called internally between SSDP components.
  2. The input parameter validation includes checks for special characters.

Function implementation:

  1. Implement the function using iptables commands of the OS.

EthernetInterfacesAddIp6tablesRule

Callback function: add_ip6tables_rule

Input parameters: interface_name and ipv6_addr

Note:

  1. Operation logs are not recorded when this RPC method is called internally between SSDP components.
  2. The input parameter validation includes checks for special characters.

Function implementation:

  1. Implement the function using ip6tables commands of the OS.

NatConfigAddNatRule

Callback function: add_nat_rule

Function: Adds an address mapping rule.

Input parameters: service_name and reg_params

Note:

  1. Currently, only one forwarding rule with a specified IP address can be added for a network port type.
  2. Based on the forwarding rules of all running services, a rule for forwarding from ps.Address to an internal address is added. Currently, only IPv4 addresses are supported.

Function implementation:

  1. add_multi_nat_rules or add_single_nat_rule
  2. Implement the function using iptables commands of the OS.

NatConfigUpdateNatRule

Callback function: update_nat_rule

Function: Updates an address mapping rule.

Input parameters: service_name and reg_params

Function implementation:

  1. update_multi_nat_rules or update_single_nat_rule.
  2. Implement the function using iptables commands of the OS.
  3. If the network port is unavailable, set route_localnet to 0.