Utility

Verifying listening ports

nmap -sT -O localhost

Server ports

Add user to sudoer list

sudo bash

adduser stack

Password : stack

echo "stack ALL=(ALL) NOPASSWD: ALL" » /etc/sudoers

exit

Change interface to onboot ip dhcp

Change ONBOOT=yes at /etc/sysconfig/network-scripts/ifcfg-enp0s3

Get ip address via script

echo `ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'`

This will give you the IP address of eth0.