Results 1 to 5 of 5

Thread: KVM and guest networking (MAC address issues)

  1. #1
    Join Date
    Apr 2006
    Beans
    21

    KVM and guest networking (MAC address issues)

    I followed the section "Virtual NICs on VDE, VDE Tap'd to Host, Tap NATed to Outside" in the Ubuntu KVM networking documentation to enable my KVM guests to communicate with each other. Unfortunately, KVM assigns each virtual machine the same MAC address, which results in all guests getting the same IP address from the DHCP. Assigning static IP addresses doesn't help either in this case.

    First I tried to assign each guest a different MAC address with the KVM option -net nic,macaddr=... This causes the network interface in the guest to be disabled and trying to enable it with ifup eth0 results in the following output:

    Code:
    SIOCSIFADDR: No such device
    eth0: ERROR while getting interface flags: No such device
    eth0: ERROR while getting interface flags: No such device
    Bind socket to interface: No such device
    Failed to bring up eth0.
    Then I tried to specify the MAC address using the tool macchanger in the guest system. This seems to work at the first glance, the interface comes back up with the new MAC address. But it doesn't get an IP address from the DHCP and when I specify a static IP address neither the host nor other guests can ping the guest system.

    Any suggestions how I can get this to work? I simply want the guests and the host to be able to communicate with each other.

    Thanks!

  2. #2
    Join Date
    Apr 2006
    Beans
    21

    Re: KVM and guest networking (MAC address issues)

    Has nobody set up networking between KVM guests yet? I could really use some advices.

  3. #3
    Join Date
    Apr 2006
    Beans
    21

    Re: KVM and guest networking (MAC address issues)

    Okay I figured it out. I have to specify the macaddr option to KVM when I am installing the OS in the virtual machine and can't simply change it later and expect the guest system to detect the change and configure the new card as eth0.
    Can someone tell me how I can do this without having to setup all the virtual machines again? I probably just have to specify that the new network card (new MAC) is supposed to be eth0 from now on... But how?

    Thanks.
    Last edited by Nuld; November 13th, 2007 at 08:05 AM.

  4. #4
    Join Date
    Apr 2006
    Beans
    21

    Re: KVM and guest networking (MAC address issues)

    Okay I figured that out as well. In case someone else is trying to do the same thing: the assignment of network cards to interfaces is done in /etc/udev/rules.d/70-persistent-net.rules.

  5. #5
    Join Date
    Oct 2008
    Beans
    2

    Re: KVM and guest networking (MAC address issues)

    Thanks for the information, despite the fact that nobody replied to you! I was banging my head against the wall all morning (figuratively speaking) trying to figure out why changing the MAC on my KVM guest was causing the network to stop working. I found a similar file within the /etc/udev/rules.d/ directory and deleted the entries. Everything works great now!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •