Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a problem to understand how KVM does networking with a Windows 2008 Server guest I set up. My problem is as follows:

I have a dedicated root server and there's a guest (Win 2k8 server). I installed the ethernet drivers from the ISO image within the VM. So the Adapter is this RedHat VirtIO thingy. That has been successful within the guest. The config is using virtio for a NIC and I set the bridge to virbr0:

virbr0    Link encap:Ethernet  HWaddr fe:54:00:0e:68:af  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16231 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3279 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2637216 (2.5 MiB)  TX bytes:705652 (689.1 KiB)

There's another interface:

vnet0     Link encap:Ethernet  HWaddr fe:54:00:0e:68:af  
          inet6 addr: fe80::fc54:ff:fe0e:68af/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2529 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44561 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:571094 (557.7 KiB)  TX bytes:2366159 (2.2 MiB)

What I want is to have networking for the guest and the ability to use rdesktop (so the port needs to be forwarded I guess). I try to avoid any iptables magic since it doesn't make to much sense to handle that on a firewall. How do I get network access in both directions to/from a guest.

If 192.168.122.1 is the bridge, how do I reach the VM? For rdesktop or something? Practically I want to reach the rdesktop port from eth0 or so, which is the external interface with a reachable IP address.

Update:

route:

         target            gateway          source    proto    scope    dev tbl
       10.8.0.2                           10.8.0.1   kernel     link   tun0 
   217.11.52.0/ 24                   217.11.52.231   kernel     link   eth0 
      10.8.0.0/ 24        10.8.0.2                                     tun0 
 192.168.122.0/ 24                   192.168.122.1   kernel     link virbr0 
        default        217.11.52.1                                     eth0 
127.255.255.255          broadcast       127.0.0.1   kernel     link     lo local
       10.8.0.1              local        10.8.0.1   kernel     host   tun0 local
    217.11.52.0          broadcast   217.11.52.231   kernel     link   eth0 local
  217.11.52.231              local   217.11.52.231   kernel     host   eth0 local
  217.11.52.230              local   217.11.52.231   kernel     host   eth0 local
  192.168.122.1              local   192.168.122.1   kernel     host virbr0 local
  192.168.122.0          broadcast   192.168.122.1   kernel     link virbr0 local
  217.11.52.233              local   217.11.52.231   kernel     host   eth0 local
  217.11.52.232              local   217.11.52.231   kernel     host   eth0 local
  217.11.52.255          broadcast   217.11.52.231   kernel     link   eth0 local
      127.0.0.0          broadcast       127.0.0.1   kernel     link     lo local
192.168.122.255          broadcast   192.168.122.1   kernel     link virbr0 local
      127.0.0.1              local       127.0.0.1   kernel     host     lo local
     127.0.0.0/ 8            local       127.0.0.1   kernel     host     lo local
        fe80::/ 64                                   kernel            eth0 
        fe80::/ 64                                   kernel          virbr0 
        fe80::/ 64                                   kernel           vnet0 
        default        unreachable                   kernel              lo unspec
            ::1                 ::                     none              lo local
fe80::21b:21ff:fe95:a4f                 ::                     none              lo local
fe80::fc54:ff:fe0e:68af                 ::                     none              lo local
        ff00::/ 8                                                      eth0 local
        ff00::/ 8                                                    virbr0 local
        ff00::/ 8                                                     vnet0 local
        default        unreachable                   kernel              lo unspec

brctl show

bridge name     bridge id               STP enabled     interfaces
virbr0          8000.fe54000e68af       yes             vnet0
share|improve this question
    
If the bridge IP is 192.168.122.1, then what is the gateway? Is the Debian host's interface attached to virbr0? –  Chris Ting Oct 26 '11 at 13:50
    
I have no idea... practically each and every piece of documentation ended where people poped up a VNC connection. I installed the driver and now I expect it works... however I only get a VNC with this virt-manager thingy –  wishi Oct 26 '11 at 14:43

1 Answer 1

up vote 1 down vote accepted

I believe your bridge isn't set up properly.

To set up a bridge on the Debian server, you'd define your bridge with an IP and network (which you have). Then you'd have a route for the bridge. You haven't shown us your routing table. You can see that from the Debian server with the command

route

Your issue could be your routing table, so please update your question with that. Also, it's odd to me that your bridge IP would be 192.168.122.1 as that is usually the gateway IP.

Once your bridge is set up, you need to add your interface to it. KVM should automatically enter a guest's interface. Check that you've placed the Debian server's interface (did you provide that?) is placed on the bridge. You do this with the command:

brctl show

If you could update your question with the results of that command, that will help us determine if everything is setup.

UPDATE

The output of your route command shows that you have an interface named eth0 which I assume is the network interface of your Debian box. You need to add eth0 to your bridge with the command:

brctl addif virbr0 eth0

Where did you get the IP 192.168.122.1 for the bridge? Normally I'd have no IP on eth0, assign the IP I'd have given to eth0 to the bridge, and then added eth0 to the bridge with the above command. After that I'd check that the default route was correct, and then try to ping 8.8.8.8 from the Debian box to check my network at that point. KVM should add the virtual guest network device to the bridge with no further configuration from you. Confirm that by starting up a guest and then use the brctl show command and see what's attached to the bridge.

share|improve this answer
    
Thanks for these hints. I updated my question with the suggested outputs. That vibr0 was on the system after the kvm-qemu install, so I suppose it was meant to be used with virt-manager/virtIO. It is a bridge interface - at least. –  wishi Oct 26 '11 at 16:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.