Use private ip when the private flag is set.