diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 6644600e7..48bc72ac3 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -715,7 +715,7 @@ elif [ "$1" = "-s" ];then tmp_con_name=${str_inst_nic}"-tmp" nmcli con modify $con_name connection.id $tmp_con_name fi - nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 + nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 gw4 ${str_inst_gateway} str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}-1" if [ -f $str_conf_file_1 ]; then grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null @@ -732,6 +732,7 @@ elif [ "$1" = "-s" ];then echo "ONBOOT=yes" >> $str_conf_file echo "NAME=${con_name}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file + echo "GATEWAY=${str_inst_gateway}" >> $str_conf_file fi if [ $networkmanager_active -eq 2 ]; then echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file @@ -747,14 +748,6 @@ elif [ "$1" = "-s" ];then else echo "MTU=${str_inst_mtu}" >> $str_conf_file fi - fi - if [ -n "$str_inst_gateway" ];then - grep -i "GATEWAY" /etc/sysconfig/network - if [ $? -eq 0 ];then - sed -i "s/.*GATEWAY.*/GATEWAY=${str_inst_gateway}/i" /etc/sysconfig/network - else - echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network - fi fi #add extra params i=0