|
@@ -98,9 +98,9 @@ void main(void)
|
|
|
//初始化系统时间
|
|
|
system("date -s 2020.05.12-00:00:00");
|
|
|
|
|
|
- // //Initialize IP
|
|
|
- // char cmdStr[100];
|
|
|
- // LanInfo_T *pSetLanInfo = &g_BMCInfo.IpmiConfig.LanInfo[0];
|
|
|
+ //Initialize IP
|
|
|
+ char cmdStr[100];
|
|
|
+ LanInfo_T *pSetLanInfo = &g_BMCInfo.IpmiConfig.LanInfo[0];
|
|
|
// //down
|
|
|
// sprintf(cmdStr, "ifconfig %s down", pSetLanInfo->EthName);
|
|
|
// printf("%s\n", cmdStr);
|
|
@@ -112,20 +112,15 @@ void main(void)
|
|
|
// pSetLanInfo->MACAddr[4], pSetLanInfo->MACAddr[5]);
|
|
|
// printf("%s\n", cmdStr);
|
|
|
// system(cmdStr);
|
|
|
- // //ip, broadcast, netmask
|
|
|
- // sprintf(cmdStr, "ifconfig %s %d.%d.%d.%d broadcast %d.%d.%d.%d netmask %d.%d.%d.%d up",
|
|
|
- // pSetLanInfo->EthName, pSetLanInfo->IPAddr[0], pSetLanInfo->IPAddr[1],
|
|
|
- // pSetLanInfo->IPAddr[2], pSetLanInfo->IPAddr[3], pSetLanInfo->BroadCast[0],
|
|
|
- // pSetLanInfo->BroadCast[1], pSetLanInfo->BroadCast[2], pSetLanInfo->BroadCast[3],
|
|
|
- // pSetLanInfo->NetMask[0], pSetLanInfo->NetMask[1], pSetLanInfo->NetMask[2],
|
|
|
- // pSetLanInfo->NetMask[3]);
|
|
|
- // printf("%s\n", cmdStr);
|
|
|
- // system(cmdStr);
|
|
|
- // //default gw
|
|
|
- // sprintf(cmdStr, "route add default gw %d.%d.%d.%d", pSetLanInfo->DefaultGW[0],
|
|
|
- // pSetLanInfo->DefaultGW[1],pSetLanInfo->DefaultGW[2],pSetLanInfo->DefaultGW[3]);
|
|
|
- // printf("%s\n", cmdStr);
|
|
|
- // system(cmdStr);
|
|
|
+ //ip, broadcast, netmask
|
|
|
+ sprintf(cmdStr, "ifconfig %s %d.%d.%d.%d broadcast %d.%d.%d.%d netmask %d.%d.%d.%d up",
|
|
|
+ pSetLanInfo->EthName, pSetLanInfo->IPAddr[0], pSetLanInfo->IPAddr[1],
|
|
|
+ pSetLanInfo->IPAddr[2], pSetLanInfo->IPAddr[3], pSetLanInfo->BroadCast[0],
|
|
|
+ pSetLanInfo->BroadCast[1], pSetLanInfo->BroadCast[2], pSetLanInfo->BroadCast[3],
|
|
|
+ pSetLanInfo->NetMask[0], pSetLanInfo->NetMask[1], pSetLanInfo->NetMask[2],
|
|
|
+ pSetLanInfo->NetMask[3]);
|
|
|
+ printf("%s\n", cmdStr);
|
|
|
+ system(cmdStr);
|
|
|
|
|
|
printf("\tChassisID %#02x, SlotID %#02x\r\n", g_BMCInfo.ChassisID, g_BMCInfo.SlotID);
|
|
|
if(g_BMCInfo.IpmiConfig.PrimaryIPMBSupport)
|