Reverse Network Interface Assignment
Opened this issue · 1 comments
ramukima commented
Following the example at https://hub.docker.com/r/bbvainnotech/kvm/ when I connect my container to more than one networks, the network assignment inside the container is random. What I expect as eth0 becomes eth1 and vice-versa.
QEMU literally takes the first interface as one that is passed first on the command line, the networking of my VM is revered from what I expect.
What would be an idea way to fix this ? Is just "sorting" based on interface number sufficient ?
ramukima commented
The following should take care of network assignment in the order they are specified..
diff --git a/startvm b/startvm
index 46c401c..44e5724 100755
--- a/startvm
+++ b/startvm
@@ -258,7 +258,7 @@ configureNetworks () {
setupDhcp
log "DEBUG" "bridgeName: $bridgeName"
- KVM_NET_OPTS=" -device virtio-net-pci,netdev=net$i,mac=$MAC $KVM_NET_OPTS"
+ KVM_NET_OPTS=" $KVM_NET_OPTS -device virtio-net-pci,netdev=net$i,mac=$MAC "
let i++
done