Announcement

Collapse
No announcement yet.

Network bridge with KVM

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Network bridge with KVM

    Hi!

    I'm trying to set up a virtual machine with KVM and I have some difficulty configuring the network bridge. I've found several guides on the net and tried to follow the instructions, but I must be missing some important detail, because my machine stubbornly refuses to follow the settings.

    In all the guides one is advised to set up a network bridge on the host for the guestOS to use. In order to do that one must edit the /etc/network/interfaces file.

    Here's my unedited /etc/network/interfaces file:
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    #NetworkManager#iface eth0 inet dhcp
    I tried several configurations and all of them failed in some way.
    Here is the first I tried:
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet manual
    
    # Network bridge
    auto br0
    iface br0 inet dhcp
            bridge_ports eth0
            bridge_stp off
            bridge_fd 0
            bridge_maxwait 0
    After restarting the machine with this config the Network-manager icon in the system tray was crossed over in a red circle. And various automatic services (like update) reported failure because of "no connection". Yet firefox was working fine.
    Then I changed the bridge config to static, like this:
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet manual
    
    # Network bridge
    auto br0
    iface br0 inet static
    	address 192.168.1.4
    	network 192.168.1.0
            netmask 255.255.255.0
            broadcast 192.168.1.255
            gateway 192.168.1.1
            bridge_ports eth0
            bridge_stp off
            bridge_fd 0
            bridge_maxwait 0
    This time, after a restart, not even firefox could connect to internet. But ping command was working normally so I still had a connection, albeit unusable.

    So, what am I doing wrong? I have Kubuntu 13.10 64bit, and my machine is on a home LAN, connected to the net by a regular router. The router recieves an IP from my Internet Provider, but this IP is static. The router has a working DHCP that assigned IPs to devices on the home network. It is configured in such a way that the machine I'm working on always receives the same IP: 192.168.1.4. The router's address on the home network is 192.168.1.1.
    However much I look at this it appears I'm doing everything right. But, obviously, I'm missing something. So some advice would be appreciated. Should I assign a unique MAC-address to the bridge? Do I use a different IP for for the static config of the bridge (I tried assigning 192.168.1.33 to it at first but that didn't work either)? Could I use some GUI or CLI tools to create the bridge, instead of doing it manually? I came accros such commands as addbr, but I thought doing it manually would save me time.

    / Victor

    #2
    Have you seen/read through KVM/Networking?
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Oh, yes! One other thing.
      While I was messing with the interfaces file, the Plasma Desktop was affected in some strange way. It couldn't log me out or restart the computer properly when I tried to do it through the applications menu -- the screen went black and the machine hung in some limbo, though the mouse cursor was visible and reacted to mouse movements. The only thing I could do in this situation was to use the power button.
      However, when I restarted through command line by typing
      Code:
      sudo shutdown -r now
      no problem arose. Only GUI was affected, it seems.

      Comment


        #4
        Originally posted by Snowhog View Post
        Have you seen/read through KVM/Networking?
        Yes. This was one of the guides I tried to follow. Though I'm not sure whether CAP_NET_ADMIN is necessary or not. There is much there that I don't understand, and I am reluctant to follow every detail blindly -- it can rally mess things up, potentially.

        Comment


          #5
          Okay. How about How to install and configure KVM on Ubuntu Server? It looks like it is more straight forward.
          Using Kubuntu Linux since March 23, 2007
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Originally posted by Snowhog View Post
            Okay. How about How to install and configure KVM on Ubuntu Server? It looks like it is more straight forward.
            Didn't have time to experiment since my last visit. But I'll try it now.

            Comment


              #7
              No. It's still the same: I can browse and the ping works fine; I can even access my apache server, but the NetworkManager still shows the "disconnected" state.

              Comment


                #8
                strange ,,,when I made my VM I did not half to do anything ,,,,,,, I made the VM as described hear https://www.kubuntuforums.net/showth...575#post344575 the network was default settings like hear





                and as you can see the net works just fine in the guest using the host wifi connection





                how did you make your VM ?

                VINNY
                i7 4core HT 8MB L3 2.9GHz
                16GB RAM
                Nvidia GTX 860M 4GB RAM 1152 cuda cores

                Comment


                  #9
                  Can you access any servers running on your guest from another computer on the net?
                  For if I understood it correctly, if you want to access the net from your guest you need not do anything special, but if you want your guest to be accessible from the net you must have a virtual bridge. And this is what I'm trying to do.
                  I installed Qemu-KVM and virt-manager. I also installed bridge-utils as recommended in the tutorials.

                  Comment


                    #10
                    Originally posted by zeron00 View Post
                    .....
                    But ping command was working normally so I still had a connection, albeit unusable.
                    / Victor
                    When you can ping but you can't browse that usually means your DNS is not working properly. Any reason why you can't use VirtualBox? None of the stuff you are doing is necessary when using it.
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment

                    Working...
                    X