network IP retrieving method modified for Linux