Auto-detection of IP addr