diff options
| author | songyanchao <[email protected]> | 2021-06-01 22:57:25 -0400 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2021-06-01 22:57:25 -0400 |
| commit | 401d44152bbe440a27a5a3733b0822f76def75dc (patch) | |
| tree | f3dc90bb70a5bee72f7f4925454a0ffbbffdf720 | |
| parent | de340fce14aa21f757c037fe744fdcc57ed5de6a (diff) | |
Repair management port IP automatic configuration error problemGN-2021.06-dev
| -rwxr-xr-x | machine/geedge/9000-NPB-P01R01/rootconf/sysroot-lib-onie/networking-platform | 6 |
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" |
