Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Network Interface Assignment #32

Open
ramukima opened this issue Jun 18, 2018 · 1 comment
Open

Reverse Network Interface Assignment #32

ramukima opened this issue Jun 18, 2018 · 1 comment

Comments

@ramukima
Copy link

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
Copy link
Author

ramukima commented Jun 19, 2018

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

@ramukima ramukima changed the title Random network assignment Reverse Network Interface Assignment Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant