diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 76f1ce2a2..6644600e7 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -524,6 +524,7 @@ elif [ "$1" = "-s" ];then str_inst_mask='' str_inst_gateway='' str_inst_mtu='' + str_inst_dns='' if [ "$str_os_type" = "aix" ];then log_error "configeth on $NODE: aix does not support -s flag" exit 1 @@ -578,6 +579,7 @@ elif [ "$1" = "-s" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` + str_inst_dns=`grep domain-name-servers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` else if [ -n "$MACADDRESS" ];then str_inst_mac=$MACADDRESS @@ -734,6 +736,11 @@ elif [ "$1" = "-s" ];then if [ $networkmanager_active -eq 2 ]; then echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file fi + if [ -n "${str_inst_dns}" ];then + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name ipv4.dns ${str_inst_dns} + fi + fi if [ -n "${str_inst_mtu}" ];then if [ $networkmanager_active -eq 1 ]; then nmcli con modify $con_name mtu ${str_inst_mtu}