centos 7
ifconfig ens32|grep "inet"|awk -F ' ' 'NR==1{print $2}'
centos6
ifconfig eth0|awk -F '[: ]+' 'NR==2{print $4 }'