Browse code

Merge "a more proper default nic selection criteria"

Jenkins authored on 2014/06/15 10:32:23
Showing 1 changed files
... ...
@@ -81,7 +81,12 @@ FLAT_NETWORK_BRIDGE_DEFAULT=br100
81 81
 # the new p* interfaces, then basically picks the first
82 82
 # alphabetically. It's probably wrong, however it's less wrong than
83 83
 # always using 'eth0' which doesn't exist on new Linux distros at all.
84
-GUEST_INTERFACE_DEFAULT=$(route -n | awk '{print $8}' | grep ^[ep] | sort | head -1)
84
+GUEST_INTERFACE_DEFAULT=$(ip link \
85
+    | grep 'state UP' \
86
+    | awk '{print $2}' \
87
+    | sed 's/://' \
88
+    | grep ^[ep] \
89
+    | head -1)
85 90
 
86 91
 # Get hypervisor configuration
87 92
 # ----------------------------