Changed method for getting IP, and checking if interface is up