Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 40 additions & 16 deletions xCAT/postscripts/configib
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,25 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic
if [ $ipindex -eq 1 ]
then
if [[ "$OSVER" =~ ^(rhels9|alma9|rocky9) ]]; then
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con add type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con add type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
if nmcli --field connection.id con show $nic 2>&1 1>/dev/null
then # modify current connection
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con modify $nic type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con modify $nic type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
fi
else # create new connection
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con add type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con add type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
fi
fi
else
nmcontrol=""
Expand Down Expand Up @@ -540,7 +552,7 @@ IPADDR=$nicip" > $dir/ifcfg-$nic
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ ^(rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
nmcli con modify $nic $name $value
else
grep -i "${name}" $dir/ifcfg-$nic
if [ $? -eq 0 ];then
Expand All @@ -553,13 +565,25 @@ IPADDR=$nicip" > $dir/ifcfg-$nic
done
else # not the first ip address
if [[ "$OSVER" =~ ^(rhels9|alma9|rocky9) ]]; then
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con add type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con add type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
if nmcli --field connection.id con show $nic 2>&1 1>/dev/null
then # modify current connection
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con modify $nic type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con modify $nic type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
fi
else # create new connection
# ipv6
if echo $nicip | grep : 2>&1 1>/dev/null
then
nmcli con add type infiniband con-name $nic ifname $nic ipv6.method manual ipv6.addresses $nicip
else # ipv4
prefix=$(convert_netmask_to_cidr $netmask)
nmcli con add type infiniband con-name $nic ifname $nic ipv4.method manual ipv4.addresses $nicip/$prefix
fi
fi
else
# ipv6
Expand Down Expand Up @@ -620,7 +644,7 @@ IPADDR$ipindex=$nicip"
value="${array_extra_param_values[$i]}"
echo " $i: name=$name value=$value"
if [[ "$OSVER" =~ ^(rhels9|alma9|rocky9) ]]; then
nmcli con modify $con_name $name $value
nmcli con modify $nic $name $value
else
grep -i "${name}" $cfgfile
if [ $? -eq 0 ]; then
Expand Down