Use private ip if the public ip is nil