Fixes for Ubuntu network setup

Cherry pick from https://review.openstack.org/#/c/28106/.

fix bug 1181894

Change-Id: I077e17f4b1857a8dbe9368278e1c96c2d98e3fe9