adding check for public and private networks

Change-Id: I0d96d048a66ca95e8f0eb7b1383e2f5a5a135695