diff options
author | HuyLe <hule@amperecomputing.com> | 2022-06-27 05:58:01 +0300 |
---|---|---|
committer | Chau Ly <chaul@amperecomputing.com> | 2023-02-21 06:22:40 +0300 |
commit | 6f575f9b1e49e3e4546f06b5242106de188bd4af (patch) | |
tree | 8859148adadf7bb26322a5232abb6aa78079eb93 /meta-ampere | |
parent | e072defa81f4af79a316a85ff0339a9b133c0555 (diff) | |
download | openbmc-6f575f9b1e49e3e4546f06b5242106de188bd4af.tar.xz |
meta-ampere: mac-update: MAC update with static IP
When the IP Address is configured to static IP, changing BMC MAC Address
in FRU does not change the MAC address in eth0. This commit fixes the
issue by adding IPMI MAC address update and some other configuration via
ipmitool lan set commands to ampere_update_mac.sh to ensure the update
is taking effect.
Signed-off-by: HuyLe <hule@amperecomputing.com>
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: Ib0466ee130af6d294fed03587c4d96328221d017
Diffstat (limited to 'meta-ampere')
-rw-r--r-- | meta-ampere/meta-common/recipes-ampere/platform/ampere-utils/ampere_update_mac.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meta-ampere/meta-common/recipes-ampere/platform/ampere-utils/ampere_update_mac.sh b/meta-ampere/meta-common/recipes-ampere/platform/ampere-utils/ampere_update_mac.sh index 6b86245d6d..6be938a866 100644 --- a/meta-ampere/meta-common/recipes-ampere/platform/ampere-utils/ampere_update_mac.sh +++ b/meta-ampere/meta-common/recipes-ampere/platform/ampere-utils/ampere_update_mac.sh @@ -52,6 +52,23 @@ then exit fi +# Check eth port +case ${ETHERNET_INTERFACE} in + "eth0") + ENV_PORT="1" + ;; + "eth1") + ENV_PORT="2" + ;; + "eth2") + ENV_PORT="3" + ;; + *) + Usage + exit + ;; +esac + # Read FRU Board Custom Field 1 to get the MAC address for i in {1..10}; do MAC_ADDR=$(read_mac_address "$BMC_FRU_BUS" "$BMC_FRU_ADDR") @@ -81,12 +98,18 @@ fi # Request to restart the service ifconfig "${ETHERNET_INTERFACE}" down fw_setenv bmc_macaddr "${MAC_ADDR}" + ifconfig "${ETHERNET_INTERFACE}" hw ether "${MAC_ADDR}" retval=$? if [[ $retval -ne 0 ]]; then echo "ERROR: Can not update MAC ADDR to ${ETHERNET_INTERFACE}" exit 1 fi +# Setting LAN MAC Address to xx:xx:xx:xx:xx:xx +ipmitool lan set "${ENV_PORT}" macaddr "${ETHERNET_INTERFACE}" +# Enableing BMC-generated ARP responses & Setting SNMP Community String to public +ipmitool lan set "${ENV_PORT}" arp respond on +ipmitool lan set "${ENV_PORT}" snmp public ifconfig "${ETHERNET_INTERFACE}" up echo "Successfully update the MAC address ${MAC_ADDR} to ${ETHERNET_INTERFACE}" |