Merge "a more proper default nic selection criteria"
diff --git a/lib/nova b/lib/nova
index 61ef64b..5607615 100644
--- a/lib/nova
+++ b/lib/nova
@@ -81,7 +81,12 @@
# the new p* interfaces, then basically picks the first
# alphabetically. It's probably wrong, however it's less wrong than
# always using 'eth0' which doesn't exist on new Linux distros at all.
-GUEST_INTERFACE_DEFAULT=$(route -n | awk '{print $8}' | grep ^[ep] | sort | head -1)
+GUEST_INTERFACE_DEFAULT=$(ip link \
+ | grep 'state UP' \
+ | awk '{print $2}' \
+ | sed 's/://' \
+ | grep ^[ep] \
+ | head -1)
# Get hypervisor configuration
# ----------------------------