fix for bug 3460: add ipv6 default gateway setup for configib

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15803 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2013-04-03 09:16:20 +00:00
parent 9e50bea3e6
commit cfcf63be3a
2 changed files with 21 additions and 2 deletions

View File

@ -102,7 +102,12 @@ elsif (-f "/etc/SuSE-release")
my $privintf = join(' ', @privates);
# Configuration content
$conf .= "FW_DEV_EXT=\"$::opt_public\"\n";
# if the public and private interface is the same,
# do not set FW_DEV_EXT
if ($::opt_public ne $privintf)
{
$conf .= "FW_DEV_EXT=\"$::opt_public\"\n";
}
$conf .= "FW_DEV_INT=\"$privintf\"\n";
$conf .= "FW_MASQUERADE=\"yes\"\n";
$conf .= "FW_PROTECT_FROM_INT=\"no\"\n";

View File

@ -317,7 +317,11 @@ IPADDR=$nicip" > $dir/ifcfg-$nic
echo "NETMASK=$netmask" >> $dir/ifcfg-$nic
fi
if [ -n "$gateway" ]; then
echo "GATEWAY=$gateway" >> $dir/ifcfg-$nic
# Do not add duplicate default gateway entry
grep -E "default\\s+$gateway\\s+" /etc/sysconfig/network/routes 2>&1 1>/dev/null
if [ $? -ne 0 ]; then
echo "default $gateway - -" >> /etc/sysconfig/network/routes
fi
fi
else # not the first ip address
echo "LABEL_$ipindex=$ipindex
@ -329,6 +333,13 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic
else
echo "NETMASK_$ipindex=$netmask" >> $dir/ifcfg-$nic
fi
if [ -n "$gateway" ]; then
# Do not add duplicate default gateway entry
grep -E "default\\s+$gateway\\s+" /etc/sysconfig/network/routes 2>&1 1>/dev/null
if [ $? -ne 0 ]; then
echo "default $gateway - -" >> /etc/sysconfig/network/routes
fi
fi
fi # end if [ $ipindex -eq 1 ]
elif [ $OS_name == 'redhat' ]
then
@ -371,6 +382,9 @@ IPV6ADDR=$nicip/$netmask" >> $dir/ifcfg-$nic
else
echo "IPV6ADDR_SECONDARIES=$nicip/$netmask" >> $dir/ifcfg-$nic
fi
if [ -n "$gateway" ]; then
echo "IPV6_DEFAULTGW=$gateway" >> $dir/ifcfg-$nic
fi
else # ipv4 address
echo "DEVICE=$nic:$ipindex
BOOTPROTO=static