feat(TSG-9140): 添加mgmt1网卡自动配置IP功能

添加eth_pf_mgmt1自动配置10.253.x.x网段IP的脚本,可以通过3200单独连接
This commit is contained in:
songyanchao
2021-07-29 23:26:57 -04:00
parent 3d3b347ffb
commit f301aaba04
4 changed files with 27 additions and 1 deletions

View File

@@ -81,6 +81,13 @@
mode: 0777
tags: template
- name: "copy eth_pf_mgmt1.ips cfg"
template:
src: "{{ role_path }}/templates/setup.eth_pf_mgmt1.ips.toml.j2"
dest: /sbin/setup.eth_pf_mgmt1.ips
mode: 0777
tags: template
- name: "copy setup.eth_vf_tfe.ips"
template:
src: "{{ role_path }}/templates/setup.eth_vf_tfe.ips.toml.j2"

View File

@@ -7,6 +7,7 @@ then
logger "$0 called for interface named $INF with $STA ..."
case "$INF" in
eth_pf_mgmt0) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt0.ips $INF $STA;;
eth_pf_mgmt1) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt1.ips $INF $STA;;
eth_vf_tfe) logger "Setting $STA $INF RPS ..."; /sbin/setup.eth_vf_tfe.ips $INF $STA;;
esac
fi

View File

@@ -11,4 +11,4 @@ IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth_pf_mgmt1
DEVICE=eth_pf_mgmt1
ONBOOT=no
ONBOOT=yes

View File

@@ -0,0 +1,18 @@
#!/bin/bash
INF="$1"
STA="$2"
logger "$0 called for interface named $INF with $STA ..."
if [ "$INF" == "eth_pf_mgmt1" ]
then
logger "$0: Interface $INF with $STA ,Set $INF ipaddr ..."
output=$(ipmitool picmg addrinfo)
echo $output
substr=${output:22:1}
echo $substr
num=$((16#${substr}+16))
ipaddr='10.253.'$num'.1'
ifconfig eth_pf_mgmt1 $ipaddr netmask 255.255.0.0
fi