项目

一般

简介

错误 #5299

os版本为2.0.2时,针对OS系统较老的环境/yzmm/gNB_config.sh文件内容需要更新

杨 凯8 天 之前添加.

状态:
新建
优先级:
一般
指派给:
开始日期:
2026-05-19
计划完成日期:
% 完成:

0%

预期时间:
问题归属:
DRV
发现问题版本:
Rel_3.2.2
目标解决问题版本:
Rel_3.2.2

描述

os版本为2.0.2时,针对OS系统较老的环境/yzmm/gNB_config.sh文件内容需要更新
备注:
旧的文件:
root@driver:~# cat /yzmm/gNB_config.sh
ifconfig eth0 192.168.68.236 broadcast 192.168.68.255 netmask 255.255.255.0
ifconfig eth0 down
ifconfig eth0 hw ether b2:00:62:76:f2:36
ifconfig eth0 up
ip route add default via 192.168.68.1

#ifconfig eth2 192.168.62.236 broadcast 192.168.62.255 netmask 255.255.255.0
#ifconfig eth2 down
#ifconfig eth2 hw ether b2:22:62:76:f2:36
#ifconfig eth2 up
#ip route add default via 192.168.62.1

新的文件:
root@driver:/yzmm# cat gNB_config.sh
#!/bin/bash

ifconfig eth0 192.168.62.247 broadcast 192.168.255.255 netmask 255.255.255.0
ifconfig eth0 down

mac=""
result=$(eeprom_rw get mac)
if [ $result = "error" ]; then
echo "eeprom read mac error"
else
mac=$(echo $result | awk -F= '{print $2}')
ifconfig eth0 hw ether $mac
ifconfig eth0 up
ip route add default via 192.168.62.1

fi

hex_str=$(echo "$mac" | tr -d ':')
dec_num=$((16#$hex_str))
new_dec=$((dec_num + 1))
new_hex=$(printf "%012X" $new_dec)
new_mac=$(echo "$new_hex" | sed -E 's/(..)/\1:/g; s/:$//')

echo "MAC: $mac"
echo "MAC1: $new_mac"

ifconfig eth2 192.168.68.247 broadcast 192.168.255.255 netmask 255.255.255.0
ifconfig eth2 down
ifconfig eth2 hw ether $new_mac
ifconfig eth2 up
#ip route add default via 192.168.2.254
hwtype=$(/usr/bin/eeprom_rw get type |awk -F'=' '{print $2}')
echo "==================>${hwtype}"

if [ ${hwtype}x = "EVMT4"x ]; then
if [ -d /yzmm/gnb ]; then
cp /yzmm/gnb/baseService/baseservice.service /lib/systemd/system/
cp /yzmm/gnb/logwriter/logwriter.service /lib/systemd/system/
cp /yzmm/gnb/sysrepoCfgTool/sysrepocfgtool.service /lib/systemd/system/
cp /yzmm/gnb/agent/gnb_agent.service /lib/systemd/system/
cp /yzmm/gnb/du/bin/du.service /lib/systemd/system/
cp /yzmm/gnb/cu/bin/cu.service /lib/systemd/system/
systemctl enable gnb_agent.service
systemctl enable baseservice.service
systemctl daemon-reload
sleep 1
systemctl restart gnb_agent.service
systemctl restart baseservice.service
fi
fi
建议升级时替换以新的gNB_config.sh为准

导出 Atom PDF