From cfcf63be3a0b604a74c17343092d7d6cb1e6ae16 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 3 Apr 2013 09:16:20 +0000 Subject: [PATCH] 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 --- xCAT/postscripts/configfirewall | 7 ++++++- xCAT/postscripts/configib | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/configfirewall b/xCAT/postscripts/configfirewall index 477614c1d..ddd864794 100755 --- a/xCAT/postscripts/configfirewall +++ b/xCAT/postscripts/configfirewall @@ -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"; diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 61c361d1b..67665f67e 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -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