summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2021-06-01 22:57:25 -0400
committersongyanchao <[email protected]>2021-06-01 22:57:25 -0400
commit401d44152bbe440a27a5a3733b0822f76def75dc (patch)
treef3dc90bb70a5bee72f7f4925454a0ffbbffdf720
parentde340fce14aa21f757c037fe744fdcc57ed5de6a (diff)
Repair management port IP automatic configuration error problemGN-2021.06-dev
-rwxr-xr-xmachine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform6
1 files changed, 5 insertions, 1 deletions
diff --git a/machine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform b/machine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform
index 17e295b6..b44b0ab1 100755
--- a/machine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform
+++ b/machine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform
@@ -10,7 +10,11 @@ config_ethmgmt_static() {
# For BASE#1 BASE#2, we use static IP caculated from IPMI address.
# For Front GE#1, GE#2, use DHCPv4
- local chassis_mgmt_id=$(ipmitool picmg addrinfo | grep "Hardware Address" | sed 's/^Hardware Address.*0x4\(.*\)/\1/' | awk '{print $1+16'})
+ local ipmi_output=$(ipmitool picmg addrinfo)
+ local sub_str=${ipmi_output:22:1}
+ local hex_str=0x$sub_str
+ local ip_num=$(printf %d $hex_str)
+ local chassis_mgmt_id=$(($ip_num+16))
local chassis_mgmt_ip_addr="10.254.${chassis_mgmt_id}.1"
local chassis_mgmt_ip_prefix="255.255.0.0"