2

following ubuntu guide on kvm, I've a test server up and running at this ip address 192.168.0.210 (netmask 255.255.255.0). The virtual machine (same as host ubuntu 11 server) use dhcp but has a specific ip 192.168.122.99. The host (already in bridge with guest) can access guest but for other nodes it's impossible! I've created a new virtual ip on the host 192.168.0.11 and trying to route all requests made to 192.168.122.99 (guest) to this ip, but it fails. I've followed this guide: https://help.ubuntu.com/community/KVM/Networking (paragraph IP Aliases).

Anyone can help?

Regards, Giacomo

1 Answer 1

1

It sounds like you're using one of the 192.168.122.x addresses libvirt assigns by default, when using the NAT mode. This means the VM is running behind a NAT and not on the bridge you've set up.

Check the configuration, and make sure the VM is plugged into the bridge, and not set up to use NAT

7
  • The VM is accessible from the kvm host, so I think is on the bridge. Right? Anyway I've found a solution, routing packets from aliased net interface (192.168.0.11) to vm guest (192.168.122.99) on SPECIFIC PORT. I used this commands: sudo iptables -t nat -A PREROUTING -p tcp -d 192.168.0.11 --dport 80 -j DNAT --to-destination 192.168.122.99:80 sudo iptables -I FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT Thanks, Regards, Giacomo
    – gsscoder
    Oct 14, 2011 at 18:23
  • >The VM is accessible from the kvm host, so I think is on the bridge. Right? ....... wrong. The host has an interface inside the NAT, so it can access it. What you've done is port forwarding. This is ok for a couple of VMs, but it does not scale, and definitely doesn't achieve actually putting the VM on the same network (bcast domain) as the host and the rest of the machines in that network
    – dyasny
    Oct 14, 2011 at 19:20
  • This is what I'm thinking these days... This kind solution can't scale! What's the right way to deploy a virtual network with kvm? How to do to put VM in the same network? Help REALLY appreciated. Can anyone tell me good documentation (books included)? Regards, Giacomo
    – gsscoder
    Oct 15, 2011 at 7:28
  • I am pretty far from anything ubuntu, however, if you post your VM definition xml file, I might be able to help
    – dyasny
    Oct 15, 2011 at 8:02
  • In these days we've moved the test server from a place to another, when it will become available I'll post it. Thanks a lot!
    – gsscoder
    Nov 9, 2011 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .